Search code examples
javajavascriptajax4jsfjsf-1.2seam2

a4j:commandbutton not allowing "<" in rendered


this is my code:

<a4j:outputPanel ajaxRendered="true">
    <h:form>
            <rich:dataTable id="iprangesList"
                value="#{ipRangeOverviewAction_publicIpRangeList}"
                var="iprange" rendered="#{ipRangeOverviewAction_publicIpRangeList.size>0}" 
                style="width: 100%"
                rows="20"
                onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
                    <f:facet name="header">
                        <h:outputText value="#{ipRangeOverviewAction_publicIpRangeList.size} record(s) found."/>
                    </f:facet>


                <rich:column>
                    <f:facet name="header">Information</f:facet>
                        <h:outputText value="#{iprange.info}"/>
                </rich:column>
                <rich:column>
                    <f:facet name="header">Edit</f:facet>

                    <a4j:commandButton action="#{ipRangeOverviewAction.redirectStringForEdit(iprange)}"
                                       value="edit"
                                       rendered="#{ipRange.status < 2}"/>                   

                </rich:column>

                <f:facet name="footer">
                <rich:datascroller renderIfSinglePage="false" maxPages="5"/>
                </f:facet>      
            </rich:dataTable>

            </h:form>
            </a4j:outputPanel>

this is the error i get:

Error Traced[line: 114] The value of attribute "rendered" associated with an element type "a4j:commandButton" must not contain the '<' character.

any idea why? help would be really appreciated.

thanks in advance


Solution

  • Replace

    rendered="#{ipRange.status < 2}"/>
    

    with

    rendered="#{ipRange.status lt 2}"/>
    

    EDIT: If the question is "Why is this error happening when the Facelets and Expression Language docs say it is a valid syntax?" then I don't have this answer and I'll delete this answer.