在加载表内容时隐藏原始数据表“找不到记录” [英] Hide Primefaces datatable 'No Records Found' while loading the table content
问题描述
我知道这有点显而易见,但是无论如何,您可以显示默认值,您可以设置 emptyMessage =
< p:dataTable>
。
但是,如果您需要 emptyMessage
稍后显示(例如,当要加载用户特定的数据时),您可以在首次加载时使用以下命令禁用:
emptyMessage =#{dataBean.firstLoad?'':'没有找到记录'}
pre>
其中
firstLoad
将是您的支持bean中的一种方法,返回true
当用户刚刚登录(例如默认值被加载),而$ code> false 当不是,这意味着用户特定的数据应该是加载,而< p:dataTable>
实际上可能为空。In my application im loading my data table with default values which placed in first page(After Logged in).while loading data,data table prompts 'No Record Found' which is confusing to the user.how do i hide that while loading in progress ?
解决方案I know it's a bit obvious, but as you display default values anyway, you could set
emptyMessage=""
in your<p:dataTable>
.However, if you need an
emptyMessage
to be displayed later (e.g. when user-specific data is to be loaded), you could "disable" it upon first load using something like this:emptyMessage="#{dataBean.firstLoad ? '' : 'No records found.'}"
where
firstLoad
would be a method in your backing bean which returnstrue
when the user has just logged in (e.g. default values are to be loaded), andfalse
when not, which would mean that user-specific data should be loaded and the<p:dataTable>
could actually be empty.这篇关于在加载表内容时隐藏原始数据表“找不到记录”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!