I'm looking a way to call a detail page from master page composer. I have following files : src/main/webapp/po_inquiry.zul src/main/webapp/po_inquiry_detail.zul
on click event of po_inquiry.zul grid, I need to redirect to po_inquiry_detail.zul
I found an article on https://www.zkoss.org/wiki/ZK_Developer's_Reference/UI_Patterns/Communication/Inter-Application_Communication
However, I still can't redirect into detail page. Here is the code for calling detail page. Called from master page Composer (selected data prints correct data on log, the error message is just ZK can't find /order/po_inquiry_detail.zul) :
@Listen("onDetail = #lstPoHeaders")
public void onDetail(ForwardEvent evt) {
PurchaseOrderHdr selectedData = (PurchaseOrderHdr) evt.getData();
Map<String, Object> params = new HashMap<String, Object>();
params.put(PurchaseOrderHdr.class.getName(), selectedData);
LOG.debug(selectedData);
Executions.createComponents("~/order/po_inquiry_detail.zul", getSelf().getParent(), params);
getSelf().detach();
}
I've also tried to put po_inquiry_detail.zul files under src/main/resources (classpath), but it didnt work too
Any help will be appreciated. Thank you
I think you make a mistake by reading that article.
That article is about multiple web apps and reaching out to pages of other apps.
Just try this :
Executions.createComponents("po_inquiry_detail.zul",getSelf().getParent(),params);
Now, a second mistake is that this is no redirection.
Redirection means, you will change the url, and in this case it will not happen.
Difference is seen in pressing F5 => you way will be the previous page and you will not see the detail.
Real redirection will show the detail page again.