I used a tab to create a tab. And each tab contains a different zul page. I have 1 controller applied to the main page.
If I add any action to the component on the included zul page, I cannot catch it in the controller class. If I applied the controller to my zul, then it will create a new instance of the controller class.
Here is my code.
<zk> <style src="/resources/css/default.css" /> <window id="Dealer" class="index" apply="com.i2i.prm.controller.IndexController" width="100%" height="100%"> <div class="content" > <tabbox id="tb" width="100%" forward="onSelect=onSelect"> <tabs id="tabs"> <tab id="info" label="INFO" /> <tab id="create" label="CREATE" /> <tab id="edit" label="EDIT" /> </tabs> <tabpanels> <tabpanel id="DealerInfo"> <include id="DealerInfoContent" src="View/Dealer/DealerInfo.zul" /> </tabpanel> <tabpanel id="DealerCreate"> <include id="DealerCreateContent" src="View/Dealer/DealerCreate.zul" /> </tabpanel> <tabpanel id="DealerEdit"> <include id="DealerEditContent" src="View/Dealer/DealerEdit.zul" /> </tabpanel> </tabpanels> </tabbox> </div> </window> </zk>
And dealerEdit.zul
<zk> <window title="Dealer Edit" > <grid width="100%" sizedByContent="true"> <columns> <column label="" /> </columns> <rows> <row > <label value="Name"></label> <textbox value="@{DealerController.user.name }"> </textbox> </row> <row> <label value="Surname"></label> <textbox value="@{DealerController.user.surname }" forward="onChange=onASD"> </textbox> </row> <row> <label value="Address"></label> <textbox value="@{DealerController.user.address }"> </textbox> </row> </rows> </grid> </window> </zk>
This is my control class ( IndexController.java ):
public class IndexController extends GenericForwardComposer { private User user = new User();; AnnotateDataBinder binder; Tabbox tb; @Override public void doAfterCompose(Component comp) throws Exception {
Ercan source share