• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Concern for Error Primefaces 4.0 to capture the value of the selectOneMenu ?

Posts: 4
Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi community I have a question, I have a form where I have a layout complex with primefaces 4 happen to have in the north area have a menubar (there I've placed a form, I'm not sure if this well), select an option to new activity raises me a popup where I work-out loads in a combo, what happens is I get an error in the value of the selectOneMenu, but I give the event as if capturing the value of this combo, but worried me, I show my code.


In code java:

I get this error, which I believe is the layout:

Saloon Keeper
Posts: 25483
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have only a superficial understanding here, which is what you get when you ask for help from a forum where people don't get paid, but I got the impression that you have an imperfect understanding of how forms work. So I'll explain.

Like most "h" namespace tags in JSF, the h:form maps onto a raw HTML tag: FORM. The FORM tag cannot be nested, and like all well-formed HTML, cannot overlap other tags. In other words no constricts of the form a b /a /b, only a b /b a.

A FORM contains controls. Except in the case of AJAX, submitting a FORM submits all of the control values within that form and only the values within that form. Furthermore, in JSF, any attempt to use a JSF form control without embedding it in a form will have unpredictable results. Finally, the JSF h:form adds meta-data to the form submit, so a JSF control must be embedded within an h:form, not a raw HTML form if it's going to work properly.

You can have one big form on a page, but when you tile a page into headers with common menus and stuff like that, it's more practical to put the menubar in one form and the page content in another form. It reduces not only the amount of data submitted, but it also avoids issues where you want to select a new page via menu but don't have valid data on the current page - since JSF will only process actions where each and every control in the submitted form has a value value.
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic