0

I am using the p:inplace inside a dialog, when i click the dialog for the first time it displays the label (Detail) and on i clicking the label it displays the 2 inputText but if i open the dialog again it displays the 2 inputText without the label (step), how do i ensure that the label is displayed first.

<p:dialog widgetVar="Dialog" header="Update Patient Details" showEffect="clip" hideEffect="clip" modal="true" >  
    <h:panelGrid id="Details" columns="2">
        <p:inplace id="selectableInplace" label="Detail" effectSpeed="fast" event="click">  
        <h:panelGrid id="innerDetails1" columns="2">
            <h:outputLabel value="Name:" /> 
            <p:inputText id="someName" />

            <h:outputLabel value="Mobile:" /> 
            <p:inputText id="someMobile" />
        </h:panelGrid>
    </p:inplace>  
</h:panelGrid>
</p:dialog>
4

1 回答 1

0

p:inplace元素从未得到任何关闭指令。如果您希望在p:inplace打开对话框时关闭元素,您可以在关闭或显示hide()时调用该函数。p:dialog

我建议在关闭对话框时这样做。只需将 a 添加widgetVar到, 并在中p:inplace调用它的hide()函数。onHidep:dialog

工作示例:

<p:commandButton onclick="Dialog.show()" value="Show" />
<p:dialog widgetVar="Dialog" header="Update Patient Details"
    showEffect="clip" hideEffect="clip" modal="true"
    onHide="inplace.hide();">
    <h:panelGrid id="Details" columns="2">
        <p:inplace id="selectableInplace" label="Detail" effectSpeed="fast"
            event="click" widgetVar="inplace">
            <h:panelGrid id="innerDetails1" columns="2">
                <h:outputLabel value="Name:" />
                <p:inputText id="someName" />

                <h:outputLabel value="Mobile:" />
                <p:inputText id="someMobile" />
            </h:panelGrid>
        </p:inplace>
    </h:panelGrid>
</p:dialog>
于 2012-08-30T13:23:08.333 回答