Sorry for not noticing this reply earlier.  Thank you for the
explanation as to when the event fires.  I did try incrementing the
version number in my persist() method - something very simple, just
incrementing the version by 1 before putting it back to the
datastore.  I will restore that code and debug it as you suggest and
post back with results (and probably questions :) ).

Thanks again!
RB


On Dec 15, 6:35 am, David Chandler <drfibona...@google.com> wrote:
> Hi Richard,
>
> It looks like AbstractRequestContext.processReturnRecord() fires an
> EntityProxyChange event only when the version has changed. See lines
> 270-285 here:
>
> http://code.google.com/p/google-web-toolkit/source/browse/tags/2.1.0/...
>
> The answer to your question likely lies in the implementation of
> hasVersionChanged() in the same file. Perhaps you could set a
> breakpoint on the server or client to confirm that the version has
> indeed changed for the entity?
>
> HTH,
> /dmc
>
>
>
>
>
>
>
>
>
> On Sun, Dec 12, 2010 at 5:52 PM, Richard Berger <richardlan...@gmail.com> 
> wrote:
> > I am following the model of DynaTableRf in building a sample app
> > combining RequestFactory, EditorFramework, CellTable, and Objectify.
> > In tracing the code for DynaTableRf after a new Person is created
> > (when the user clicks on New Person), the onPersonChanged method is
> > called, since it was registered using the following code:
>
> > EntityProxyChange.registerForProxyType(eventBus, PersonProxy.class,
> >    new EntityProxyChange.Handler<PersonProxy>() {
> >      public void onProxyChange(EntityProxyChange<PersonProxy> event)
> > {
> >        SummaryWidget.this.onPersonChanged(event);
> >      }
> >    });
>
> > However, in my code (which is essentially identical - same type of
> > "workflow", usage of RequestFactory, cellTable) my onProxyChange() is
> > NOT being called.  My code is shown below - yes, it looks quite
> > similar :).
> > EntityProxyChange.registerForProxyType(eventBus,
> > CommitmentProxy.class,
> >    new EntityProxyChange.Handler<CommitmentProxy>() {
> >      public void onProxyChange(EntityProxyChange<CommitmentProxy>
> > event) {
> >        SummaryWidget.this.onCommitmentChanged(event);
> >        System.out.println("In onCommitmentChanged");
> >      }
> >    });
>
> > In both cases (DynaTableRf, my code) the new objects (Person,
> > Commitment) are created - it is a matter of how to get the
> > EntityProxyChange to be called to update the display.
>
> > Two things I Hadn't noticed at first (but which had no effect when I
> > tried them):
> > 1. To my CommitmentProxy class, I added the following line to match
> > the equivalent in PersonProxy
> >        EntityProxyId<CommitmentProxy> stableId();  // For EntityProxyChange
> > - but no help
> > 2. To my persist() method, I added a manual update to the version
> > field, thinking that might be necessary to trigger the
> > EntityProxyChange.
>
> > The one significant difference between my code and DynaTableRf is that
> > I am using Objectify, whereas DynaTableRf appears to use an in-memory
> > datastore.
>
> > So my questions are:
> > 1. What is it that should trigger the EntityProxyChange event?  The
> > code for when the user presses the New Person button is:
> > PersonRequest context = requestFactory.personRequest();
> > AddressProxy address = context.create(AddressProxy.class);
> > PersonProxy person = context.edit(context.create(PersonProxy.class));
> > person.setAddress(address);
> > context.persist().using(person);
> > eventBus.fireEvent(new EditPersonEvent(person, context));
>
> > My code for the new Commitment button is:
> > CommitmentRequest context = requestFactory.commitmentRequest();
> > CommitmentProxy commitment =
> > context.edit(context.create(CommitmentProxy.class));
> > commitment.setPhase("Negotiation");
> > context.persist(currentCommitUserProxy).using(commitment);
> > eventBus.fireEvent(new EditCommitmentEvent(commitment, context));
>
> > 2. Is Objectify the problem?  Does it interfere with the magic that
> > triggers EntityProxyChange?
>
> > Thanks so much for any assistance!
> > RB
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-tool...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-web-toolkit+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> David Chandler
> Developer Programs Engineer, Google Web 
> Toolkithttp://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to