Announcement

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

    Refresh widget

    Hi.

    I'm beginner in GWT, and I need to change the contents of a widget when a button is pressed.

    Example:

    Widget wContents = new CanvasMain1();

    button click -> wContents = new CanvasMain2();

    but the widget not changed in the screen...

    Please, What is the correct way?

    #2
    Hi titobundy, We don't mean to sound rude, but this is an fairly basic Java related question on how new objects and references work. You need to call methods on wContents to update its appearance and cannot reassign a new instance and expect the appearance to change.

    Comment


      #3
      I tried deleting the contents and adding a new one, through the methods removeChildren / addChildren, but did not work

      I want to do something like:

      http://www.greatbritishphotographers.com/
      Last edited by titobundy; 15 Dec 2009, 15:06.

      Comment


        #4
        Originally posted by titobundy
        I tried deleting the contents and adding a new one, through the methods removeChildren / addChildren, but did not work

        I want to do something like:

        http://www.greatbritishphotographers.com/
        I think the key is to use the class History...

        Comment


          #5
          Post a standalone version of you code with an onModuleLoad(). That will allow users to help you. Without posting your code, nobody knows what you're doing. Also read the FAQ sticky above.

          Comment

          Working...
          X