2016-08-30 118 views
0

我正在使用ibm jsf 1.2。我有它的主要形式与按钮。当按钮被按下时,新的面板对话框打开,并且应该根据一些确认来渲染一个字段。在渲染panelDialog时不会调用渲染bean方法?

这里是我的.jsp文件:

<hx:jspPanel> 
<fieldset> 
<h:panelGrid 
<hx:commandExButton type="button" 
value="#{msg.buttonAddContainer}" id="chooseContainerButton"> 
<hx:behavior event="onclick" behaviorAction="get;show" 
id="behavior2" targetAction="gridListContainers;containerDialog" /> 
</hx:commandExButton> 
</h:panelGrid> 
</fieldset> 
</hx:jspPanel> 


<hx:panelDialog type="modal" id="containerDialog" 
noKeybindings="true" showTitleCloseButton="false" 
onshow="openDialog()" onhide="closeDialog()" 
styleClass="panelDialog" title="#{msg.lblContainer}"> 

<h:panelGrid id="gridContainerNumber"> 
<h:outputLabel for="inputContainerNumber"></h:outputLabel> 
<h:inputText id="inputContainerNumber" styleClass="inputText"> 
<!-- some other field - container number--> 
<h:message for="inputContainerNumber" id="messageInputContainerNumber"> </h:message> 

<h:outputLabel id="labelInputBookingNumber" styleClass="outputLabel" 
for="inputBookingNumber" value="#{msg.lblBookingNumber}" 
    rendered="#{myBean.isBookingNumberRendered}"> 
</h:outputLabel> 
<h:inputText id="inputBookingNumber" immediate="true" 
value="#{myBean.bookingNumber}" 
rendered="#{myBean.isBookingNumberRendered}" styleClass="inputText"> 
</h:inputText> 
<h:message id="mesageInputBookingNumber" 
styleClass="message" for="inputBookingNumber" 
rendered="#{myBean.isBookingNumberRendered}"> 
</h:message> 
</h:panelGrid> 

<h:panelGroup id="groupClear" styleClass="buttonGroup"> 
<hx:commandExButton id="submitButton" 
styleClass="positive" 
action="#{myBean.saveContainer}" 
type="submit" immediate="true" value="#{msg.buttonSave}"> 
</hx:commandExButton> 
<hx:commandExButton id="cancelButton" 
styleClass="negative" 
action="#{myBean.clearContainer}" 
type="submit" immediate="true" value="#{msg.buttonCancel}"> 
<hx:behavior event="onclick" behaviorAction="get;hide" id="behavior6" 
targetAction="helpBox1;containerDialog"></hx:behavior> 
</hx:commandExButton> 
</h:panelGroup> 

<hx:ajaxRefreshSubmit target="gridListContainers" id="ajaxSubmit1" 
onstart="showProgressBar();" oncomplete="hideProgressBar();"> 
</hx:ajaxRefreshSubmit> 
</hx:panelDialog> 

呈现在panelDialog不表现为我所期望的。首次打开对话框时,不会调用渲染检查方法isBookingNumberRendered,因此在满足验证条件时不显示预订号字段。当我在dialogPanel上输入另一个字段并点击Save按钮(isBookingNumberRendered被调用),然后点击选择containerButton时,显示该字段。
为什么在显示panelDialog时第一次不会调用isBookingNumberRendered方法? 请帮忙。

最好的问候,
mismas

回答

0

我想通了:)
我:

<hx:behavior event="onclick" behaviorAction="get;show" 
id="behavior2" targetAction="gridListContainers;containerDialog" /> 

其中gridListContainers哪里都不面板电网的id <h:panelGrid id="gridContainerNumber">
所以我刚才把它改为<h:panelGrid id="gridListContainers">,它工作得很好。
非常感恩,没有什么是抱怨,你只是得到奇怪的行为...