JSF动态创建的表单参数不准确

JSF动态创建的表单参数不准确,jsf,jsf-2,el,Jsf,Jsf 2,El,当尝试在侦听器中作为参数访问动态数据时,我遇到了一些奇怪的结果。下面是我的xhtml的一个片段。我有一个支持bean skillsController.java和一个pojo Skill.java ui:repeat迭代类别,并为每个类别生成一个数据表。从视觉上看,一切似乎都在正确生成。当稍后尝试访问在xhtml中创建的变量时,会出现问题。当使用附加到selectonmenu的任何类型的侦听器时,datatable中的skill变量与最初生成页面时使用的数据不匹配。例如,提交表单时使用的技能链接

当尝试在侦听器中作为参数访问动态数据时,我遇到了一些奇怪的结果。下面是我的xhtml的一个片段。我有一个支持bean skillsController.java和一个pojo Skill.java

ui:repeat迭代类别,并为每个类别生成一个数据表。从视觉上看,一切似乎都在正确生成。当稍后尝试访问在xhtml中创建的变量时,会出现问题。当使用附加到selectonmenu的任何类型的侦听器时,datatable中的skill变量与最初生成页面时使用的数据不匹配。例如,提交表单时使用的技能链接到第一类技能中的数据,而不是它应该拥有的正确类别/技能

页面生成和表单提交之间的技能似乎不同步。关于如何获得表单提交技能中存储的正确值,是否有任何建议

<h:form rendered="#{!skillsController.mode.equalsIgnoreCase('Show My Skills')}">                    
    <ui:repeat var="cat" value="#{skillsController.masterCategories}" varStatus="status">
        <h:panelGroup layout="block" rendered="#{cat.toString().equalsIgnoreCase(skillsController.mode)||skillsController.mode.equalsIgnoreCase('Show All Skills')}">
            <h3 class="arSkillsHeader">
                <h:outputLabel value="#{cat.toString()}"
                    style="font-weight:bold" />
            </h3>
            <h:dataTable style="margin-left:15px; margin-right:15px"
                class="suggestionsTable" var="skill"
                rowClasses="gray, lightgraybg"
                columnClasses="null, hCol3, versionCol, null"
                value="#{skillsController.getSkillsByCategory(cat)}">
                <h:column>
                    <h:graphicImage value="/resources/images/success.png"
                        style="height:20px"
                        rendered="#{skillsController.hasSkill(cat.toString(), skill.name.toString())}" />
                </h:column>
                <h:column>
                    <h:outputText value="#{skill.name.toString()}" />                                           
                </h:column> 
                <h:column>
                    <h:outputText value="#{skill.categoryName}" rendered="false" />
                    <h:outputText value="#{skill.name}" rendered="false" />
                    <h:selectManyCheckbox id = "versionCheckbox"
                                          layout ="lineDirection"
                                          style = "text-align: left;"
                                          value = "#{skill.checkedVersions}"
                                          valueChangeListener="#{skillsController.versionsChecked}">
                        <f:selectItems value="#{skillsController.getVersions(skill.getName(), skill.getCategoryName())}"/>
                    </h:selectManyCheckbox> 
                </h:column>             
                <h:column>
                    <h:selectOneMenu id="proficiency" value="#{skill.proficiency}">
                        <f:selectItem
                            itemValue="#{skillsController.timeList.get(0)}"
                            itemLabel="Select Experience Level" />
                        <f:selectItems
                            value="#{skillsController.timeList.subList(1, skillsController.timeList.size())}" />
                        <f:ajax render="versionCheckbox @this"
                                listener="#{skill.proficiencyUpdated(skill.proficiency)}"/>
                    </h:selectOneMenu>
                </h:column>
            </h:dataTable>
            <h:panelGroup layout="block" style="height:20px">
                <h:commandButton value="Update Category" style="float:right; margin-right:15px;"
                    action="#{skillsController.updateCategorySkills(cat)}"
                    onclick="updatePro(this.id);">
                    <f:ajax execute="@form" render="@form" />
                </h:commandButton>
            </h:panelGroup>
        </h:panelGroup>                         
    </ui:repeat>
</h:form>


表单上呈现的
属性的位置和条件可能是导致不稳定行为的原因默认情况下,所有技能都是可见的,因此我原以为它会默认为该行为。我已尝试删除渲染属性,但问题仍然存在。