我在对话框中的输入文本中显示数据时遇到问题。实际上,我有一个数据表,在其中选择一个项目并将其放入变量中。问题是,当我按下按钮以显示一个编辑该项目的对话框时,除非禁用输入文本,否则输入文本将保持为空,所选对象保持为空。在那种情况下,对象已填充,输入文本包含我要编辑的数据,但我不能让它禁用。 我使用primefaces 3.4和jsf 2.1.6-SNAPSHOT
这是我的代码的一部分:
<p:dataTable var="item" sortBy="item.otherBpm" style="width:50% !important; min-width:600px;"
value="#{parametrageOperationWorkflowController.objectToDisplay.subProcessList}" paginator="true" paginatorPosition="bottom" paginatorAlwaysVisible="false" rows="10"
id="dataTableSP" selection="#{parametrageOperationWorkflowController.subProcessToEditOrDelete}" rowKey="#{item.processCode}" widgetVar="operationSubprcTable"
rendered="#{parametrageOperationWorkflowController.objectToDisplay.subProcessList != null}">
<f:facet name="header">
<p:toolbar rendered="#{parametrageOperationWorkflowController.editObjectCriterea}">
<p:toolbarGroup align="left">
<p:commandButton value="#{msg.nouveau}" type="button" icon="ui-icon-document" onclick="dlg1.show();dlg2.hide();dlg3.hide();" global="false">
</p:commandButton>
<p:separator />
<p:commandButton value="#{msg.modifier}" icon="ui-icon-disk" update=":mainForm:updateOperationSubprc" oncomplete="dlg2.show();dlg1.hide();dlg3.hide();" />
<p:separator />
<p:commandButton value="#{msg.supprimer}" icon="ui-icon-trash" update=":mainForm:deleteOperationSubprc" oncomplete="dlg3.show();dlg1.hide();dlg2.hide();" />
</p:toolbarGroup>
</p:toolbar>
</f:facet>
<p:column rendered="#{parametrageOperationWorkflowController.editObjectCriterea}" selectionMode="single" style="width:16px;text-align:center"/>
<p:column headerText="Process code:">
<h:outputText value="#{item.processCode}" />
</p:column>
<p:column headerText="Process Id:">
<h:outputText value="#{item.processId}" />
</p:column>
<p:column headerText="Moteur Workflow:">
<h:outputText value="JBPM" rendered="#{item.otherBpm == 0}" />
<h:outputText value="BPM Tools" rendered="#{item.otherBpm == 1}" />
<h:outputText value="selon région" rendered="#{item.otherBpm == 2}" />
</p:column>
</p:dataTable>
<p:dialog id="updateOperationSubprc" header="Modifier un sous processus" widgetVar="dlg2" position="center"
rendered="#{parametrageOperationWorkflowController.subProcessToEditOrDelete != null}">
<h:panelGrid columns="2">
<p:outputLabel for="updateOperationSubprcCode" value="Code de sous processus" styleClass="simpleLabel"/>
<p:inputText cols="50" rows="1" id="updateOperationSubprcCode" value="#{parametrageOperationWorkflowController.subProcessToEditOrDelete.processCode}" />
<p:outputLabel for="updateOperationSubprcId" value="Id de sous process: " styleClass="simpleLabel"/>
<p:inputText id="updateOperationSubprcId" value="#{parametrageOperationWorkflowController.subProcessToEditOrDelete.processId}"/>
<p:outputLabel value="Moteur workflow: " for="updateOperationSubprcOtherBpm" styleClass="simpleLabel"/>
<p:selectOneMenu
id="updateOperationSubprcOtherBpm" value="#{parametrageOperationWorkflowController.subProcessToEditOrDelete.otherBpm}"
style="border-radius: 5px 5px 5px 5px;">
<f:selectItem itemLabel="JBPMN" itemValue="0" />
<f:selectItem itemLabel="BPM Tools" itemValue="1" />
</p:selectOneMenu>
<h:panelGroup><br/><br/></h:panelGroup>
<p:commandButton
value="#{msg.modifier}" icon="ui-icon-pencil" action="#{parametrageOperationWorkflowController.updateOperationSubprc()}" style="border-radius: 5px 5px 5px 5px;"
ajax="false" global="false">
</p:commandButton>
</h:panelGrid>
</p:dialog>