1. #1
    Ext GWT Premium Member
    Join Date
    Jan 2009
    Location
    Colorado Springs, CO
    Posts
    380
    Vote Rating
    5
    DavidHoffer is on a distinguished road

      0  

    Question How to add dynamic content to TabItem or any container?

    How to add dynamic content to TabItem or any container?


    I have a TabItem that needs to add content after server calculates a result. How can I add another Widget? I've tried calling add(), insert(), etc but the Widget is never shown.

    How is this done? Is there some sort of update/refresh I need to do?

    -Dave

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You need to call layout() afder any modification. Please use the froum search.

  3. #3
    Ext GWT Premium Member
    Join Date
    Jan 2009
    Location
    Colorado Springs, CO
    Posts
    380
    Vote Rating
    5
    DavidHoffer is on a distinguished road

      0  

    Question


    I did that with no luck...the new content is never displayed. I did a forum search but found nothing for GXT.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    If that is not working you will need to post a fully working testcase that is implementing entrypoint and demonstrates your problem.

  5. #5
    Ext GWT Premium Member
    Join Date
    Jan 2009
    Location
    Colorado Springs, CO
    Posts
    380
    Vote Rating
    5
    DavidHoffer is on a distinguished road

      0  

    Question


    Hum, that might be hard to do...need server side async call.

    Just to be clear, your saying I should be able to:

    Create a TabItem instance
    Add static content to instance
    Add instance to TabPanel
    Show the application
    Make the async call server call, get the async response
    Add/modify UI content on the TabItem instance (e.g. i could insert a new widget)
    Call tabItem.layout();
    The new content should be visible.

    -Dave

  6. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    What is "Add static content to instance"?

  7. #7
    Ext GWT Premium Member
    Join Date
    Jan 2009
    Location
    Colorado Springs, CO
    Posts
    380
    Vote Rating
    5
    DavidHoffer is on a distinguished road

      0  

    Question


    Static content: Widgets, maybe anything. I.e.

    TabItem tabItem = new TabItem("Tab One"):
    tabItem.add(new HTML("Foo"));
    tabItem.add(new HTML("Bar"));

    Dynamic content: What I need to do after the server call returns is something like:
    tabItem.insert(new HTML("Foo"), 1);

  8. #8
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Normally simple calling layout after inserting it should do it. But without having the code, i dont know why this is not working for you.

  9. #9
    Ext GWT Premium Member
    Join Date
    Jan 2009
    Location
    Colorado Springs, CO
    Posts
    380
    Vote Rating
    5
    DavidHoffer is on a distinguished road

      0  

    Question


    Okay so:

    Dynamic content: What I need to do after the server call returns is something like:
    tabItem.insert(new HTML("Foo"), 1);
    tabItem. layout();

    Should work. Hum, are there any restrictions on the type passed into insert()? The docs say Widget will be wrapped with WidgetComponent, is it considered best practice for me to wrap the widget or use GXT types?

Thread Participants: 1