You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Erich Kilmer <Er...@sas.com> on 2004/09/15 16:15:49 UTC
Can multiple inputs have the same property name or should they all be unique?
I have a page that shows widget data. This data lives on 4 different tabbed sections.
Also above the tabbed region is a pull down that allows user to choose from 4 widget types.
One of the tabbed areas changes for each of the different types using DHTML. This dynamic tab has a couple of inputs in common and several which are not.
Since I am using DHTML, all of the inputs exist on the page at the same time. Depending on the widget type selected some inputs are visible and others are display:none.
My first question is this: for the inputs that are in common in the dynamic tabbed region can they all reference by the same "name" in the action form? Or is this dangerous?
Also if this is possible when you first intialize the page from the action form if more one than input has the same name, will they all be initialized from the form by Struts?
Or should each input have a unique name?
I know this seems weird but this is the design issues that I am struggling with for this project.
TIA
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Can multiple inputs have the same property name or should they all be unique?
Posted by James Neville <ja...@babcockbrown.com>.
Erich Kilmer wrote:
>I have a page that shows widget data. This data lives on 4 different tabbed sections.
>Also above the tabbed region is a pull down that allows user to choose from 4 widget types.
>One of the tabbed areas changes for each of the different types using DHTML. This dynamic tab has a couple of inputs in common and several which are not.
>
>
Just done exactly the same thing here.
The simple solution is to write a JS function to update all the fields
to the same value when any of the fields are updated.
If the attributes are all called 'name', then use the styleId property
of the struts html tags to differentiate between them in the JS function.
Not so clean, but at least you can be sure that all the parameter values
will be the same by the time it gets back to the action class.
>My first question is this: for the inputs that are in common in the dynamic tabbed region can they all reference by the same "name" in the action form? Or is this dangerous?
>
>
Not dangerous at all.
>Also if this is possible when you first intialize the page from the action form if more one than input has the same name, will they all be initialized from the form by Struts?
>
>
Yup, they'll all have the same value.
>Or should each input have a unique name?
>
>
No need.
>I know this seems weird but this is the design issues that I am struggling with for this project.
>
Not wierd at all, we love tabs ;)
Someone *may* have a better solution than this though, i'm just busking
it the best I can right now :)
Cheers,
James.
This e-mail is confidential. If you have received it in error, you are on notice of its status. Please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person; to do so could be a breach of confidence. Thank you for your cooperation. Please contact +44 (0) 20 72037300 or email eu_info@babcockbrown.com if you need assistance.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org