• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Send the variable from a f:selectItems

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,,,
:'(
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tim,,

You were a great help.

if I worked great.


Greetings and thanks again for your time.
 
reply
    Bookmark Topic Watch Topic
  • New Topic