iteration to create dynamic form

2003-06-25 Thread Piers Dunleavy
I have a  tag which is supposed to create a dynamic form, filled with a 
checkbox for every object in a collection. (The checkbox is an option to delete one of 
those records from the database.) The form itself is a Map-Backed Action form with two 
methods (public void setValue(String key, Object value) and public Object 
getValue(String key)). 




<%
(dataobjects.Record) l = (dataobjects.Record)pageContext.findAttribute("record");
String name= new String("value(" + r.getID()+")");
%>



  ..other stuff describing the record..



Is there a way in Struts to do this without calling the "record" object from the 
pageContext? Can't I get the  tag to recognize the 'record' bean 
directly without using that scriptlet and then creating a String to set the 
appropriate mapped value? 

Best,
Piers


Re: Forms with dynamically generated fields

2003-06-24 Thread Piers Dunleavy
> You can always use mapped properties though.
>
> public String getSomeProperty(String parameter);
> public void setSomeProperty(String parameter, String value);

I take it, however, that there's no way of doing this simply through
DynaActionForm?

-Piers


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Forms with dynamically generated fields

2003-06-24 Thread Piers Dunleavy
I have a JSP that generates a form based. The JSP creates a set of input
fields on fly based on some prior information that the user entered.
Therefore the number of fields for that form will differ from user to user.
What is the best approach in Struts for dealing with this. Obviously, I
can't simply define a DynaActionForm in the struts-config file, for there
won't be a fixed number of fields.

-Piers

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]