But submitToOrigin requires some argument to pass. what we need to pass
Senthilchettyin ( 2018-01-16 20:59:05 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
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()
But submitToOrigin requires some argument to pass. what we need to pass
Senthilchettyin ( 2018-01-16 20:59:05 +0800 )editOk 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.
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 )editAsked: 2018-01-13 16:26:20 +0800
Seen: 20 times
Last updated: Jan 16 '18