1

Build web application without any zul files

asked 2017-04-05 16:47:16 +0800

54patman gravatar image 54patman
13 3

updated 2017-04-06 00:56:02 +0800

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.

delete flag offensive retag edit

Comments

Search for richlets. This is how you want it

chillworld ( 2017-04-05 17:47:50 +0800 )edit

Thank 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

3 Answers

Sort by ยป oldest newest most voted
0

answered 2017-04-06 01:25:28 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2017-04-06 10:32:58 +0800

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

link publish delete flag offensive edit
0

answered 2017-04-06 10:31:01 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2017-04-06 10:33:44 +0800

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);
link publish delete flag offensive edit
0

answered 2017-04-10 05:49:51 +0800

Darksu gravatar image Darksu
1991 1 4

Hello,

Just adding some more info:

https://www.zkoss.org/wiki/SmallTalks/2013/January/BuildingUserInterfaceProgrammaticallywithRichlet

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2017-04-05 16:47:16 +0800

Seen: 52 times

Last updated: Apr 10 '17

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