DataScroller 与 bean 绑定后不渲染
我的目标是在新搜索后重置数据滚动器的第一页。 这应该用以下语句完成:
getTableScroller().getUIData().setFirst(index);
我的问题是,在我将 datascroller 与 bean 绑定后,它将不会被渲染。就在我第二次点击搜索按钮后,它将被渲染。
Bean:
public class HistoryBean {
private HtmlDataScroller tableScroller = new HtmlDataScroller();
// ...
Facelet:
<t:dataScroller id="scroll_1"
for="data"
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;"
immediate="true"
actionListener="#{historyBean.scrollerAction}"
binding="#{historyBean.tableScroller}"
>
如果我删除 binding
属性,它将在初始请求时呈现。我忘记了什么?
My goal is to reset the first page of the datascroller after a new search.
This should be done with this statement:
getTableScroller().getUIData().setFirst(index);
My problem is, after I bind the datascroller with a bean it will not be rendered. Just after I hit the search button a seccond time it will be rendered.
Bean:
public class HistoryBean {
private HtmlDataScroller tableScroller = new HtmlDataScroller();
// ...
Facelet:
<t:dataScroller id="scroll_1"
for="data"
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;"
immediate="true"
actionListener="#{historyBean.scrollerAction}"
binding="#{historyBean.tableScroller}"
>
If I remove the binding
attribute it will be rendered on initial request. What have I forgotten?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应该将组件绑定到范围比请求范围更广的 bean。
而是直接在视图中指定
first
属性。You shouldn't bind the component to a bean which is in a broader scope than the request scope.
Rather specify the
first
attribute just straight in the view.