jsf 2 - Duplicated ID on JSF custom tag when nesting tags -
i'm migrating composites custom tags because of performance issues. when using composites ids generated, when using custom tags i'm having duplicated id exception, created custom el expression generating new id.
after research, seems it's because tags attributes inherited when nesting tag:
<far:fcontainer name="**father1**" type="panel"> <far:fcontainer type="panel"> <far:fcontainer type="panel">child 3</fartag:fcontainer> </far:fcontainer> </far:fcontainer> in example, first fcontainer should have id father1 , nested ones should have id generated, have:
<div id="**father1**" class="ui-widget-content"> <div id="**father1**" class="ui-widget-content"> <div id="**father1**" class="ui-widget-content">child3</div> </div> </div> the custom tag is:
<ui:composition> <p:outputpanel layout="block" styleclass="#{type == 'panel'?'ui-widget-content':''}" id="#{empty name ? far:generateid() : name}"> <ui:insert /> </p:outputpanel> <ui:composition> is normal? there workaround?
tested on mojarra 2.1.26.
thanks in advance.
update: tested on myfaces 2.1.12 , seems work fine, mojarra's bug?
a workaround bug use custom el expression, , in can first check whether parent component has attribute set or not.
Comments
Post a Comment