FANTASTIC, that worked. Not sure if I understand all the nuances of uibinder yet.
Thank you. And Thank you Patrick too. On Jan 19, 8:59 pm, Ashwin Desikan <[email protected]> wrote: > Mike, > In your ui:binder you are using a SplitlayoutPanel. You have to use the same > for the variable definition in your view as well. At runtime assign qn > instance of your custom SplitPanel to the declared variable > > Example: > > @UiField > SplitLayoutPanel splitPanel = MySplitLayoutPanel(); > > You need to add a cast anywhere you are using methods which are not part if > the base class > > Thanks > Ashwin > > Sent from my iPhone > > On Jan 20, 2012, at 12:18 AM,MikeDee<[email protected]> wrote: > > > > > > > > > That gives a runtime error when the view calls initWidget() in its > > constructor. > > > Here is a summary of the code. Note it uses Activities and Places. > > > // The view > > public class MyViewImpl extends Composite implements MyView, > > RequiresResize, ProvidesResize > > { > > interface Binder extends UiBinder<Widget, MyViewImpl> > > { > > } > > > private static final Binder binder = GWT.create( Binder.class ); > > > @UiField(provided=true) MySplitLayoutPanel splitPanel; > > > ... > > public MyViewImpl() > > { > > initWidget( binder.createAndBindUi( this ) ); // <=== Exception > > thrown here > > } > > > } > > > // MyView.ui.xml > > <?xml version="1.0" encoding="UTF-8"?> > > <!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' > > xmlns:p1="urn:import:com.google.gwt.user.cellview.client"> > > > <g:SplitLayoutPanel width="100%" height="100%" ui:field="splitPanel"> > > ... > > </g:SplitLayoutPanel> > > </ui:UiBinder> > > > // MySplitLayoutPanel.java > > public class MySplitLayoutPanel extends SplitLayoutPanel > > { > > private static MySplitLayoutPanellUiBinder uiBinder = > > GWT.create( MySplitLayoutPanel.class ); > > > interface MySplitLayoutPanelUiBinder extends UiBinder<Widget, > > MySplitLayoutPanel> > > { > > } > > > @UiField SplitLayoutPanel main; > > > // Just want to be able to override onResize. > > @Override > > public void onResize() > > { > > System.out.println( "*** ONRESIZE ***" ); > > } > > } > > > // MySplitLayoutPanel.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:SplitLayoutPanel ui:field="main"/> > > </ui:UiBinder> > > > On Jan 18, 5:57 am, Patrick Tucker <[email protected]> > > wrote: > >> Define the element as a SplitLayoutPanel in the uibinder and provide > >> it with an instance of your class in the java code. > > >> @UiField(provided=true) > > >> On Jan 17, 7:37 pm,MikeDee<[email protected]> wrote: > > >>> Just getting back to this. Was working on something else. > > >>> I did as describe below, by Ashwin. > > >>> However, when I switch to design mode in GWTDesigner, the following > >>> error occurs: > > >>> [ERROR] No class matching "west" in > >>> urn:import:com.google.gwt.user.client.ui Element <g:west size='150.0'> > > >>> I assume that something else must be done so that GWTDesigner knows > >>> either: 1) my class is based on SplitLayoutPanel and thus the same XML > >>> is used to define it, 2) I have to some how tell GWTDesigner about all > >>> the options supported by MySplitLayoutPanel so that it knows how to > >>> interpret the uibinder code. > > >>> It seems like this would be a common practice - to extend GWT widgets > >>> - and so I assume it isn't too difficult. Any pointers? > > >>>Mike > > >>> On Dec 28 2011, 8:53 pm, Ashwin Desikan <[email protected]> > >>> wrote: > > >>>>Mike, > > >>>> As long as you have a default constrictor in your derivedayout panel, > >>>> you should be able to use it in ui:binder like below. > > >>>> <ui:binder> > >>>> <m:MySplitLayoutPanel/> > >>>> </ui:binder> > > >>>> Above m is the namespace identifier for your package. > > >>>> Did u try something like above? > > >>>> Thanks > >>>> Ashwin > >>>> Sent from my iPhone > > >>>> On Dec 28, 2011, at 10:53 PM,MikeDee<[email protected]> wrote: > > >>>>> Hi Ashwin, > > >>>>> The SplitLayoutPanel is inside a DockLayoutPanel (in the center). I > >>>>> can see the DockLayoutPanel->onResize() calling SplitLayoutPanel- > >>>>>> onResize(). However, it isn't calling the onResize() I added with > >>>>> addHandler(). I assume addHandler() has no effect since > >>>>> SplitLayoutPanel implements ResizeRequired. So, now I am figuring out > >>>>> how to get a hold of SplitLayoutPanel's onResize() to override. > > >>>>> I've created a derived panel, called MySplitLayoutPanel. Currently > >>>>> trying to figure out how to make this work with uibinder. > > >>>>>Mike > > >>>>> On Dec 28, 1:16 am, Ashwin Desikan <[email protected]> wrote: > >>>>>> All layout panels implement the onResize method. So you don't Have to > >>>>>> extend the widget unless you are doing a custom Splitlayout panel. > > >>>>>> Do you use the Splitlayout panel inside other panels? Also, i trust > >>>>>> you are using rootlayout panel instead of rootpanel in the onModule > >>>>>> method of your entrypoint > > >>>>>> Since, I can't Access the entire thread over email I am assuming you > >>>>>> are having Splitlayout panel inside another layout like a htmlpanel > >>>>>> etc and expect it to resize on the change of view dimensions? > > >>>>>> If thats the case on way to fire the onResize automatically is to use > >>>>>> a place the splitlayoutpanel inside a ResizeLayoutPanel or for that > >>>>>> matter any layout panels > > >>>>>> ~Ashwin > > >>>>>> Sent from my iPhone > > >>>>>> On Dec 28, 2011, at 1:08 PM,MikeDee<[email protected]> wrote: > > >>>>>>> Played around with this a little more and came to a few conclusions. > >>>>>>> I am guessing that adding a ResizeHandler to SplitLayoutPanel has no > >>>>>>> effect because SplitLayoutPanel already implements onResize() - due to > >>>>>>> its implementing RequiresResize. I can see SplitLayoutPanel's > >>>>>>> onResize() being called by stepping through the code. The > >>>>>>> ResizeHandler I added is no where to be found. > > >>>>>>> That leaves the option of deriving my own subclass of SplitLayoutPanel > >>>>>>> and then overriding onResize(). Easy enough EXCEPT how does one get > >>>>>>> such a class to work with uibinder? > > >>>>>>> -- > >>>>>>> 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 > >>>>>>> athttp://groups.google.com/group/google-web-toolkit?hl=en. > > >>>>> -- > >>>>> 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 > >>>>> athttp://groups.google.com/group/google-web-toolkit?hl=en. > > > -- > > 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 > > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- 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.
