I have a pe:fluidGrid
within p:dataList
wich reads elements from a hashmap.
I used to hava ui:repeat
instead of p:dataList butt changed it due to this post: <h:form> within <ui:repeat> not entirely working, only the last <h:form> is processed
My Problem now is: that the inner fluidGrid is not correctly updating its var data
.
<p:dataList var="pdi" value="#{FormGenerator.formItems.keySet()}" id="all" varStatus="loop" type="none" >
<p:panel id="panel" header="#{pdi.getFragmentDefinition().getFragmentName()}" style="margin-bottom:1em; width:100%;" >
<pe:fluidGrid id="fluidGrid" value="#{FormGenerator.formItems[pdi]}" var="data"
hGutter="20" vGutter="10" widgetVar="fluidGridWdgt_#{loop.index}" >
#{data.id} #{data.label}
<pe:fluidGridItem type="stringValue" id="txt_">
<div class="dynaFormLabel">
#{data.id}
<p:outputLabel for="txt" value="#{FormGenerator.formItems[pdi].get(data.id).getData().label} _ #{data.id}"/>
</div>
<p:inputText id="txt" value="#{FormGenerator.formItems[pdi].get(data.id).getData().value}"/>
</pe:fluidGridItem>
<pe:fluidGridItem type="integerValue" id="int_">
<div class="dynaFormLabel">
#{data.id}
<p:outputLabel for="int" value="#{FormGenerator.formItems[pdi].get(data.id).getData().label} _ #{data.id}"/>
</div>
<p:spinner id="int" value="#{FormGenerator.formItems[pdi].get(data.id).getData().value}" />
</pe:fluidGridItem>
<pe:fluidGridItem type="dateValue" id="cal_">
<div class="dynaFormLabel">
#{data.id}
<p:outputLabel for="cal" value="#{FormGenerator.formItems[pdi].get(data.id).getData().label} _ #{data.id}"/>
</div>
<p:calendar id="cal" value="#{FormGenerator.formItems[pdi].get(data.id).getData().value}" showOn="button"/>
</pe:fluidGridItem>
</pe:fluidGrid>
</p:panel>
</p:dataList>
Each Panel in the screenshot is created within the p:dataList. As you can see highlighted in red, The second panel starts with the last value of the first panel. The second panel is not complete du to a then occuring index out of bound exception (trying to access the 3rd index in a list of size 2).
Apparently all i had to do was change
#{FormGenerator.formItems[pdi].get(data.id).getData().label}
to#{FormGenerator.formItems[pdi][data.id].getData().label}
Anyone got any insights in what the difference is?