How to open a external .zul page from a custom form in Idempiere

207 views
Skip to first unread message

Pedro Rozo

unread,
Sep 8, 2022, 5:55:38 PM9/8/22
to iDempiere
Hi everyone..

I am playing a bit with the UI.. and adding a button to a custom form, to trigger/open a custom zk (.zul page) ...  so far my custom form is working , and the button/listener can open external urls like this:

Executions.getCurrent().sendRedirect("http://www.zkoss.org", "_blank");

However if I try to open and internal .zul page located in my extension/fragment  (theme plugin)  it does not work 

Executions.getCurrent().sendRedirect("adsPib.zul", "_blank");

I already tried putting my adsPib.zul under

src/web/theme/mytheme/adsPib.zul
     and then  :  Executions.getCurrent().sendRedirect("adsPib.zul", "_blank");

src/web/theme/mytheme/zul/adsPib.zul
     Executions.getCurrent().sendRedirect("adsPib.zul", "_blank");

But it looks like something else is required ....

Are there any guidelines or examples about the ideal location for new .zul pages inside the theme or additional osgi extensions perhaps ?  . so we can open those .zul pages (inside the /webui  app of zk/idempiere) ?  

BTW: I already checked the default .zk theme (idempiere core)  and its .zul pages. but I i did it not find a good example about it ... 

Thanks in advance for any suggestion,

Pedro R.


Heng Sin Low

unread,
Sep 8, 2022, 7:16:17 PM9/8/22
to idem...@googlegroups.com
You have to setup your plugin as fragment of org.adempiere.ui.zk (Fragment-Host: org.adempiere.ui.zk) and add "Jetty-WarPrependFragmentResourcePath: /" to the end of your plugin's MANIFEST.MF

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/b93e96ef-957e-4d23-bb3b-718279a4451cn%40googlegroups.com.

Pedro Rozo

unread,
Sep 8, 2022, 9:22:24 PM9/8/22
to iDempiere
Thanks for your quick reply Hen Sin Low ..   good news ...

#1 I already performed that suggested change (jetty config) on my current theme (custom theme) activated as Fragment 

#2 And I also located my adsPib.zul page on this location on my plugin:

src/web/theme/mytheme/adsPib.zul

#3 regarding the URL syntax,  Analyzing other web resources of the theme (URL's) I saw they used this syntax recently, so I replicate that method to generate the valid URL for mine:

Executions.getCurrent().sendRedirect("~./theme/mytheme/adsPib.zul", "_blank");

And from the browser that works flawlessly with generated dynamic URL:  

https://localhost:8443/webui/zkau/web/f5861684/theme/mytheme/adsPib.zul

Thanks a lot for your gentle feedback (and zk wisdom)  :) 

Regards/Cordial Saludo

Pedro R.

Reply all
Reply to author
Forward
0 new messages