Revision history [back]

click to hide/show revision 1
initial version

asked 2014-05-28 15:08:13 +0800

elmetni gravatar image elmetni

ZK MVC : how can i wait till the compose of another componant

hello , i m working on a ZK project , using ZK MVC approach. what i did try to do is to initalize "a panel" after compose of a div , but the probleme is that i got a "java.lang.NullPointerException"

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1)

and those are a simple exemple of what i did try to do . My view "mypage.zul"

<zk>
<borderlayout>
     <west width="140px" splittable="true" collapsible="true" maxsize="140">
        <div align="center" apply="dashboard.display">
                    <label value="WorkLoad"></label><checkbox></checkbox>
        </div>
     </west>

     <center autoscroll="true"  >
      <div>
        <portallayout id="portalLayout" maximizedMode="whole" width="100%" >

            <portalchildren   >
                  <panel  id="panelworkload"   >
                        <panelchildren>  
                            <div width="100%"  >
                            <charts  id="workloadDay" type="column" />
                            </div>  
                        </panelchildren>
                  </panel>
             </portalchildren>            
         </portallayout> 
       </div>
    </center>

</borderlayout>
</zk>

My conroler : "display"

public class display extends SelectorComposer<Div>{

@Wire
Checkbox  objectif_checkbox;

@Wire
Panel  panelworkloadday;

public void doAfterCompose(Div comp) throws Exception {
    super.doAfterCompose(comp);

    panelworkloadday.setTitle("hello workload");

    }
}

and this is the exception that i got

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1) org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:578) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:880) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699)

what i have throught of it so far is that the div has been composed before the portallayout , that why the server cant reconize portallayout when div is created

can anyone help me pls ? i m kinda stuck here ...and thank you

ZK MVC : how can i wait till the compose of another componant

hello , i m working on a ZK project , using ZK MVC approach. what i did try to do is to initalize "a panel" after compose of doAfterCompose a div , but the probleme problem is that i got a "java.lang.NullPointerException"

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1)

and those are a simple exemple of what i did try to do . My view "mypage.zul"

<zk>
<borderlayout>
     <west width="140px" splittable="true" collapsible="true" maxsize="140">
        <div align="center" apply="dashboard.display">
                    <label value="WorkLoad"></label><checkbox></checkbox>
        </div>
     </west>

     <center autoscroll="true"  >
      <div>
        <portallayout id="portalLayout" maximizedMode="whole" width="100%" >

            <portalchildren   >
                  <panel  id="panelworkload"   >
                        <panelchildren>  
                            <div width="100%"  >
                            <charts  id="workloadDay" type="column" />
                            </div>  
                        </panelchildren>
                  </panel>
             </portalchildren>            
         </portallayout> 
       </div>
    </center>

</borderlayout>
</zk>

My conroler : "display"

public class display extends SelectorComposer<Div>{

@Wire
Checkbox  objectif_checkbox;

@Wire
Panel  panelworkloadday;

public void doAfterCompose(Div comp) throws Exception {
    super.doAfterCompose(comp);

    panelworkloadday.setTitle("hello workload");

    }
}

and this is the exception that i got

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1) org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:578) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:880) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699)

what i have throught of it so far is that the div has been composed before the portallayout , that why the server cant reconize portallayout when div is created

can anyone help me pls ? i m kinda stuck here ...and thank you

ZK MVC : how can i wait till the compose of another componant

hello , i m working on a ZK project , using ZK MVC approach. what i did try to do is to initalize "a panel" after doAfterCompose a div , but the problem is that i got a "java.lang.NullPointerException"

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1)

and those are a simple exemple of what i did try to do . My view "mypage.zul"

<zk>
<borderlayout>
     <west width="140px" splittable="true" collapsible="true" maxsize="140">
        <div align="center" apply="dashboard.display">
                    <label value="WorkLoad"></label><checkbox></checkbox>
        </div>
     </west>

     <center autoscroll="true"  >
      <div>
        <portallayout id="portalLayout" maximizedMode="whole" width="100%" >

            <portalchildren   >
                  <panel  id="panelworkload"   >
                        <panelchildren>  
                            <div width="100%"  >
                            <charts  id="workloadDay" type="column" />
                            </div>  
                        </panelchildren>
                  </panel>
             </portalchildren>            
         </portallayout> 
       </div>
    </center>

</borderlayout>
</zk>

My conroler : "display"

public class display extends SelectorComposer<Div>{

@Wire
Checkbox  objectif_checkbox;

@Wire
Panel  panelworkloadday;

public void doAfterCompose(Div comp) throws Exception {
    super.doAfterCompose(comp);

    panelworkloadday.setTitle("hello workload");

    }
}

and this is the exception that i got

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1) org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:578) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:880) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699)

what i have throught of it so far is that the div has been composed before the portallayout , that why the server cant reconize portallayout when div is created

can anyone help me pls ? i m kinda stuck here ...and thank you

ZK MVC : how can i wait till the compose of another componant

hello , i m working on a ZK project , using ZK MVC approach. what i did try to do is to initalize "a panel" after doAfterCompose a div , but the problem is that i got a "java.lang.NullPointerException"

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1)

and those are a simple exemple of what i did try to do . My view "mypage.zul"

<zk>
<borderlayout>
     <west width="140px" splittable="true" collapsible="true" maxsize="140">
        <div align="center" apply="dashboard.display">
                    <label value="WorkLoad"></label><checkbox></checkbox>
        </div>
     </west>

     <center autoscroll="true"  >
      <div>
        <portallayout id="portalLayout" maximizedMode="whole" width="100%" >

            <portalchildren   >
                  <panel  id="panelworkload"   >
                        <panelchildren>  
                            <div width="100%"  >
                            <charts  id="workloadDay" type="column" />
                            </div>  
                        </panelchildren>
                  </panel>
             </portalchildren>            
         </portallayout> 
       </div>
    </center>

</borderlayout>
</zk>

My conroler : "display"

public class display extends SelectorComposer<Div>{

@Wire
Checkbox  objectif_checkbox;

@Wire
Panel  panelworkloadday;
panelworkload;

public void doAfterCompose(Div comp) throws Exception {
    super.doAfterCompose(comp);

    panelworkloadday.setTitle("hello panelworkload.setTitle("hello workload");

    }
}

and this is the exception that i got

java.lang.NullPointerException dashboard.display.doAfterCompose(display.java:24) dashboard.display.doAfterCompose(display.java:1) org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:578) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:880) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699)

what i have throught of it so far is that the div has been composed before the portallayout , that why the server cant reconize portallayout when div is created

can anyone help me pls ? i m kinda stuck here ...and thank you

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More