You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Endre Nagy <en...@aus.fujixerox.com> on 2006/11/16 02:00:49 UTC
Is the setter for an OptionsCollection's property invoked by the
framework
Greetings
I am using the Struts HTML library in a jsp.
Specifically I am making use of a html:optionsCollection.
The client alters the content of the collection.
I therefore implement a setter for the property that is associated with the collection within the Form class.
The struts framework does NOT appear to invoke the setter of the property in the form class after the client posts the page.
Is this expected behaviour or am I doing something silly
Regards
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Is the setter for an OptionsCollection's property invoked by the framework
Posted by Mano Chinthaka Dasanayaka <ma...@mubasher.net>.
Hi,
Sorry I have
Made a little mistake,
It's like this,
<html:select name="fredForm" property="selectJoe"
style="width:150;height:20" styleClass="drop" >
<%--see whether u have it in scope-->
<logic:notEmpty name=" fredForm " property=" joeSet ">
<html:optionsCollection name="fredForm" property="joeSet"
value="value" label="label" />
</logic:notEmpty>
<logic:empty name=" fredForm
" property=" joeSet ">
No list in scope </logic:empty>
</html:select>
Regards,
Mano
-----Original Message-----
From: Endre Nagy [mailto:endre.nagy@aus.fujixerox.com]
Sent: Thursday, November 16, 2006 11:32 AM
To: Struts Users Mailing List
Subject: RE: Is the setter for an OptionsCollection's property invoked by
the framework
Mano
Not quite
<td><html:select name="fredForm" property="selectJoe">
<html:option value="${fredForm.selectJoe}" ></html:option>
<html:optionsCollection name="fredForm"
property="joeSet" label="label" value="value"/>
</html:select></td>
fredForm has two methods
public Set getJoeSet()
{return something;}
public void setJoeSet(Set joeSet)
{something = joeSet;}
Break points set on both methods only stop on the get (not the set).
Note difference between <html:options collection="... and
<html:optionsCollection name="...
Regards
Endre
-----Original Message-----
From: Mano Chinthaka Dasanayaka [mailto:mano@mubasher.net]
Sent: Thursday, 16 November 2006 3:28 PM
To: 'Struts Users Mailing List'
Subject: RE: Is the setter for an OptionsCollection's property invoked
by the framework
Yes, it should work .any way are you using something similar to below,
<html:select property="prop1" name="YourForm" styleClass="yourstyleClass"
style="width:100">
<html:options collection="propFortheCollection" property="id"
labelProperty="name" />
</html:select>
where user changes the "propFortheCollection" ..
Regards,
Mano
-----Original Message-----
From: Endre Nagy [mailto:endre.nagy@aus.fujixerox.com]
Sent: Thursday, November 16, 2006 6:31 AM
To: user@struts.apache.org
Subject: Is the setter for an OptionsCollection's property invoked by the
framework
Greetings
I am using the Struts HTML library in a jsp.
Specifically I am making use of a html:optionsCollection.
The client alters the content of the collection.
I therefore implement a setter for the property that is associated with the
collection within the Form class.
The struts framework does NOT appear to invoke the setter of the property in
the form class after the client posts the page.
Is this expected behaviour or am I doing something silly
Regards
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Is the setter for an OptionsCollection's property invoked by
the framework
Posted by Endre Nagy <en...@aus.fujixerox.com>.
Mano
Not quite
<td><html:select name="fredForm" property="selectJoe">
<html:option value="${fredForm.selectJoe}" ></html:option>
<html:optionsCollection name="fredForm"
property="joeSet" label="label" value="value"/>
</html:select></td>
fredForm has two methods
public Set getJoeSet()
{return something;}
public void setJoeSet(Set joeSet)
{something = joeSet;}
Break points set on both methods only stop on the get (not the set).
Note difference between <html:options collection="... and <html:optionsCollection name="...
Regards
Endre
-----Original Message-----
From: Mano Chinthaka Dasanayaka [mailto:mano@mubasher.net]
Sent: Thursday, 16 November 2006 3:28 PM
To: 'Struts Users Mailing List'
Subject: RE: Is the setter for an OptionsCollection's property invoked
by the framework
Yes, it should work .any way are you using something similar to below,
<html:select property="prop1" name="YourForm" styleClass="yourstyleClass"
style="width:100">
<html:options collection="propFortheCollection" property="id"
labelProperty="name" />
</html:select>
where user changes the "propFortheCollection" ..
Regards,
Mano
-----Original Message-----
From: Endre Nagy [mailto:endre.nagy@aus.fujixerox.com]
Sent: Thursday, November 16, 2006 6:31 AM
To: user@struts.apache.org
Subject: Is the setter for an OptionsCollection's property invoked by the
framework
Greetings
I am using the Struts HTML library in a jsp.
Specifically I am making use of a html:optionsCollection.
The client alters the content of the collection.
I therefore implement a setter for the property that is associated with the
collection within the Form class.
The struts framework does NOT appear to invoke the setter of the property in
the form class after the client posts the page.
Is this expected behaviour or am I doing something silly
Regards
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Is the setter for an OptionsCollection's property invoked by the framework
Posted by Mano Chinthaka Dasanayaka <ma...@mubasher.net>.
Yes, it should work .any way are you using something similar to below,
<html:select property="prop1" name="YourForm" styleClass="yourstyleClass"
style="width:100">
<html:options collection="propFortheCollection" property="id"
labelProperty="name" />
</html:select>
where user changes the "propFortheCollection" ..
Regards,
Mano
-----Original Message-----
From: Endre Nagy [mailto:endre.nagy@aus.fujixerox.com]
Sent: Thursday, November 16, 2006 6:31 AM
To: user@struts.apache.org
Subject: Is the setter for an OptionsCollection's property invoked by the
framework
Greetings
I am using the Struts HTML library in a jsp.
Specifically I am making use of a html:optionsCollection.
The client alters the content of the collection.
I therefore implement a setter for the property that is associated with the
collection within the Form class.
The struts framework does NOT appear to invoke the setter of the property in
the form class after the client posts the page.
Is this expected behaviour or am I doing something silly
Regards
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org