Hello Amos,

Sorry for the inconvenience of the Information mail. You have received it because you posted your request on the free developer mailing list. Premium support customers are pleased to post on the [EMAIL PROTECTED] Premium Support Mailing list.
You'll have guarantee response time and premium support only on the premium 
support mailing list.

To your question about the valueChangeEvent :
The ULCTextFields on the client side are registered as dirty data owners. If a round trip is triggered, as by the auto-refresh job, the current value of the field is synchronized and a value changed event is fired. One possiblity to solve the problem is to create a TextField Extension that overwrites the dirty data handling on the client side.

for example :

public class UIOnlySyncOnFocusLostTextField extends UITextField  {
    // do not trigger value changed events if the round trip is not triggered 
due to the focus loss of the field.
    @Override
    public void flushPendingEvent() {

    }
    // do not synchronize the value if the round trip is not triggered due to 
the focus loss of the field.
    @Override
    public void flushDirtyData() {
    }
}

This prevents the text field to synchronize state if it has not triggered the 
round trip by itself.

Thanks and regards,

Marcel

-----------------------------------------
Marcel Rüedi

email: [EMAIL PROTECTED]
url: http://www.canoo.com

Beyond AJAX - Java Rich Internet Applications

http://www.canoo.com/ulc
-----------------------------------------



Amos Parlante wrote:
We’re doing some business logic in one of our ULCTextFields that displays a confirmation dialog when the value change event occurs. In almost all situations this is working great for us, however, there is a situation where there is some ‘background’ view that is auto-refreshing values in a table (Quartz job) and this is triggering the change event in our text field to fire. The problem is when the user enters part of their value and the change event is fired the confirmation dialog pops up before the user has entered their value. Also, the refresh is occurring every 5 seconds (in our case) so the confirmation dialog pops up every five seconds.

The real problem is that we are using value change events in place of focus events (we used the fact that ULC doesn’t fire a change event until the focus is lost). What is happening (order is important).

   1. user enters a partial value in text field (with the registered
      change listener that pops up confirmation dialog).
   2. background refresh occurs
   3. UI component of text field fires value changed event.
   4. ULC text component displays confirmation dialog.
   5. UI component fires focus changed.
   6. …

It is the fact that the value changed event (client synchronization) is occurring before the focus event is fired, yet it is the focus event change that is causing the client to synchronize. I’d like to register for focus change events on the client (UI) and if it is temporary then not send the value change event but because of the order I can’t find a way to do this. Any suggestions as to how I can intercept this value change event AND have the focus event that triggered it so I can decide if I really want to send the value change event? I can override the fireValueChanged(..) method but at the time it’s called I don’t have the triggering focus event so I can’t make the check. Or any other recommendations??

Sincerely,


Amos

Navis

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to