Hi Maik, > So i tried to register my client component as IDirtyDataOwner with the UISession every >time it has changed data in it. This yields the desired result, all changes become >transmitted to the server.
Yes this is the right way to do it. A component should mark itself as dirty (i.e. register as DirtyDataOwner) EVERY time it changes. It will be flushed during the next roundtrip. After flushing it is no longer dirty because its state has been synchronized with the server, it is no longer a "dirty data owner" and hence it is removed from the UISession's list of the dirty data owners. Your conclusion is correct. I will update the Javadoc with your feedback. Thanks for the feedback. Thanks and regards, Janak ----------------------------------------- Janak Mulani email: [EMAIL PROTECTED] url: http://www.canoo.com <http://www.canoo.com> Beyond AJAX - Java Rich Internet Applications http://www.canoo.com/ulc <http://www.canoo.com/ulc> ----------------------------------------- -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, April 17, 2008 1:40 PM To: [email protected] Subject: AW: [ULC-developer] How to use IDirtyDataOwner Hi Janak, thank you for your reply. I was ill the last days, so my reply comes a little late. The additional doc does clear up the topic a little, but i have still some questions. I did some research on the internet and also some testing with the IDirtyDataOwner and figured out the following: 1. My component implements IDirtyDataOwner and i tried to register it with the UISession once the basic object becomes created (in createBasicObject(Object[])). But it did not work as expected. The flushDirtyData() method became called only once (due to a round-trip while the dialog was open). Changes which had been made afterwards where not transfered to the server because flushDirtyData() was not called again. 2. So i tried to register my client component as IDirtyDataOwner with the UISession every time it has changed data in it. This yields the desired result, all changes become transmitted to the server. >From this experience i draw the conclusion that the UISession unregisters all dirtyDataOwners once their 'dirty data' has been transmitted and that it is only required to register a component as dirtyDataOwner when it has actual 'dirty data'. But the component must register as dirtyDataOwner each time it becomes dirty or the latest changes will not become transmitted. If this is the case, then it should be noted in the API-doc as well. Otherwise the users/programmers might get confused (just as i). Can you confirm my observation or did i get it all wrong? Kind regards Maik Scheibler Sächsische Aufbaubank - Förderbank - (SAB) Informationstechnologie Pirnaische Str. 9 01069 Dresden Tel.: +49 (351) 4910 - 1352 mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] Im Auftrag von Janak Mulani Gesendet: Freitag, 4. April 2008 11:24 An: [email protected] Betreff: RE: [ULC-developer] How to use IDirtyDataOwner Hi Maik, Recently we added the following Javadoc to IDirtyDataOwner for the next release. If a client side proxy of a component wishes to update the state of its corresponding server component, it can do that using an implementation of this interface. This is required when there is a state change on the client due to user interaction such as window resizing, button selection state, enabled state, etc. The component's client side proxy can register an object of the class implementing this interface with the <code>UISession</code> using <code>getSession().addDirtyDataOwner()</code>. During the next round-trip before sending the requests, <code>flushDirtyData()</code> is called on all <code>IDirtyDataOwner</code>s, wherein they can update the state of the server-side widget using a call like <code>updateStateULC("<attributeName>", getBasicComponent().get<AttributeName>())</code>. The <code>updateStateULC()</code> calls are handled and dispatched on the server side component by its <code>ULCProxyDispatcher</code>. Please let me know if this is helpful or you need more info. Thanks and regards, Janak > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:ulc-developer- <mailto:ulc-developer-> > [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Wednesday, April 02, 2008 7:17 PM > To: [email protected] > Subject: [ULC-developer] How to use IDirtyDataOwner > > Hi, > > i'm trying to understand the concept of the > IDirtyDataOwner.flushDirtyData() method. There is very little about it on > the Extension Guide or the API docs. > > My goal is to implement an widget which is a sophisticated HTML editor. So > i need to understand how and when to transfer the user input back to the > server, so that it is available when the next server-round-trip is > running. > > The extension guide does explain how to use the updateStateULC methods and > that they are causing seperate server-round-trips (which i want to avoid) > when they are 'called outside the context of a flushDirtyData() method > call'. > > The UISession offers the method 'addDirtyDataOwner(dirtyDataOwner)', but > it is not explained how the dirty detection works or how it is triggered. > > Can anyone clearify this? > > > > Best regards > Maik Scheibler > > Sächsische Aufbaubank - Förderbank - (SAB) > Informationstechnologie > Pirnaische Str. 9 > 01069 Dresden > Tel.: +49 (351) 4910 - 1352 > mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > Sächsische Aufbaubank - Förderbank - Anstalt des öffentlichen Rechts, > Sitz Dresden, > Amtsgericht Dresden HRA 5353, > Ust-IdNr. DE179593934. > > _______________________________________________ > ULC-developer mailing list > [email protected] > http://lists.canoo.com/mailman/listinfo/ulc-developer <http://lists.canoo.com/mailman/listinfo/ulc-developer> Sächsische Aufbaubank - Förderbank - Anstalt des öffentlichen Rechts, Sitz Dresden, Amtsgericht Dresden HRA 5353, Ust-IdNr. DE179593934. _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer <http://lists.canoo.com/mailman/listinfo/ulc-developer>
