You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Lowe <ma...@talk21.com> on 2003/08/02 17:30:18 UTC
dyna form property size.
Can anyone help me with some nice ways of changing the length (size
attribute in stuts-config) for a form property..
James Turner;s primer is great on this subject apart from the details
of how to do this are skipped over..
<quote>
You can even dynamically specify the size of the form (and prepopulate
it) at run time. I've recently used this technique with an insurance
application where the user has to choose various parameters such as
copays and deductables for a claim modeling system. by using an
Action instead of a forward to precreate the form-property value, and
leaving the size parameter out. The actual can then create an array
of the appropriate size and prepopulate values. The only trick is
that the form must be placed in session scope, because it needs to be
available and of the right size to accept the submitted values.
</quote>
http://developer.com/java/ejb/article.php/2233591
Now I've an action that populates my form, but I see no obvious way of
reseting the length of the form property array (not array of form
properties). The only way I've thought of is to create another dynabean
and copy the properties to the new one.
any ideas appreciated..
Cheers Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: NewBie: Iterations for a constant no. of times
Posted by Erez Efrati <er...@netmedia.net.il>.
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:forEach begin="1" end="5">
... what ever you want here
</c:forEach>
Hope this helps,
Erez
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 5:09 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
That's fine Oz...
Actually by looking at your reply,I thought you know that it cannot be
done
by Struts...
Thanks for letting me onto JSTL....
-----Original Message-----
From: Oguz Kologlu [mailto:ozkologlu@optushome.com.au]
Sent: Sunday, August 03, 2003 8:29 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Jitesh,
I didn't say that. I think you have some misconceptions about
what struts is.
You were asking how to do a for loop. The answer is to use the
Java Standard Tag Library - JSTL. There is no need to use
struts tags for this. JSTL and Struts tags play very
nicely together.
If you are absolutely desperate to use the struts tags instead
you'll have to dig out the right tag yourself since I won't waste
my time on it.
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:35 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
you mean to say there is absolutely no way I can achieve it by using
Struts???
If that is the case,struts is not a wise choice to use in our
apps..because
we don't know what is present there and what is not....
-----Original Message-----
From: Oguz Kologlu [mailto:ozkologlu@optushome.com.au]
Sent: Sunday, August 03, 2003 7:55 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
You should be using the JSTL for this.
Have a look at a concise JSTL reference at:
http://www.manning.com/bayern/appendixA.pdf
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:06 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Somebody please answer my question as in the email below......
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which
will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use
over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in
this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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: NewBie: Iterations for a constant no. of times
Posted by Jitesh Sinha <js...@cisco.com>.
That's fine Oz...
Actually by looking at your reply,I thought you know that it cannot be done
by Struts...
Thanks for letting me onto JSTL....
-----Original Message-----
From: Oguz Kologlu [mailto:ozkologlu@optushome.com.au]
Sent: Sunday, August 03, 2003 8:29 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Jitesh,
I didn't say that. I think you have some misconceptions about
what struts is.
You were asking how to do a for loop. The answer is to use the
Java Standard Tag Library - JSTL. There is no need to use
struts tags for this. JSTL and Struts tags play very
nicely together.
If you are absolutely desperate to use the struts tags instead
you'll have to dig out the right tag yourself since I won't waste
my time on it.
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:35 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
you mean to say there is absolutely no way I can achieve it by using
Struts???
If that is the case,struts is not a wise choice to use in our apps..because
we don't know what is present there and what is not....
-----Original Message-----
From: Oguz Kologlu [mailto:ozkologlu@optushome.com.au]
Sent: Sunday, August 03, 2003 7:55 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
You should be using the JSTL for this.
Have a look at a concise JSTL reference at:
http://www.manning.com/bayern/appendixA.pdf
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:06 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Somebody please answer my question as in the email below......
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: NewBie: Iterations for a constant no. of times
Posted by Oguz Kologlu <oz...@optushome.com.au>.
Jitesh,
I didn't say that. I think you have some misconceptions about
what struts is.
You were asking how to do a for loop. The answer is to use the
Java Standard Tag Library - JSTL. There is no need to use
struts tags for this. JSTL and Struts tags play very
nicely together.
If you are absolutely desperate to use the struts tags instead
you'll have to dig out the right tag yourself since I won't waste
my time on it.
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:35 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
you mean to say there is absolutely no way I can achieve it by using
Struts???
If that is the case,struts is not a wise choice to use in our apps..because
we don't know what is present there and what is not....
-----Original Message-----
From: Oguz Kologlu [mailto:ozkologlu@optushome.com.au]
Sent: Sunday, August 03, 2003 7:55 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
You should be using the JSTL for this.
Have a look at a concise JSTL reference at:
http://www.manning.com/bayern/appendixA.pdf
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:06 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Somebody please answer my question as in the email below......
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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: NewBie: Iterations for a constant no. of times
Posted by Jitesh Sinha <js...@cisco.com>.
you mean to say there is absolutely no way I can achieve it by using
Struts???
If that is the case,struts is not a wise choice to use in our apps..because
we don't know what is present there and what is not....
-----Original Message-----
From: Oguz Kologlu [mailto:ozkologlu@optushome.com.au]
Sent: Sunday, August 03, 2003 7:55 PM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
You should be using the JSTL for this.
Have a look at a concise JSTL reference at:
http://www.manning.com/bayern/appendixA.pdf
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:06 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Somebody please answer my question as in the email below......
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: NewBie: Iterations for a constant no. of times
Posted by Oguz Kologlu <oz...@optushome.com.au>.
You should be using the JSTL for this.
Have a look at a concise JSTL reference at:
http://www.manning.com/bayern/appendixA.pdf
Oz
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Monday, 4 August 2003 12:06 AM
To: Struts Users Mailing List
Subject: RE: NewBie: Iterations for a constant no. of times
Somebody please answer my question as in the email below......
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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: NewBie: Iterations for a constant no. of times
Posted by Jitesh Sinha <js...@cisco.com>.
Somebody please answer my question as in the email below......
-----Original Message-----
From: Jitesh Sinha [mailto:jsinha@cisco.com]
Sent: Sunday, August 03, 2003 3:20 PM
To: Struts Users Mailing List
Subject: NewBie: Iterations for a constant no. of times
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
NewBie: Iterations for a constant no. of times
Posted by Jitesh Sinha <js...@cisco.com>.
I have to show a row of 3 text fields a constant no. (say 5 ) of times .
I have the code to show these 3 text fields in place in my jsp which will
look like :
<table>
<tr>
<td><input type=text name=aTextField></td>
<td><input type=text name=anotherTextField></td>
<td><input type=text name=anotherOneTextField></td>
</tr>
</table>
I want this code to be iterated 5 times .which struts tag should I use over
this code??
<logic:iterate> requires a collection as a property of the bean .
I don't want to go to bean for this .I know this iteration variable(in this
case the value is 5)beforehand .So there is no need to go to bean .
Please help.
Thanks,
Jitesh
---------------------------------------------------------------------
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: dyna form property size.
Posted by Mark Lowe <ma...@talk21.com>.
Okay I've been looking at the struts source to try an solve this, I
tried using the form config objects and setting the size there, but the
form configuration is frozen. So when i try to set the form property
size at run time i get an exception..
Merely attempting to populate the form to set to size also has none of
it. As it defaults to 0.
Any suggestions please.. I would have doubts this is possible, if the
author hadn't written he's done it.
Cheers Mark
On Saturday, August 2, 2003, at 04:30 PM, Mark Lowe wrote:
> Can anyone help me with some nice ways of changing the length (size
> attribute in stuts-config) for a form property..
>
> James Turner;s primer is great on this subject apart from the details
> of how to do this are skipped over..
>
> <quote>
> You can even dynamically specify the size of the form (and prepopulate
> it) at run time. I've recently used this technique with an insurance
> application where the user has to choose various parameters such as
> copays and deductables for a claim modeling system. by using an
> Action instead of a forward to precreate the form-property value, and
> leaving the size parameter out. The actual can then create an array
> of the appropriate size and prepopulate values. The only trick is
> that the form must be placed in session scope, because it needs to be
> available and of the right size to accept the submitted values.
> </quote>
> http://developer.com/java/ejb/article.php/2233591
>
> Now I've an action that populates my form, but I see no obvious way of
> reseting the length of the form property array (not array of form
> properties). The only way I've thought of is to create another
> dynabean and copy the properties to the new one.
>
> any ideas appreciated..
> Cheers Mark
>
> ---------------------------------------------------------------------
> 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