我需要解决这个问题 . 我正在使用带有c的jsf primefaces:foreach这里是我的代码 . 但是这段代码没有运行 .

<p:tab id="catagoryTab" title="#{hardvalue['tutor.reg.tab2']}">
                <p:panel header="#{hardvalue['tutor.reg.tab2']}" id="rowCreator">
                <h:outputLabel value="#{hardvalue['tutor.reg.selectStmt']}"></h:outputLabel>
                        <h:panelGrid columns="3" style="width:100%;">
                            <p:outputLabel value="#{hardvalue['tutor.reg.category.table.collection']}"/>
                            <p:outputLabel value="#{hardvalue['tutor.reg.category.table.level']}"/>
                            <p:outputLabel value="#{hardvalue['tutor.reg.category.table.subject']}"/>
                        </h:panelGrid>


                            <c:forEach begin="0" end="#{Registerbean.size -1}" varStatus="loop" var="row"> 
                            <h:panelGrid  columns="3"
                            style="width:100%; border: 1px solid #d4f1ff; border-radius: 3px 3px 3px 3px; background:#F7FDFF  50% 50% repeat-x ;">
                            <p:selectOneMenu 
                                value="#{Registerbean.selectedtutorialType[loop.index]}"
                                style="font-size:15px !important; width:100px;">
                                <p:ajax process="@this" update="levellist1_#{loop.index}, levellist2_#{loop.index}, subjectlist_#{loop.index}" event="change" 
                                    listener="#{Registerbean.updateRecords(loop.index)}" />
                                <f:selectItem itemLabel="#{hardvalue['tutor.tutorial']}"
                                    itemValue="tutorial" />
                                <f:selectItem itemLabel="#{hardvalue['tutor.conversaion']}"
                                    itemValue="conversation" />
                                <f:selectItem itemLabel="#{hardvalue['tutor.music']}"
                                    itemValue="music" />
                                <f:selectItem itemLabel="#{hardvalue['tutor.other']}"
                                    itemValue="other" />
                            </p:selectOneMenu>
                            <h:panelGrid columns="3" >
                            <p:selectOneMenu  style="width:230px" id="levellist1_#{loop.index}" value="#{Registerbean.selectedtutorialLevelFrom[loop.index]}"
                                 >

                                <f:selectItems value="#{Registerbean.levellist}" />
                            </p:selectOneMenu>
                            <p:outputLabel value=" #{hardvalue['tutor.reg.to']} " />
                            <p:selectOneMenu  style="width:230px" id="levellist2_#{loop.index}" value="#{Registerbean.selectedtutorialLevelTo[loop.index]}"
                                >

                                <f:selectItems value="#{Registerbean.levellist}" />
                            </p:selectOneMenu>

                            </h:panelGrid>          

                                <p:selectOneMenu  id="subjectlist_#{loop.index}" value="#{Registerbean.selectedtutorialSubject[loop.index]}"
                                style="width:230px;" 
                                label="#{hardvalue['tutorsearch.select']}" filter="true" filterMatchMode="startsWith"
                                panelStyle="width:383px">

                                <f:selectItems value="#{Registerbean.subjectslist}" />
                            </p:selectOneMenu>  
                        </h:panelGrid>


                    </c:forEach>

                <p:commandButton id="moreButton" value="#{hardvalue['tutor.reg.addmore']}" update="rowCreator" process="@this" actionListener="#{Registerbean.addNewRow}" />    

               </p:panel>


            </p:tab>

上面的代码是向导中的一个选项卡 . 所以我需要在这之后继续下一页 . 但我无法获取值,因为它不允许我使用索引分配数组变量 . 这是我的支持

bean名称:@ManagedBean(name =“Registerbean”)

private Tutor tutor= new Tutor();


private String[] selectedtutorialType= new String[size];


private String[] selectedtutorialLevelFrom= new String[size];

private String[] selectedtutorialLevelTo= new String[size];

private String[] selectedtutorialSubject= new String[size];
    public void addNewRow(){
        System.out.println("In add row");
        size++;

        selectedtutorialSubject=selectedtutorialLevelTo= selectedtutorialLevelFrom=selectedtutorialType=new String[size];


    }

这是我的flowlistner,我只是通过它检查这个选项卡的值 . flowListener = “#

public String onFlowProcess(FlowEvent event) {


   System.out.println("tab id is:"+event.getOldStep());
    if(event.getOldStep().equalsIgnoreCase("catagoryTab")){

        for(int i=0;i<selectedtutorialType.length;i++){
            System.out.println("selectedtutorialType : "+selectedtutorialType[i]);
            System.out.println("selectedtutorialLevelFrom : "+selectedtutorialLevelFrom[i]);
            System.out.println("selectedtutorialLevelTo : "+selectedtutorialLevelTo[i]);
            System.out.println("selectedtutorialSubject : "+selectedtutorialSubject[i]);
        }
    }
        return event.getNewStep();

}

我想要的是:我想绘制组件 . 添加行将在此处添加组件行 . 第一个组件的值更改,它仅反映该行中其他两个的值 . 但我不是这样做的 . 由于p:向导的下一个按钮不允许我向上移动 . 对于更新,它使用支持bean的这个功能 .

public void updateRecords(int index) {
    System.out.println("In update records: "+index);

    levellist = new ArrayList<String>();
    if (selectedtutorialType[index].equals("tutorial")) {

        subjectslist = Arrays.asList(tutorialSubject);

        levellist = Arrays.asList(tutorialLevel);
        System.out.println("tutorial selection done..");
        return;
    } else if (selectedtutorialType[index].equals("conversation")) {

        subjectslist = Arrays.asList(conversationSubject);

        levellist = Arrays.asList(conversationLevel);
        System.out.println("Conversation selection done..");
        return;
    } else if (selectedtutorialType[index].equals("music")) {

        subjectslist = Arrays.asList(musicSubject);

        levellist = Arrays.asList(musicLevel);
        System.out.println("Music selection done..");
        return;
    } else {
        subjectslist = Arrays.asList(otherSubject);

        levellist = Arrays.asList(otherLevel);
        System.out.println("Other selection done..");
        return;
    }

}

该怎么办 . Plz的帮助 . 如果我遗失了,请告诉我 .

谢谢