Thursday, June 12, 2014

Re: Edit an object in a List without a ListEditor

Hi all,

Thanks for the valuable information here, I'm facing a little different but related issue: I have a form that changes some fields depending on what is selected in it

The story is a person who edits her profile, and says: "I'm a company" or "I'm a person" (eventually "I'm a member of a company")
So depending on this choice that is in the form it self, I want to change some editors in the view (first name, last name vs. company name, taxes serial number)

What I thought I could do until now is that I have a ValueAwareEditor with subeditors 

@Path("")
@UiField
protected CompanyBasicInfo basicInfoComp;

@Path("")
@UiField
protected PersonBasicInfo basicInfoPers;

both are filled by the driver, but only one of them is visible.

The thing is that I don't like the idea of having the same property in many editors, neither the performance this approach could imply

On the other side, CompanyBasicInfo and PersonBasicInfo are regular Editor implementations. So putting @Ignore on both of them is not possible since I cannot call a setValue() on them when I will want.

Also making them implement ValueAwareEditor is not clear to me since the contain regular Editor widgets, so I still won't be able to call setValue() on their fields : I'm just moving the problem a step further...

In the view I also don't have access to the Driver to call edit() again. I took a look at how it is done in the lists but there are too much new concepts, I don't think I have to learn all that code just to be able to handle this simple case

Thanks for you answers

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment