单击一行将根据单击的内容打开一个新链接

时间:2013-09-12 19:44:22

标签: jsf

我是JSF的新手,我尝试使用Google搜索并浏览BalusC的示例,但失败了。我现在有一个数据表,它有效,但我想要实现的是,当你点击一行时,我想在bean中存储一些信息,然后打开一个新的页面,我可以在其中显示更多的细节关于被点击的行。这是我的代码:

        <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">  

          Degree: 

          <div class="degreeProgram">
    <h:selectOneMenu onchange="submit()" valueChangeListener="#{course.degreeProgramChanged}">
                <f:selectItems value="#{course.programs}" />
    </h:selectOneMenu>
           </div>
             Major:

             <div class="major">
            <h:selectOneMenu onchange ="submit()" valueChangeListener="#{course.majorChanged}">
                <f:selectItems value="#{course.majors}" />
    </h:selectOneMenu>
             </div>
             Identifier:
             <h:inputText value="#{course.identifier}"></h:inputText>

              Course coordinator:

             <div class="major">
              <h:selectOneMenu onchange ="submit()" valueChangeListener="#{course.coordinatorChanged}">
                <f:selectItems value="#{course.coordinators}" />
    </h:selectOneMenu>
             </div>

            </h:panelGrid>
            </h:form>  



             <b>Course Offering:</b>
            <br></br>


            <h:form>

        <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">  

          Section: 

          <div class="degreeProgram">
              <h:inputText value="#{course.section}"></h:inputText>

           </div>
             Semester

             <div class="major">
                 <h:inputText value="#{course.semester}"></h:inputText>

             </div>

              Instructors:
             <div class="major">
                 <h:selectOneMenu onchange ="submit()" valueChangeListener="#{course.coordinatorChanged}">
                     <f:selectItems value="#{course.instructors}" />
    </h:selectOneMenu>
             </div>

              <h:commandButton value="submit" action="#{course.executeSearch()}"></h:commandButton>

             </h:panelGrid>
            </h:form>

0 个答案:

没有答案