Hi Blessed Geek, I don't agree with you here. UiBinder is usable with different layouts. Please take a look at this article: http://aarendar.wordpress.com/2010/03/01/learning-gwt-uibinder-part-1/
Sincerely, Alex On Feb 14, 4:18 pm, Blessed Geek <[email protected]> wrote: > The only usable layout forUIBinderis DockLayoutPanel, which is not > applicable for most layout requirements. Without useable layouts,uibinderis a > good demo technology but unuseable. > > The Grid widget for example. > No setColumnCount nor setRowCount nor add(widget) methods. > > OK, that's simple. I'll just extend Grid and provide my own > setColumnCount, setRowCount and add(widget). Or so I thought. > > static public class UIGrid > extends Grid > { > public void setRowCount(int n){ > this.numRows = n; > } > public void setColumnCount(int n){ > this.numColumns = n; > } > public void add(Widget w){ > int row = this.count/this.numColumns; > int col = this.count - row*this.numColumns ; > this.count++; > if (this.numRows<row) > this.setRowCount(row); > this.setWidget(row, col, w); > } > > public void add(String t){ > int row = this.count/this.numColumns; > int col = this.count - row*this.numColumns; > this.count++; > this.setText(row, col, t); > } > protected int count=0; > } > > And my ui.xml: > > <z:UIGrid > columnCount='2' rowCount='3'> > <g:Label>Name</g:Label> > <g:TextBox ui:field="name" width="15em"/> > <g:Label>Password</g:Label> > <g:TextBox ui:field="password" width="15em"/> > <g:Button ui:field="logIn" text="login"/> > </z:UIGrid> > > You know what, theuibinderattributes was not read at the start of > bind but probably after all the members have been added. Which means, > during add widget, the placement calculation encountered divide by > zero exception. > > So. I had to explicitly set the sizes at the constructor. > public UIGrid(){ > this.resize(3, 2); > } > > That is poor design strategy on my part. > > Hey GWT team, help us out here by enhancing the layout policy > guys.Otherwise, using the java source code to perform layout defeats > the purpose of usinguibinder!! -- 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.
