Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

s:property tag values in action side

 
rahulJ james
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rahulJ james
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use <s:textfield key="name"/> ??
 
rahulJ james
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all for your suggesions.. I am able to retrieve the values in the action..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic