1. #1
    Sencha User
    Join Date
    Mar 2013
    Location
    Malaysia
    Posts
    2
    Vote Rating
    0
    tkong is on a distinguished road

      0  

    Default Unanswered: How to reset/refresh a widget into default status

    Unanswered: How to reset/refresh a widget into default status


    Does anyone know how to reset or refresh a widget into default status?

    Example: TabPanal Item with few TextField, user key in some value without submit, the user close that specific TabPanel Item and re-open it, it will show a plain empty widget without any value inside which is just like "reset field" function...

    Thank In Advance !

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Vote Rating
    21
    Answers
    20
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    All Field widgets have a reset() method which restores the widget to it's original state and clears any validation messages.

    I think you can use the addBeforeCloseHandler(...) method on TabPanel to do what you want. You would need to have your widget or widget's container construct a BeforeCloseHandler and and pass it in to the TabPanel.addBeforeCloseHandler() method. Your BeforeCloseHandler would call your_widget.reset or really, you can have it do whatever you want.

    We took this concept several steps further and created an abstract Tab widget that has an initialize(), destroy(), and resize() method to perform the applicable tasks. We have a special TabSelectionHandler that calls the destroy() method on the old tab and the intialize() method on the new tab.

Thread Participants: 1

Tags for this Thread