JSF: rendered attribute

后端 未结 1 769
-上瘾入骨i
-上瘾入骨i 2020-12-11 18:03

I have a panelGroup with a rendered attribute. Why is it that the component values in the panelGroup are even called if the rendered attribute is set to false? Do I missunde

相关标签:
1条回答
  • 2020-12-11 18:24

    The rendered attribute simply states if the following component should be rendered on the client side DOM. These components will still follow the JSF lifecycle events and will maintain the value of a managed bean.

    EDIT: In response to a request for a workaround:

    The simplest way I can see to workaround this, if you do not want the value attribute to invoke the bean method then simply wrap the logic in your bean method with an if check on the render condition.

    public void loadSomething(Object someObject) {
      if (render()) {
        //Do loadSomething logic
      }
    }
    
    0 讨论(0)
提交回复
热议问题