Hi Stephan,
In ULC, a ULCProxy is uploaded to the client only if it is referenced by
another ULCProxy that is being/has been uploaded.
ULCHasChangedEnabler does not get uploaded unless it is referenced by
another ULCProxy. When you set it as an enabler on a component using
setEnabler(), a reference is created and it is uploaded with the component.
Since you do not want to set it as an enabler for any component, you will
need to force an upload manually in your init() method :
enabler.upload()
Please note that isEnabling will return true in the next server round trip
after a target has changed.
Thanks and regards,
Janak
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Stephane BARTHON
Sent: Monday, August 28, 2006 7:26 PM
To: [email protected]
Subject: [ULC-developer] ULCHasChangedEnabler
Hi all,
I have a problem when using the ULCHasChangedEnabler. I have a view with 4
tabs and almost a dozen of panes. I would like to use the enabler to check
the dirty state of different panes. I have no special button nor component
to activate. I just want to be able to detect which panes have been modified
to prevent some unecessary call of database saving operation. Here is a
simple example:
public MyClass() {
ULCHasChangedEnabler enabler = null;
...
private void init(){
enabler = new ULCHasChangedEnabler();
enabler.add(txtField1);
enabler.add(txtField2);
}
public boolean isDirty(){
return enabler.isEnabling();
}
...
}
The problem is that the enabler.isEnabling is always false. If I add the
following lines, it runs.
myHiddenButton = new MyButton();
myHiddenButton.setEnabler(hasChangedEnabler);
But l don't want to add hidden component in every class I make with such an
enabler.
I looks like if the enabler is not attached to a graphical element, it will
not be updated. Thank you to tell me if it's a bug or if I have made it
wrong.
Stéphane Barthon
DSI R&D - Nantes
Transports Graveleau
+33(0)2 40 05 35 63
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer