0

ZK 8 Middle Object issue

asked 2018-01-13 16:26:20 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2597 2 8
http://emrpms.blogspot.in...

updated 2018-01-15 16:28:37 +0800

cor3000 gravatar image cor3000
3669 1 7
ZK Team

Hi

I am again(always) got problem in middle Object. Here is my scenario

1) I have a big module in which i design the using border Layout. The Left displays the Links for the user to click.

2) When user clicks on the Link to display, the center area loaded with zul (Let us called Child Form) which contains middle object binding. As example:

<div form="@id('fx') 
           @init(vm.myForm) 
           @load(vm.selectedEncounter) 
           @save(vm.selectedEncounter,before='saveThis')"/>

3) Now User clicks save button on ChildForm, no problem, values are synchronize to the orginal object and data get saved into the DB. No Problem here.

4) We also have the option of OnJump Save, means while the child form is being displayed, when the user clicks on another option in the left panel, now we want to save and open that zul. So now i am calling the method of save the current child form, but synchronize does not takes places and hence changes are not saved

Any help.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-01-15 14:34:08 +0800

cor3000 gravatar image cor3000
3669 1 7
ZK Team

updated 2018-01-15 14:38:23 +0800

It sounds like you are calling your command methods directly from java code. In such case the @Command("saveThis") annotations are not evaluated and the @save(vm.myForm, before='saveThis') doesn't trigger to save the form changes from the Proxy to the original object.

That's the expected behavior.

if you want to save the proxy changes to the original object from java you have to call:

((FormProxyObject)this.myForm).submitToOrigin()
link publish delete flag offensive edit

Comments

But submitToOrigin requires some argument to pass. what we need to pass

Senthilchettyin ( 2018-01-16 20:59:05 +0800 )edit
0

answered 2018-01-16 20:57:35 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2597 2 8
http://emrpms.blogspot.in...

updated 2018-01-16 21:05:37 +0800

Ok Can you tell how to make it dirty again . The reason i am asking is, if the control comes to saveThis and then looks like it is not dirty anymore

I mean how to make it dirty programmatically using java code.

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: 2018-01-13 16:26:20 +0800

Seen: 12 times

Last updated: 14 hours ago