You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tom Pop <to...@email.cz> on 2009/02/17 11:56:17 UTC

struts2 + tiles

Hello,

please, how to insert localized string XXX as attribute in tiles definition?

<tiles:insertDefinition name="layout-main">
    <tiles:putAttribute name="document-title" value="XXX" />
</tiles:insertDefinition>

You can't use <s:text /> because it's nested in tiles tag. You can't use getText(), I think because it's not struts tag. So, how read localized text and insert it to tiles attribute value?
Please, provide the example, I think it should be simple, but I didn't find any solution...

Thanks.
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Struts2 form layout

Posted by David Kerwick <Da...@hse.ie>.
Hi,
    Is it possible to adjust the layout of an ajax themed form by using css?
I'd like to have a four column layout instead of two.
I tried creating a div around half the content and floating it right put the div ends up outside the form table for some reason.
I tried creating another table around half the contents and floating it, that works but the validation had problems, it could insert the error line but not remove it which means the same error could build up.

I'd like to use css rather than trying to change the freemarker template as I assume I would also have to change the ajax javascript which could get confusing.

Or is there a better way of changing the layout to get four columns and kept the validation happy?

Thanks
Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts2 + tiles

Posted by Пламен Узунов <pu...@gmail.com>.
Thanks, Antonio!!!
This works perfectly!
Greetings!

2009/2/18 Antonio Petrelli <an...@gmail.com>

> 2009/2/17 Пламен Узунов <pu...@gmail.com>:
> > How will do it if you have a tiles list-attribute for title?
> > Something like this:
> > <definition name="tiles.tabs" extends="tiles.layout">
> >    <put-list-attribute name="tabs">
> >        <item value="TAB_ACTION1" link="action1.action" />
> >        <item value="TAB_ACTION2" link="action2.action" />
> >        <item value="TAB_ACTION3" link="action3.action" />
> >        <item value="TAB_ACTION4" link="action4.action" />
> >        <item value="TAB_ACTION5" link="action5.action" />
> >    </put-list-attribute>
> > </definition>
>
> <tiles:importAttribute name="tabs" />
> <c:forEach var="tab" items="tabs">
>  <c:set var="title" value="${tab.value}" />
>   <s:text name="%{#attr['title']}"/></title>
> </c:forEach>
>
> HTH
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts2 + tiles

Posted by Antonio Petrelli <an...@gmail.com>.
2009/2/17 Пламен Узунов <pu...@gmail.com>:
> How will do it if you have a tiles list-attribute for title?
> Something like this:
> <definition name="tiles.tabs" extends="tiles.layout">
>    <put-list-attribute name="tabs">
>        <item value="TAB_ACTION1" link="action1.action" />
>        <item value="TAB_ACTION2" link="action2.action" />
>        <item value="TAB_ACTION3" link="action3.action" />
>        <item value="TAB_ACTION4" link="action4.action" />
>        <item value="TAB_ACTION5" link="action5.action" />
>    </put-list-attribute>
> </definition>

<tiles:importAttribute name="tabs" />
<c:forEach var="tab" items="tabs">
  <c:set var="title" value="${tab.value}" />
  <s:text name="%{#attr['title']}"/></title>
</c:forEach>

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts2 + tiles

Posted by Пламен Узунов <pu...@gmail.com>.
The problem is that I can't put multiple values from 'tab' list attribute as
a values from properties file which have internationalized text (it I use
for menus, tabs, etc.)

RE: struts2 + tiles

Posted by David Kerwick <Da...@hse.ie>.
Not sure
Can you not add in
<put-attribute name="title"  value="welcome.title"/>
Before your 
<put-list-attribute name="tabs">
To pass the title to the template.

Dave
-----Original Message-----
From: Пламен Узунов [mailto:puzunoff@gmail.com] 
Sent: 17 February 2009 17:28
To: Struts Users Mailing List
Subject: Re: struts2 + tiles

How will do it if you have a tiles list-attribute for title?
Something like this:
<definition name="tiles.tabs" extends="tiles.layout">
    <put-list-attribute name="tabs">
        <item value="TAB_ACTION1" link="action1.action" />
        <item value="TAB_ACTION2" link="action2.action" />
        <item value="TAB_ACTION3" link="action3.action" />
        <item value="TAB_ACTION4" link="action4.action" />
        <item value="TAB_ACTION5" link="action5.action" />
    </put-list-attribute>
</definition>

Papi.

On Tue, Feb 17, 2009 at 4:19 PM, David Kerwick <Da...@hse.ie> wrote:

> I had a similar issue and solved it like this
>
> In the definition I had
>
> <put-attribute name="title"  value="welcome.title"/>
>
> And in the template I put
>
> <tiles:importAttribute name="title" />
> <title><s:text name="%{#attr['title']}"/></title>
>
> Dave
>
> -----Original Message-----
> From: Tom Pop [mailto:tom.pop@email.cz]
> Sent: 17 February 2009 10:56
> To: Struts Users Mailing List
> Subject: struts2 + tiles
>
> Hello,
>
> please, how to insert localized string XXX as attribute in tiles
> definition?
>
> <tiles:insertDefinition name="layout-main">
>    <tiles:putAttribute name="document-title" value="XXX" />
> </tiles:insertDefinition>
>
> You can't use <s:text /> because it's nested in tiles tag. You can't use
> getText(), I think because it's not struts tag. So, how read localized text
> and insert it to tiles attribute value?
> Please, provide the example, I think it should be simple, but I didn't find
> any solution...
>
> Thanks.
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Пламен Узунов,
М-Тел: 088/8869066,
puzunoff@gmail.com,
webmaster@bgprinter.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts2 + tiles

Posted by Пламен Узунов <pu...@gmail.com>.
How will do it if you have a tiles list-attribute for title?
Something like this:
<definition name="tiles.tabs" extends="tiles.layout">
    <put-list-attribute name="tabs">
        <item value="TAB_ACTION1" link="action1.action" />
        <item value="TAB_ACTION2" link="action2.action" />
        <item value="TAB_ACTION3" link="action3.action" />
        <item value="TAB_ACTION4" link="action4.action" />
        <item value="TAB_ACTION5" link="action5.action" />
    </put-list-attribute>
</definition>

Papi.

On Tue, Feb 17, 2009 at 4:19 PM, David Kerwick <Da...@hse.ie> wrote:

> I had a similar issue and solved it like this
>
> In the definition I had
>
> <put-attribute name="title"  value="welcome.title"/>
>
> And in the template I put
>
> <tiles:importAttribute name="title" />
> <title><s:text name="%{#attr['title']}"/></title>
>
> Dave
>
> -----Original Message-----
> From: Tom Pop [mailto:tom.pop@email.cz]
> Sent: 17 February 2009 10:56
> To: Struts Users Mailing List
> Subject: struts2 + tiles
>
> Hello,
>
> please, how to insert localized string XXX as attribute in tiles
> definition?
>
> <tiles:insertDefinition name="layout-main">
>    <tiles:putAttribute name="document-title" value="XXX" />
> </tiles:insertDefinition>
>
> You can't use <s:text /> because it's nested in tiles tag. You can't use
> getText(), I think because it's not struts tag. So, how read localized text
> and insert it to tiles attribute value?
> Please, provide the example, I think it should be simple, but I didn't find
> any solution...
>
> Thanks.
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Пламен Узунов,
М-Тел: 088/8869066,
puzunoff@gmail.com,
webmaster@bgprinter.com.

RE: struts2 + tiles

Posted by David Kerwick <Da...@hse.ie>.
I had a similar issue and solved it like this

In the definition I had

<put-attribute name="title"  value="welcome.title"/>

And in the template I put

<tiles:importAttribute name="title" />
<title><s:text name="%{#attr['title']}"/></title>

Dave

-----Original Message-----
From: Tom Pop [mailto:tom.pop@email.cz] 
Sent: 17 February 2009 10:56
To: Struts Users Mailing List
Subject: struts2 + tiles

Hello,

please, how to insert localized string XXX as attribute in tiles definition?

<tiles:insertDefinition name="layout-main">
    <tiles:putAttribute name="document-title" value="XXX" />
</tiles:insertDefinition>

You can't use <s:text /> because it's nested in tiles tag. You can't use getText(), I think because it's not struts tag. So, how read localized text and insert it to tiles attribute value?
Please, provide the example, I think it should be simple, but I didn't find any solution...

Thanks.
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org