Saturday, November 18, 2017

Re: Editors


Thank's Thomas, it works great.

I replaced Editor with ValueAwareEditor and I get the pointer to the bean at init time in setValue :
@Override
public void setValue(Person value) {
flushedPerson = value;
GWT.log("setValue from ValueAwareEditor" );
}
that can be used in any subsequent flush :

@Override
public void flush() {
// flushedPerson is updated with ui values
// update visibility of RedDot image 
}

For the hierarchy, I guess it will work the same. Let's say Person has a toMany relationship on Adress.
I will need a composite implementing  IsEditor<ListEditor<Adress, AdressEditor>>
where AddressEditor will be a ValueAwareEditor<Address>

flush() will be called for each address of the relationship, right ?

Le vendredi 17 novembre 2017 09:10:01 UTC+1, Thomas Broyer a écrit :
So you're getting "some data changed" events bubble up to the root, which flushes editors (i.e. get all the data up from all editors), to compute fields and edit again (i.e. push data down again to all editors)? That's pretty inefficient.

With that info, I think I wouldn't use EditorDriver mechanisms at all for this (which does not mean not using EditorDriver at all, just not for those " red dots"), but do it at the widget level; i.e. bind the TextBox directly to the RedDot, at the Composite level (and have RedDot totally disconnected from the EditorDriver). For the initial state, have your Composite implement ValueAwareEditor so you can compute it and initialize the RedDots in setValue.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment