Hi,
i am using richfaces 3.3.3.Final , and i am having troubles with reusable code.
I want one piece mupliple included in a page with <ui:include/>.
I am having troubles with duplicate component IDs with including that file more than once. i found a solution but i am looking for a better solution.
// including page
<ui:include src="anyTable.xhtml"/>
<ui:include src="anyTable.xhtml"/>
// content of included file "anyTable.xhtml":
<rich:dataTable id="mytable">
...
<ajax:support reRender="" />
...
</rich:dataTable>
ui:repeat does not work properly, it puts an ID prefix , but IDs are messed up and are not properly assigned.
<ui:repeat var="x" value="#{1}"> <ui:include src="anyTable.xhtml"/> </ui:repeat>
<ui:repeat var="x" value="#{1}"> <ui:include src="anyTable.xhtml"/> </ui:repeat>
Like this generates correct looking output, but IDs are messed up (they are crosslinked somehow).
rich:dataTable does not mess up with Ajax / component IDs
so e.g. this solution (ajax) works with rich:dataTable :
<rich:dataTable var="x" value="#{1}"> <rich:column>
<ui:include src="anyTable.xhtml"/>
</rich:column></rich:dataTable>
<rich:dataTable var="x" value="#{1}"> <rich:column>
<ui:include src="anyTable.xhtml"/>
</rich:column></rich:dataTable>
But i would like a better solution for making ajax namespaces / local ID prefixes, is there a solution for this?
Rgs
Alvo
hi,
ui:include could have a param, so you can define a prefix for your id in the page included.
or
a4j:include add a id to the id too.