public void run ( AcceptsOneWidget container ) { /** Add our widgets in the container */ container . setWidget ( UiBuilder . addIn ( new VerticalPanel ( ) , personListWidget , personneForm , categoryForm , nextButton ) ) ; /* * Bind things together */ // selectedPerson to person form Bind ( personListWidget , "selectedPersonne" ) . Mode ( Mode . OneWay ) . Log ( "PERSONNEFORM" ) . To ( personneForm , "personne" ) ; // maps the selected person's category to the category form Bind ( personListWidget , "selectedPersonne.category" ) . Mode ( Mode . OneWay ) . MapTo ( categoryForm ) ; // selected person's description to Window's title Bind ( personListWidget , "selectedPersonne.description" ) . Mode ( Mode . OneWay ) . To ( new WriteOnlyPropertyAdapter ( ) { @ Override public void setValue ( Object object ) { Window . setTitle ( ( String ) object ) ; } } ) ; /* * Initialize person list widget */ personListWidget . setPersonList ( famille ) ; personListWidget . setSelectedPersonne ( famille . get ( 0 ) ) ; nextButton . addClickHandler ( nextButtonClickHandler ) ; }
Runs the demo