You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by an...@freenet.de on 2007/07/10 08:09:43 UTC

logic:iterate - problem

Hello!

I've got a problem to get a value within a logic:iterate construction 
(foo is an ArrayList <Object>):

<logic:iterate name="foo" id="object">
   <html:textarea ... rows='<bean:write name="object" property="rows"/>' />
</logic:iterate>

This does not work.

How must it been written to address the method getRows() in the object,
which has been defined by id in logic:iterate?


Kind regards,
Andreas Hartmann



"Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken"
http://produkte.shopping.freenet.de/handy_voip_isdn/klarmobil/index.html?pid=730025


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


Re: logic:iterate - problem

Posted by Andreas Hartmann <an...@freenet.de>.
Hello Chad, hello Yoge,

thanks for your hints!
meanwhile, I could find a third solution:


<logic:iterate name="foo" id="object" type="my.url.classname">
    <html:textarea ... rows="<%= object.getRows() %>" />
</logic:iterate>

Another solution should be to use EL:

    <html:textarea ... rows="${object.rows}"/>

But this solution doesn't work for me (the string ${object.rows} appears
unchanged after rows=) , though I'm using tomcat 5.5 and struts 1.2.9..


May be, it should be written as:

<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic-el" %>

<logic-el:iterate name="foo" id="object" type="my.url.classname">
    <html-el:textarea ... rows="${object.rows}" />
</logic-el:iterate>

(from: http://entwickler-forum.de/showthread.php?t=33417 )


Kind regards,
Andreas Hartmann


Chad S. Lauritsen wrote:
> Another way to do it (with a little bit less java) is:
> 
> <logic:iterate name="foo" id="object">
>    <bean:define id="rows" name="object" property="rows" />
>    <html:textarea ... rows='<%=rows%>' />
> </logic:iterate>
> 
> 
> 
> andihartmann@freenet.de wrote:
>> Hello!
>>
>> I've got a problem to get a value within a logic:iterate construction 
>> (foo is an ArrayList <Object>):
>>
>> <logic:iterate name="foo" id="object">
>>    <html:textarea ... rows='<bean:write name="object" property="rows"/>' />
>> </logic:iterate>
>>
>> This does not work.
>>
>> How must it been written to address the method getRows() in the object,
>> which has been defined by id in logic:iterate?
>>
>>
>> Kind regards,
>> Andreas Hartmann

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


Re: logic:iterate - problem

Posted by "Chad S. Lauritsen" <ch...@sherwin.com>.
Another way to do it (with a little bit less java) is:

<logic:iterate name="foo" id="object">
   <bean:define id="rows" name="object" property="rows" />
   <html:textarea ... rows='<%=rows%>' />
</logic:iterate>



andihartmann@freenet.de wrote:
> Hello!
>
> I've got a problem to get a value within a logic:iterate construction 
> (foo is an ArrayList <Object>):
>
> <logic:iterate name="foo" id="object">
>    <html:textarea ... rows='<bean:write name="object" property="rows"/>' />
> </logic:iterate>
>
> This does not work.
>
> How must it been written to address the method getRows() in the object,
> which has been defined by id in logic:iterate?
>
>
> Kind regards,
> Andreas Hartmann
>
>
>
> "Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken"
> http://produkte.shopping.freenet.de/handy_voip_isdn/klarmobil/index.html?pid=730025
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   

-- 
Chad S. Lauritsen
Ecommerce Enterprise Developer
The Sherwin-Williams Company
216-566-2166


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


Re: logic:iterate - problem

Posted by Yoge <yo...@gmail.com>.
Try following tag...
<html:textarea ... rows='<%=
((YourObject)pageContext.getAttribute("object")).getRows()%>' />

On 7/10/07, andihartmann@freenet.de <an...@freenet.de> wrote:
>
> Hello!
>
> I've got a problem to get a value within a logic:iterate construction
> (foo is an ArrayList <Object>):
>
> <logic:iterate name="foo" id="object">
>    <html:textarea ... rows='<bean:write name="object" property="rows"/>'
> />
> </logic:iterate>
>
> This does not work.
>
> How must it been written to address the method getRows() in the object,
> which has been defined by id in logic:iterate?
>
>
> Kind regards,
> Andreas Hartmann
>
>
>
> "Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken"
>
> http://produkte.shopping.freenet.de/handy_voip_isdn/klarmobil/index.html?pid=730025
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

-- 
Yoge,
AdventNet, Inc.
925-965-6528
yogendrav@adventnet.com
site24x7.com