QeelwaEtech / omnifaces

Automatically exported from code.google.com/p/omnifaces
0 stars 1 forks source link

Attribute 'noSelectionValue' of <f:selectItems> is ignored. #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a JSF page with the following element in a form:

      <h:selectOneMenu ...>
          <f:selectItems noSelectionValue="(some special value)" ...>
          <f:validateRequired/>
      </h:selectOneMenu>

   Also add some display of validation messages.

2. Run the application and display the JSF page.
3. From the menu, select the special no-selection value.
4. Submit the form.

What is the expected output? What do you see instead?

   Validation error message is expected but the validation passes.

What OmniFaces version are you using?

   1.4.1

What JSF impl/version are you using?

   Mojarra 2.1.6 (SNAPSHOT 20111206)

What servletcontainer impl/version are you using?

  GlassFish Server Open Source Edition 3.1.2.2

If any, what JSF component library impl/version are you using?

Please provide any additional information below.

   I believe the bug is on line 168 of SelectItemsCollector.java:
   The current line is:

        ...
        getBooleanAttribute(attributes, "noSelectionOption", false)
        ...

   I fixed the bug for myself by replacing the line with this line:

        itemValue == attributes.get("noSelectionValue")

Original issue reported on code.google.com by marian.p...@centrum.cz on 18 Apr 2013 at 1:45

GoogleCodeExporter commented 9 years ago
Fixed: 
https://code.google.com/p/omnifaces/source/detail?r=41863bd9d6afbdd8bde198c1ea25
e8e52a0aa9c9

Attached snapshot contains the fix.

Original comment by balusc on 20 Apr 2013 at 2:28

Attachments:

GoogleCodeExporter commented 9 years ago
I confirm that the fix works.

Original comment by marian.p...@centrum.cz on 6 May 2013 at 12:22