-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to build the whole web application with no zul files, except maybe the index.zul?
Basically I want to have the minimum amount of files and want to build and react to the whole UI in java code. Is there a way to detect URL mappings and have them responded to by a specific SelectorComposer to build the UI?
ex: MY_SITE.com/showUsers
would get intercepted and delegate to the ShowUsersSelectorComposer to build the page of users etc...
No need for a showUser.zul all of the logic would be in the code. An yes I know about the lose coupling between the UI and business logic, which is still achievable with proper DAL and BO.
As chill commented Richlets are your best choice: https://www.zkoss.org/wiki/ZKDeveloper'sReference/UI_Composing/Richlet
Of course if there is no ZUL files at all you don't need a (Selector)Composer and extend the GenericRichlet class instead. Also you don't need the "Selector" logic, since you create the components directly you'll have full control about where to store your created components in your own classes.
Robert
yes the automatic wiring (@Wire) is not necessary if you create the components directly in java code. You can simply assign them to any member in your Richlet class - no magic ;).
/*no @Wire necessary here*/
Textbox mytextbox;
...
this.mytextbox = new Textbox();
parent.appendChild(this.mytextbox);
Hello,
Just adding some more info:
https://www.zkoss.org/wiki/SmallTalks/2013/January/BuildingUserInterfaceProgrammaticallywithRichlet
Best Regards,
Darksu
Asked: 2017-04-05 16:47:16 +0800
Seen: 51 times
Last updated: Apr 10 '17
Can't deploy application with ZSS dependency
zkspringmvc jar licence is GPL ?
Custom component that extends Textbox does not fire onChange event
java.lang.NullPointerException to update to zk 8.0.1
"Spring Session" + ZK + "Spring core" @Listen method refresh the screen
zk8 client side binding to a viewmodel command seems not to work
Search for richlets. This is how you want it
chillworld ( 2017-04-05 17:47:50 +0800 )editThank you both for your answers it is very helpful.
@Robert (cor3000) what do you mean by "where to store them". Are you referring to the @Wire annotation where from the zul the object is injected into the Selector automagically? Which means I'll need to track interaction manually, which is ok.
54patman ( 2017-04-06 10:05:56 +0800 )edit