0

ZK 8 Middle Object issue [closed]

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

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

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

cor3000 gravatar image cor3000
6280 2 7

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

The question has been closed for the following reason "the question is answered, right answer was accepted" by cor3000
close date 2018-01-22 09:24:42

2 Answers

Sort by ยป oldest newest most voted
1

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

cor3000 gravatar image cor3000
6280 2 7

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
2623 3 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

Comments

duplicate question already answered here: http://forum.zkoss.org/question/109876/zk-8-middle-object-how-to-programmatically-make-it-dirty/

cor3000 ( 2018-01-22 09:24:27 +0800 )edit

Question tools

Follow
1 follower

RSS

Stats

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

Seen: 20 times

Last updated: Jan 16 '18

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