0

keeping the same page for both CREATE / UPDATE

asked 2015-11-11 18:44:29 +0800

jawak gravatar image jawak
3 1

I have a requirement to create a page that handles both CREATE and UPDATE operation. For example, there is a page with 10 different fields. I want to show only 5 fields while CREATE parameter (action=create) being passed from another application. In the same way, want to show all 10 fields when UPDATE parameter(action=update) is received.

where to catch the event in zul page before rendering it to the browser? I am using java for the back end.

Appreciate your help.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-11-11 20:02:13 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

You don't need to catch any event.

A CREATE will have no id normally so you could use in the zul the if attribute and test it against the ID being there or not.

Greetz chill.

link publish delete flag offensive edit
0

answered 2015-11-12 08:02:26 +0800

Darksu gravatar image Darksu
1991 1 4

Hello jawak,

If you want to accomplish this task with java then you could use executions as shown below (scenario is that the parameters are passed via url):

https://javadude.wordpress.com/2012/12/03/code-snippet-zk-controller-reading-url-parameter/

After that you can set the visibility depending if it is mvc or mvvm.

Best,

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
1 follower

RSS

Stats

Asked: 2015-11-11 18:44:29 +0800

Seen: 19 times

Last updated: Nov 12 '15

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