【问题标题】:jsf f:ajax render ony if value in execute not null or emptyjsf f:ajax 仅在执行中的值不为空或为空时呈现
【发布时间】:2013-09-16 05:31:06
【问题描述】:

我的 jsf 页面有问题。我不知道只有在“输入”不为空或不为空时才能使 ajax 呈现。

这是我的代码:

<h:inputText id="input" value="#{control.query}"/> 


<h:commandButton id="search" value="Search" action="#{control.getdata()}">
    <f:ajax execute="input" render="datatable"/>
</h:commandButton>

谢谢!

【问题讨论】:

    标签: ajax jsf render


    【解决方案1】:

    利用目标上的rendered 属性。

    <h:panelGroup id="datatable">
        <h:dataTable ... rendered="#{not empty control.query}">
            ...
        </h:dataTable>
    </h:panelGroup>
    

    【讨论】:

      猜你喜欢
      • 2011-06-27
      • 2011-07-19
      • 2012-08-11
      • 2011-03-18
      • 2013-12-31
      • 1970-01-01
      • 1970-01-01
      • 2013-10-30
      • 1970-01-01
      相关资源
      最近更新 更多