Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b:selectOneMenu ignores itemDisabled #229

Closed
LupusUmbrae opened this issue Jan 4, 2016 · 3 comments
Closed

b:selectOneMenu ignores itemDisabled #229

LupusUmbrae opened this issue Jan 4, 2016 · 3 comments
Assignees
Milestone

Comments

@LupusUmbrae
Copy link

I've noticed that the bootsfaces selectOneMenu doesn't behave the same as the standard jsf html with respect to itemDisabled

In the following code:

<b:selectOneMenu id="yscale" onclick="yscaleChanges()">
    <f:selectItem itemLabel="Linear" itemValue="linear" />
    <f:selectItem itemLabel="Power" itemValue="pow" />
    <f:selectItem itemLabel="Logarthimic"
                itemValue="log" />
    <f:selectItem itemLabel="Ordinal" itemValue="ordinal" itemDisabled="true" />
</b:selectOneMenu>

The Ordinal item is still selectable, but if i switch to:

<h:selectOneMenu id="yscale" onclick="yscaleChanges()">
    ....
    <f:selectItem itemLabel="Ordinal" itemValue="ordinal" itemDisabled="true" />
</h:selectOneMenu>

The Ordinal item is not selectable.

The difference seems to be in the HTML where the bootsfaces selectOneMenu outputs:

<select id="graphconfig:yscale" name="graphconfig:yscale" class="form-control bf-no-message" onclick="yscaleChanges();">
  ...
  <option data-label="Ordinal" value="ordinal">Ordinal</option>
</select>

The JSF HTML looks like:

<select id="graphconfig:yscale" name="graphconfig:yscale" size="1" onclick="yscaleChanges()">
  ....
  <option value="ordinal" disabled="disabled">Ordinal</option>
</select>

In my case i can use the JSF HTML selectOneMenu and add the class from bootsfaces to give it the correct style, but thought it worth reporting the issue.

It looks like the renderOption in SelectOneMenuRenderer.java doesn't handle the disabled attribute

@stephanrauh stephanrauh added the bug label Jan 4, 2016
@stephanrauh stephanrauh added this to the v0.8.1 milestone Jan 4, 2016
@stephanrauh stephanrauh self-assigned this Jan 4, 2016
@stephanrauh
Copy link
Collaborator

Interesting - I didn't even know about this feature. But sure, why not. I'll add it.

stephanrauh added a commit that referenced this issue Jan 4, 2016
@stephanrauh
Copy link
Collaborator

Done and documented at http://www3.bootsfaces.net/Staging/forms/selectOneMenu.jsf. If you want to test it, I've uploaded a new developer snapshot at Maven Central (see #151).

@LupusUmbrae
Copy link
Author

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants