【问题标题】:update form from other page primefaces从其他页面 primefaces 更新表单
【发布时间】:2014-07-06 00:32:17
【问题描述】:

我想在用户单击按钮时从其他页面更新表单,它将在其他页面中显示一个表单并更新他的字段,如下所示:

<p:commandButton value="Edit" actionListener="#{cubeMan.setUpdateCubeFilds()}" update=":form2"/> 

这是我在其他页面中的表单:

 <h:form id="form2">


        <p:panelGrid columns="2"> 

        <p:outputLabel value="Name :" for="name_cube"/>
                <p:inputText id ="name_cube" value="#{cubeMan.cubUpdate.name_cube}" required="true"/>

        <p:outputLabel value="Description :" for="description_cube"/>
                <p:inputText id ="description_cube" value="#{cubeMan.cubUpdate.description_cube}" required="true"/>
                <p:outputLabel value="Caption:" for="caption_cube"/>
                <p:inputText id ="caption_cube" value="#{cubeMan.cubUpdate.caption_cube}" required="true"/>
                <p:outputLabel value="Visible:" />
                <p:selectBooleanCheckbox value="#{cubeMan.cubUpdate.visible}" ></p:selectBooleanCheckbox>
                <p:outputLabel value="Enabled:" />
                <p:selectBooleanCheckbox value="#{cubeMan.cubUpdate.enabled}" ></p:selectBooleanCheckbox>
                <p:outputLabel value="Cache:" />
                <p:selectBooleanCheckbox value="#{cubeMan.cubUpdate.cache}" ></p:selectBooleanCheckbox>
        </p:panelGrid>
    <p:commandButton value="Edit" actionListener="#{cubeMan.updateThisCube()}" update=":form2"></p:commandButton>
     <p:commandButton value="Add" action="#{cubeMan.makeCube()}" ></p:commandButton>
     <p:commandButton value="Delete" action="#{cubeMan.deleteCube()}"/>
      <p:commandButton id="EditCube" value="+" type="button" onclick="PF('dlg3').show();" />

     </h:form>

我的表单不在某个页面中,请问我该怎么办?

【问题讨论】:

    标签: jakarta-ee jsf-2 primefaces


    【解决方案1】:

    您可以在主页中使用 include 并将您的 src 页面放在那里,它会起作用:

     <ui:include src="/SelectedCube.xhtml" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-10
      • 1970-01-01
      • 1970-01-01
      • 2012-11-11
      相关资源
      最近更新 更多