You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Joe Rossi (Created) (JIRA)" <de...@myfaces.apache.org> on 2011/10/24 16:41:32 UTC
[jira] [Created] (MYFACES-3370) f:selectItem ignores rendered
attribute
f:selectItem ignores rendered attribute
---------------------------------------
Key: MYFACES-3370
URL: https://issues.apache.org/jira/browse/MYFACES-3370
Project: MyFaces Core
Issue Type: Bug
Components: General
Affects Versions: 2.0.9
Environment: Jetty 6, Myfaces 2.0.9, Primefaces 3.0
Reporter: Joe Rossi
Priority: Minor
In the following snippet:
<h:selectOneMenu id="selector"
value="#{cc.attrs.backingBean[cc.attrs.property]}"
required="#{cc.attrs.required}"
requiredMessage="#{cc.attrs.requiredMessage}"
disabledClass="tnui-selectDisabled"
disabled="#{cc.attrs.disabled}"
immediate="#{cc.attrs.immediate}"
readonly="#{cc.attrs.readonly}"
onchange="#{cc.attrs.onchange}"
style="#{cc.attrs.style}">
<f:selectItem
itemLabel="#{cc.attrs.noSelectOptionLabel}#{sessionBean.classOfService}"
itemValue="#{null}"
noSelectionOption="true"
rendered="false"/>
<p:ajax update="#{cc.attrs.updateTargets}" disabled="#{!includeAjaxUpdate}"/>
<composite:insertChildren />
</h:selectOneMenu>
The embedded f:selectItem is always included even though it's rendered attribute is set to false.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3370) f:selectItem ignores rendered
attribute
Posted by "Michael Kurz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134168#comment-13134168 ]
Michael Kurz commented on MYFACES-3370:
---------------------------------------
No problem! I just wanted to clarify this. If you have further questions feel free to post them on users@myfaces.apache.org.
> f:selectItem ignores rendered attribute
> ---------------------------------------
>
> Key: MYFACES-3370
> URL: https://issues.apache.org/jira/browse/MYFACES-3370
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 2.0.9
> Environment: Jetty 6, Myfaces 2.0.9, Primefaces 3.0
> Reporter: Joe Rossi
> Priority: Minor
>
> In the following snippet:
> <h:selectOneMenu id="selector"
> value="#{cc.attrs.backingBean[cc.attrs.property]}"
> required="#{cc.attrs.required}"
> requiredMessage="#{cc.attrs.requiredMessage}"
> disabledClass="tnui-selectDisabled"
> disabled="#{cc.attrs.disabled}"
> immediate="#{cc.attrs.immediate}"
> readonly="#{cc.attrs.readonly}"
> onchange="#{cc.attrs.onchange}"
> style="#{cc.attrs.style}">
> <f:selectItem
> itemLabel="#{cc.attrs.noSelectOptionLabel}#{sessionBean.classOfService}"
> itemValue="#{null}"
> noSelectionOption="true"
> rendered="false"/>
> <p:ajax update="#{cc.attrs.updateTargets}" disabled="#{!includeAjaxUpdate}"/>
> <composite:insertChildren />
> </h:selectOneMenu>
> The embedded f:selectItem is always included even though it's rendered attribute is set to false.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3370) f:selectItem ignores rendered
attribute
Posted by "Michael Kurz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134114#comment-13134114 ]
Michael Kurz commented on MYFACES-3370:
---------------------------------------
This issue is not valid and should be closed as f:selectItems does not define a rendered attribute (see [1]). The attribute rendered is only available for components.
If you want to build dynamic select item lists, you can use f:selectItems with a property of type List<SelectItem> in the value attribute.
[1]: http://javaserverfaces.java.net/nonav/docs/2.1/
> f:selectItem ignores rendered attribute
> ---------------------------------------
>
> Key: MYFACES-3370
> URL: https://issues.apache.org/jira/browse/MYFACES-3370
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 2.0.9
> Environment: Jetty 6, Myfaces 2.0.9, Primefaces 3.0
> Reporter: Joe Rossi
> Priority: Minor
>
> In the following snippet:
> <h:selectOneMenu id="selector"
> value="#{cc.attrs.backingBean[cc.attrs.property]}"
> required="#{cc.attrs.required}"
> requiredMessage="#{cc.attrs.requiredMessage}"
> disabledClass="tnui-selectDisabled"
> disabled="#{cc.attrs.disabled}"
> immediate="#{cc.attrs.immediate}"
> readonly="#{cc.attrs.readonly}"
> onchange="#{cc.attrs.onchange}"
> style="#{cc.attrs.style}">
> <f:selectItem
> itemLabel="#{cc.attrs.noSelectOptionLabel}#{sessionBean.classOfService}"
> itemValue="#{null}"
> noSelectionOption="true"
> rendered="false"/>
> <p:ajax update="#{cc.attrs.updateTargets}" disabled="#{!includeAjaxUpdate}"/>
> <composite:insertChildren />
> </h:selectOneMenu>
> The embedded f:selectItem is always included even though it's rendered attribute is set to false.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3370) f:selectItem ignores rendered
attribute
Posted by "Joe Rossi (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134156#comment-13134156 ]
Joe Rossi commented on MYFACES-3370:
------------------------------------
Apologies - you are absolutely correct. I was fooled by Eclipse auto-complete showing it as an available attribute.
> f:selectItem ignores rendered attribute
> ---------------------------------------
>
> Key: MYFACES-3370
> URL: https://issues.apache.org/jira/browse/MYFACES-3370
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 2.0.9
> Environment: Jetty 6, Myfaces 2.0.9, Primefaces 3.0
> Reporter: Joe Rossi
> Priority: Minor
>
> In the following snippet:
> <h:selectOneMenu id="selector"
> value="#{cc.attrs.backingBean[cc.attrs.property]}"
> required="#{cc.attrs.required}"
> requiredMessage="#{cc.attrs.requiredMessage}"
> disabledClass="tnui-selectDisabled"
> disabled="#{cc.attrs.disabled}"
> immediate="#{cc.attrs.immediate}"
> readonly="#{cc.attrs.readonly}"
> onchange="#{cc.attrs.onchange}"
> style="#{cc.attrs.style}">
> <f:selectItem
> itemLabel="#{cc.attrs.noSelectOptionLabel}#{sessionBean.classOfService}"
> itemValue="#{null}"
> noSelectionOption="true"
> rendered="false"/>
> <p:ajax update="#{cc.attrs.updateTargets}" disabled="#{!includeAjaxUpdate}"/>
> <composite:insertChildren />
> </h:selectOneMenu>
> The embedded f:selectItem is always included even though it's rendered attribute is set to false.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3370) f:selectItem ignores rendered
attribute
Posted by "Joe Rossi (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134111#comment-13134111 ]
Joe Rossi commented on MYFACES-3370:
------------------------------------
Culprit appears to be org.apache.myfaces.shared.util.SelectItemsIterator.hasNext():
if (child instanceof UISelectItem)
{
UISelectItem uiSelectItem = (UISelectItem) child;
Object item = uiSelectItem.getValue();
if (item == null)
{
// no value attribute --> create the SelectItem out of the other attributes
Object itemValue = uiSelectItem.getItemValue();
String label = uiSelectItem.getItemLabel();
String description = uiSelectItem.getItemDescription();
boolean disabled = uiSelectItem.isItemDisabled();
boolean escape = uiSelectItem.isItemEscaped();
boolean noSelectionOption = uiSelectItem.isNoSelectionOption();
if (label == null)
{
label = itemValue.toString();
}
item = new SelectItem(itemValue, label, description, disabled, escape, noSelectionOption);
}
else if (!(item instanceof SelectItem))
{
ValueExpression expression = uiSelectItem.getValueExpression("value");
throw new IllegalArgumentException("ValueExpression '"
+ (expression == null ? null : expression.getExpressionString()) + "' of UISelectItem : "
+ RendererUtils.getPathToComponent(child) + " does not reference an Object of type SelectItem");
}
_nextItem = (SelectItem) item;
return true;
}
Shouldn't it ignore the child if it's rendered attribute evaluates to false?
> f:selectItem ignores rendered attribute
> ---------------------------------------
>
> Key: MYFACES-3370
> URL: https://issues.apache.org/jira/browse/MYFACES-3370
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 2.0.9
> Environment: Jetty 6, Myfaces 2.0.9, Primefaces 3.0
> Reporter: Joe Rossi
> Priority: Minor
>
> In the following snippet:
> <h:selectOneMenu id="selector"
> value="#{cc.attrs.backingBean[cc.attrs.property]}"
> required="#{cc.attrs.required}"
> requiredMessage="#{cc.attrs.requiredMessage}"
> disabledClass="tnui-selectDisabled"
> disabled="#{cc.attrs.disabled}"
> immediate="#{cc.attrs.immediate}"
> readonly="#{cc.attrs.readonly}"
> onchange="#{cc.attrs.onchange}"
> style="#{cc.attrs.style}">
> <f:selectItem
> itemLabel="#{cc.attrs.noSelectOptionLabel}#{sessionBean.classOfService}"
> itemValue="#{null}"
> noSelectionOption="true"
> rendered="false"/>
> <p:ajax update="#{cc.attrs.updateTargets}" disabled="#{!includeAjaxUpdate}"/>
> <composite:insertChildren />
> </h:selectOneMenu>
> The embedded f:selectItem is always included even though it's rendered attribute is set to false.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira