1. #11
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Seems to work correctly in 3.0.1, tested Linux/Chrome, Linux/Firefox Mac/Firefox, and XP/IE8.

  2. #12
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default


    Hi icfantv,

    I I use the simple container in place of the FramedPanel and it works much like the FramedPanel. I wonder if this has to do with creating my own widget.

    In the section from the UiBinder marked

    ======================DatasetAdministation

    There is a point where I create the widget (See below)

    Code:
    <container:HorizontalLayoutContainer>
    <container:child layoutData="{horizontalLayoutData}">
    <control:DatasetGrid datasetAdminServiceAsync="{datasetAdminServiceAsync}" ui:field="datasetGrid"/>
    </container:child>
    Inside the DatasetGrid is where I create the VLC and add the Toolbar and Grid. I wonder if the AsWidget method does not expose the resize events, or if adding a Widget stops the resize from the parents.

  3. #13
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Adding a Widget definitely stops the resize events, but FramedPanel inherits from SimpleContainer (except it has rounded corners, headers, space for buttons, etc). Use ResizeComposite or just implement IsWidget instead of Composite if you want resize to work, or else you need to implement something like RequiresResize on your own.

    If you just implement IsWidget and return something that implements RequiresResize from asWidget(), the outer container will know then know to size that child via its onResize method.

  4. #14
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default UiBuilder test

    UiBuilder test


    Hi Guys,

    I have tested your code version and they work as expected. By has anyone tested this with the UiBinder?
    I still have the issue.

    Thanks
    Patrick

  5. #15
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Patrick, without seeing an example of what does not work, it is hard to tell what the bug might be or what you might be doing wrong. The examples contain several cases of using and sizing the grid with UiBinder that seem to function correctly, so I have to assume at this point that something is miswired.

    Most relevant example is probably http://www.sencha.com/examples/#Exam...nguibindergrid

  6. #16
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default Example code

    Example code


    Hi Guys,

    I have created a test project and attached the code here so that you can run the code on your systems.
    Please let me know what I have done wrong

    Thanks
    Patrick
    Attached Files

  7. #17
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default Problem solved

    Problem solved


    Hi Guys,

    I finally figured out what was causing the issue. In the code example supplied I created my own "Widgets" for the UiBinder using the IsWidget interface. I however was creating the widget each time the asWidget method was called. This causes some very odd behavior. Is there possibly a away to adjust the code so that when the asWidget method is called it checks for a mismatch (Probably not - maybe add this to a knowledge article etc)?

    I have changed the code to create an instance widget in the constructor and return this in the asWidget method.

    Thanks for all your help guys I appreciate it!
    P.S. loving the controls

  8. #18
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Glad to hear it! We're going to add a discussion of Composite vs IsWidget vs ResizeComposite, but haven't fully scoped it out yet - your input helps, we'll definitely make a note of that.

    As you have probably noticed, we make this mistake in quite a number of places in our own examples. We're working to improve that as well.

    One last thought: It doesn't often make a big difference if you wait until asWidget() to create the widgets. The examples are something of a special case, since they are all created at page load, but shouldn't do their expensive render work until the app is ready to draw them on the screen.

  9. #19
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default Optimizations

    Optimizations


    Hi Colin,

    I will move the creation to the asWidget and wrap the widget in an if == null check to get your suggested optimizations!

    Thanks
    Patrick

  10. #20
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Sorry, I might not have been clear. That is not an optimization unless you create lots of widgets at once but don't attach them to anything until later. Unless you are in that situation, it makes your code just harder to read, and makes it easier to make that mistake about adding a null check in asWidget().

    "Premature optimization is the root of all evil" applies here - keep it simple and straightforward until necessary to make it dirty.

Thread Participants: 2