【问题标题】:don't get the values from input text不要从输入文本中获取值
【发布时间】:2014-06-12 00:23:25
【问题描述】:

我对 jsf tabview 和 form 有一个严重的问题

在我的 tabview 中,每当我提交时,我都必须输入文本并提交按钮,我总是有一个空值。

        <h:form id="form">

                <p:tab id="tabview" title="Ressources Humaines">
                <p:tabView    activeIndex="#{SelectBean.activeTab}" value="#{SelectBean.types}" var="item"    >
                <p:ajax event="tabChange" listener="#{SelectBean.onTabChange}" update=":form" />
                <p:tab title="#{item}"> 
                <p:tabView  id="tab"  activeIndex="#{SelectBean.other}"   value="#{SelectBean.res}" var="rr">
                <p:ajax event="tabChange" listener="#{SelectBean.onTabChange1}"  />
                <p:tab title="#{rr.nom_ressource}">


                <p:panel rendered ="#{SelectBean.bol}" closable="true"  toggleable="true"   styleClass="outPanel">

             <p:growl id="growl" showDetail="true"  />
                <h:outputLabel value="Nom  " />
               <h:inputText value="#{SelectBean.nom}" />
               <br/>
               <h:outputLabel value="Experience " />
               <h:inputText value="#{SelectBean.exp}" />    
               <br/>
               <h:commandButton immediate="true" value="Modifier" action="#{SelectBean.ok}"/>


                </p:panel>


                </p:tab>
                </p:tabView> 
                </p:tab>



            </p:tabView>



            </h:form> 

SelectBean.nom 和 SelectBean.exp 总是空的请帮助

【问题讨论】:

  • 如果某个答案对您有帮助,请您勾选绿色标记,哪个最适合您的问题?谢谢! :)

标签: jsf primefaces


【解决方案1】:

问题在于你的

&lt;h:commandButton immediate="true" value="Modifier" action="#{SelectBean.ok}"/&gt;

immediate 属性操作方法导致 JSF 通过调用 facesContext.renderResponse() 直接进入“同一视图”的渲染阶段,然后组件将像验证失败一样运行 - 通过显示缓存在组件而不是从支持 bean 获取数据。


这里列出了可能的solutions

【讨论】:

    猜你喜欢
    • 2012-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-05
    • 1970-01-01
    • 2022-08-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多