Christopher Schultz wrote:
> Philippe,
> 
> Pille wrote:
>> how can i set a property of the form, that is used and needed in the jsp
>> of the form after editing?
> 
> I usually add that property to the form bean itself and then use a
> hidden parameter. For instance, if I'm editing a database record, I
> typically do this with the primary key of the record:
> 
> <input type="hidden" name="id" value="myBean.id" />
> 
>> how can i set a property of a dyna form from within an action?
> 
> That's easy: just do the same thing you do in your SaveAction to get a
> reference to the form bean. Then, instead of just calling accessors to
> get the data our, call mutators to put data in. But, if you are talking
> about accepting data from the form for re-display, why not just make it
> part of the form and have Struts do that work for you?

can you get more in detail please? ;)

> 
>> how do i
>> make sure that this property will be still set after submission and
>> redirecting over 2 sites?
> 
> Whenever I need parameters to be forwarded across multiple actions, I
> either put them in the form bean or do it manually by using hidden form
> elements, pulling their values out in my submission handling actions,
> and then put them back into the URLs of my redirect actions.

i had the ArrayList as property of a DynaActionForm. when i submitted
the form the Bean wasn´t set anymore.
but there is another thing i´ve been thinking of. earlier i had my own
DynaActionForm class and i have set some properties in the
struts-config.xml. the ArrayList (which holds the beans) was set as a
property in my own class because i didn´t know how to access the getters
and setters of a DynaActionForm. the form tag in struts-config.xml was a
type of my own DynaActionForm extension. Is it ok to mix it like this or
do i either have to implement every property in a own DynaActionForm
class or do i have to declare everything in struts-config?

> 
>> the problem is that i have 4 dynamic combo boxes and i always need to
>> iterate over the request parameters with a Regexp to get and reset all
>> the parameters of the combo boxes. the contents of the 4 combo boxes
>> depend on the previously made selection.
> 
> I rarely do this, but others have been talking about this lately. Look
> for messages that discuss "indexed" properties, which I think is what
> you need.

yes. i´m doing it like this too. in the jsp i´m using a c:forEach loop
to iterate over the ArrayList and display the values like this:

<html:select name="currentp" property="product" indexed="true">
...

> 
>> difficult to explain, sorry, hope you understand.
> 
> These kinds of things typically /are/ difficult to explain. Check the
> archives for the past couple of weeks to see if there's something there
> of any help. If not, post a new question to the list and include as much
> detail as possible (examples are usually the quickest way to do that).
> 
> Hope that helps,
> -chris
> 

thank you

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



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

Reply via email to