单击上下文菜单后,Primefaces无法在对话框中填充inputText

时间:2013-05-15 19:40:02

标签: jsf primefaces

我正在使用Primefaces Datatable-ContextMenu和Dialog来更新一行(当点击上下文菜单后,它会打开一个对话框,其中包含将更新<p:inputext />中对象的字段。)

我在构造函数上尝试了动态true,initilazing对象,因为当呈现页面时,对象中的对象将为null,当我尝试使用它时,会给出空指针异常,以便我需要其他建议。

以下是ContextMenu:

<p:contextMenu for="functions" id="functionContextMenu">  
<p:menuitem value="Guncelle" icon="ui-icon-" update="updateDialog" oncomplete="updateDialog.show()"/>

我的对话就在这里:

<p:dialog header="Guncelle" widgetVar="updateDialog" resizable="false"
width="200" showEffect="clip" hideEffect="fold" id="updateDialog" dynamic="true">  
    <h:panelGroup id="display">  
        <h:outputText value="#{functionControllerBean.selectedFunction.functionName}" />
        <h:inputText id="firstName" value="{functionControllerBean.tempSelectedFunction1.functionName}" />  
    </h:panelGroup>  
</p:dialog>

如果我不使用<p:inputText />它的确定并显示我放置<h:outputText />但是当我在对话框中放入p:inputext时;它不会显示输出文本值并显示<p:inputText />为空它没有。

我在beanname.objectname.field<p:inputText />之前使用了<h:inputText />,但没有问题,但现在它没有用。

这是我的ManagedBean:

@ManagedBean
@RequestScoped
public class FunctionControllerBean implements Serializable {
    private EfaFunctions willAddFunction;
    private EfaFunctions selectedFunction = new EfaFunctions();

提前致谢

更新这是页面

<h:form id="form">   
        <p:contextMenu for="functions" id="functionContextMenu">  
            <p:menuitem value="Guncelle" icon="ui-icon-" update="updateDialog"  oncomplete="updateDialog.show()"/>                  
            <p:menuitem value="Sil" update="@form" icon="ui-icon-close" actionListener="#{functionControllerBean.deleteFunction}"/>  
        </p:contextMenu>  
        <p:dataTable resizableColumns="true" id="functions" var="function" value="#{functionControllerBean.functions}" rowKey="#{function.functionId}"  
                     selection="#{functionControllerBean.selectedFunction}" selectionMode="single">  

            <p:column headerText="Id">  
                #{function.functionId}  
            </p:column>  
            <p:column headerText="Key ">  
                #{function.functionKey}  
            </p:column>  

            <p:column headerText="Isim" >  
                #{function.functionName}  
            </p:column>          
            <p:column headerText="Tip" >  
                #{function.functionType}  
            </p:column>   
            <p:column headerText="Url" >  
                #{function.uri}  
            </p:column>    
            <p:column headerText="Olusturulma Tarihi" >  
                #{function.creationDate}  
            </p:column>          
            <p:column headerText="Guncelleme Tarihi" >  
                #{function.lastUpdateDate}  
            </p:column>          
            <p:column headerText="Olusturan Kisi" >  
                #{function.createdBy}  
            </p:column>          
            <p:column headerText="Guncelleyen Kisi" >  
                #{function.createdBy}  
            </p:column>          

        </p:dataTable>   
        <p:dialog header="Islem  Sonucu" widgetVar="actionResult" resizable="false"  
                  width="200" showEffect="clip" hideEffect="fold" id="actionResult"
                  visible="#{functionControllerBean.actionResult!=null}"> 
            <h:outputText value="#{functionControllerBean.actionResult}"/>
        </p:dialog>

        <p:dialog header="Guncelle" widgetVar="updateDialog" resizable="false"
                  width="200" showEffect="clip" hideEffect="fold" id="updateDialog" >  
            <h:panelGroup id="display">  
                <h:outputText value="#{functionControllerBean.selectedFunction.functionName}" />
                <p:inputText value="#{functionControllerBean.selectedFunction.functionName}"/>
            </h:panelGroup>  
        </p:dialog>  

    </h:form>  

0 个答案:

没有答案