Thank you for your reply. I took the time to create (a working ;) small sample and it behaves like expected.
flushing is setting null on my beans properties. I am logging the values to the console directly before the flush: textbox value is "" bean value is "" ==> calling flush bean gets empty string fields set to null I just built GWT from trunk. As I said, a simple editor sample here works as expected. The editor in my app does not. I know now it is my code, I am just too blind to see it right now. On 19 Aug., 14:09, Sudhakar Abraham <[email protected]> wrote: > When You click the save button bean value should be set. It is > important that Bean class domain variable name should be same as > ui:field name in Editor class. > > I have given below a simple program. > Hope it helps. > > S.Abrahamwww.DataStoreGwt.com > > ------------------- sample program > -------------------------------------- > > <<Editor class>> > public class MyEditorWorkFlow extends Composite { > interface Binder extends UiBinder<Widget, MyEditorWorkFlow>{} > Binder binder = GWT.create(Binder.class); > interface Driver extends SimpleBeanEditorDriver<MyData,MyEditor> > {} > private Driver driver = GWT.create(Driver.class); > @UiField (provided = true) > MyEditor editor; > MyData myData_ = null; > public MyEditorWorkFlow(MyData myData) > { > this.myData_ = myData; > editor = new MyEditor(myData_); > initWidget(binder.createAndBindUi(this)); > edit(myData_); > } > @UiHandler("save") > void onSave(ClickEvent event) > { > MyData myData = driver.flush(); > Window.alert("Name=" + myData.getName() ); > } > public void edit(MyData myData) > { > driver.initialize(editor); > driver.edit(myData); > } > } > > <<Bean class>> > public class MyData implements Serializable > { > public String name; > > public String getName() > { > return name;} > > public void setName(String name) > { > this.name = name; > > } > } > > <<ui.xml>> > <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" > xmlns:g="urn:import:com.google.gwt.user.client.ui"> > <g:FlowPanel> > <g:TextBox ui:field="name"/> > </g:FlowPanel> > </ui:UiBinder> > > On Aug 18, 4:27 am, "P.G.Taboada" <[email protected]> wrote: > > > > > > > > > hi, > > > Not sure what I am doing wrong. > > > I did build a form with uibinder and I am populating a few TextBoxes > > with an editor: > > > mydriver.initialize( this ); > > mydriver.edit( somebean ); > > > ... User edits data ... > > > changedBean = myeditor.flush(); > > > When I look at the changedBean, all empty string properties became > > null. Not what I or the database did expect. > > > I am using gwt build from trunk. > > > Brgds, > > > Papick -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
