• Post Reply Bookmark Topic Watch Topic
  • New Topic

Send the variable from a f:selectItems

 
Richard Teran
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone I hope this finds you well

Please help I want something
since I am new to jsf please
:contento:


My question is this,,,

I'm trying to send a value with f: setPropertyActionListener
when selecting multiple values ​​from a f: SelectItems

and that value you select must be printed in a h: outputText

The code I have is this:



y ese valor "#{vistaRecibir.valorRecibir}" de simplemente debe imprimir en un outputext




Hope you can help me ..
Thank you very much for your attention and your time,,,
:'(
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Richard!

I might have missed something, since this is something I don't do very often, but your example looks basically OK.

The one thing that you should probably do, however, is include the ajaxSingle="true" attribute to your a4j:support tag. If you don't do that, the entire form that contains that control will be submitted every time the onselect fires, and since the rule in JSF is that NOTHING in a submit gets processed unless ALL values on the submitted form are VALID, the behavior of that control could be erratic. Using ajaxSingle will limit the submit to just that one control, so if other controls have invalid values, it won't interfere.

I just realized that I think what I use for the event is probably "onchange", not "onselect", but I would have to check to be certain.
 
Richard Teran
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim,,

You were a great help.

if I worked great.


Greetings and thanks again for your time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!