You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Patrick Cheng <pa...@hq.oneport.com> on 2004/02/12 07:26:49 UTC

Question on iterate

Hi all,

I guess it should be an easy question about logic:iterate.

I can do this:

<logic:iterate name="myForm" property="results" id="result"
indexId="ctr">
<html:hidden name="result" property="bookingNo" indexed="true"/>
</logic:iterate>

Question is.  HOW can I just display the value, instead of setting it in
the hidden field? I mean, essentially I'm trying to do a bean write:

<logic:iterate name="myForm" property="results" id="result"
indexId="ctr">
<bean:write name="result" property="bookingNo" indexed="true"/>
</logic:iterate>

But the beanwrite doesn't support indexed. So, what's the right way of
doing it?

Thanks.
Patrick.

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


Re: Question on iterate

Posted by Manish Singla <Ma...@Sun.COM>.
bean:write cannot support index as bean:write just writes as plain text.
See if html:text with configuration of attributes works for you

HTH
Manish Singla

Patrick Cheng wrote:

> Hi all,
>
> I guess it should be an easy question about logic:iterate.
>
> I can do this:
>
> <logic:iterate name="myForm" property="results" id="result"
> indexId="ctr">
> <html:hidden name="result" property="bookingNo" indexed="true"/>
> </logic:iterate>
>
> Question is.  HOW can I just display the value, instead of setting it in
> the hidden field? I mean, essentially I'm trying to do a bean write:
>
> <logic:iterate name="myForm" property="results" id="result"
> indexId="ctr">
> <bean:write name="result" property="bookingNo" indexed="true"/>
> </logic:iterate>
>
> But the beanwrite doesn't support indexed. So, what's the right way of
> doing it?
>
> Thanks.
> Patrick.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org



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


RE: Question on iterate

Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Hi

   The following should work. The hidden variable is needed if  you want to
send it back to the proper indexed property when you submit.


<logic:iterate name="myForm" property="results" id="result"
indexId="ctr">
<bean:write name="result" property="bookingNo"/>
<html:hidden name="result" property="bookingNo" indexed="true"/>
</logic:iterate>


Mohan

-----Original Message-----
From: Patrick Cheng [mailto:patrick.cheng@hq.oneport.com]
Sent: Thursday, February 12, 2004 11:57 AM
To: Struts Users Mailing List
Subject: Question on iterate


Hi all,

I guess it should be an easy question about logic:iterate.

I can do this:

<logic:iterate name="myForm" property="results" id="result"
indexId="ctr">
<html:hidden name="result" property="bookingNo" indexed="true"/>
</logic:iterate>

Question is.  HOW can I just display the value, instead of setting it in
the hidden field? I mean, essentially I'm trying to do a bean write:

<logic:iterate name="myForm" property="results" id="result"
indexId="ctr">
<bean:write name="result" property="bookingNo" indexed="true"/>
</logic:iterate>

But the beanwrite doesn't support indexed. So, what's the right way of
doing it?

Thanks.
Patrick.

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