Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Attach components to HTML

    There's any way to dinamically attach SmartGWT components (ex DynamicForm, Label..) to a dinamicaly loaded HTML content?

    The code below works, but the smartGWT components disappears when I resize the page, or in general when the page redraw for any reason.

    test.html
    Code:
    <div style="border: 2px solid red;">
            hello
    	<div id="myAppId" style="border: 1px solid black; width:300px; height:200px"></div>
    </div>
    somewhere in the app
    Code:
    HTMLPane pane = new HTMLPane();
    pane.setContentsType(ContentsType.FRAGMENT);
    pane.setContentsURL("test.html");  
    
    button.addClickHandler(new ClickHandler() {
       public void onClick(ClickEvent event) {
          RootPanel.get("myAppId").add(new Label("test"));
       }
    }
    Or there's maybe another way to achieve the same result?
    Last edited by bebo; 10 Jul 2011, 05:34.

    #2
    Anyone????

    Comment


      #3
      hi,

      use addChild() method to add components in smartgwt

      to position the component use setTop() ,setLeft() ..

      Comment


        #4
        Thanks, but doesnt really solve my problem.

        Comment


          #5
          hi,

          Whats your problem ???

          Comment


            #6
            Well, its the one I said in the first message..
            I need a way do attach SmartGWT widgets to some portions, for example div with an id, of an html page loaded dinamically.

            Comment

            Working...
            X