| Author |
s:property tag values in action side
|
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
When I use s:textfield name="name" tag I can get the value of this textbox in the action side using getName().. whereas when I use s roperty or label tag, how do I get the value of this property in the action side.. Can anyone advise me..
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Originally posted by rahulJ james: when I use s:property or label tag, how do I get the value of this property in the action side..
You don't. The s:property displays the value on the page but does not submit it. If you want the value to be submitted and available to an action, use s:hidden.
|
Merrill
Consultant, Sima Solutions
|
 |
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
If I use s:hidden, I would not be able to display the values .. Is there anyway to display and fetch the values in the action
|
 |
Jeffry Santoso
Greenhorn
Joined: Mar 12, 2008
Posts: 4
|
|
|
use <s:textfield key="name"/> ??
|
 |
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
Again it will be in enable mode rite? I do not want to be in a textbox and wanted to fetch the same value in the action... For timebeing I am using the list in the action side, iterating it and fetching the unmodified values..
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
|
I'd suggest you use both an s:property tag and an s:hidden tag. One to display the value, and the other to submit it.
|
 |
Nishan Patel
Ranch Hand
Joined: Sep 07, 2008
Posts: 676
|
|
hi.. You can not get the value of property and lable value because this tag is used for represent your data comes form Action class. If you want to send it to Action you have to use textfield or text otherwise use hidden value for it. Thanks, Nishan Patel.
|
Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
|
 |
Nishan Patel
Ranch Hand
Joined: Sep 07, 2008
Posts: 676
|
|
hi.. You can not get the value of property and lable value because this tag is used for represent your data comes form Action class. If you want to send it to Action you have to use textfield or text otherwise use hidden value for it. Thanks, Nishan Patel.
|
 |
rahulJ james
Ranch Hand
Joined: Oct 03, 2008
Posts: 123
|
|
|
Thanks all for your suggesions.. I am able to retrieve the values in the action..
|
 |
 |
|
|
subject: s:property tag values in action side
|
|
|