Title: How to use Deck Panel of Ui Services
Tags: google-apps-script
Question: After reading the GAS documentation related to Deck Panel of the Ui Services, I understand that once an element is added to a Deck panel, it becomes invisible, and if the element is removed from this, it will be visible again. I wrote some testing code, but I can't get to make a panel visible when I remove it from the Deck Panel. Any insights?

Here is the code:

```function doGet() {
    var app = UiApp.createApplication();
    var globalPan = app.createAbsolutePanel();
    app.add(globalPan);   
    var deckPanel = app.createDeckPanel().setId('deck').setSize(300, 300).setTitle('DeckPanel').setAnimationEnabled(true);
    globalPan.add(deckPanel);
    globalPan.add(app.createHorizontalPanel().add(app.createLabel('Element to add to DeckPanel')).setId('visiblePan'));
    var hidden = app.createHidden('hEl', 'visible').setId('hEl').setName('hEl');
    app.add(hidden);
    app.add(app.createButton('Add to DeckPanel').setId('button').addClickHandler(app.createServerHandler('handlerFunction').addCallbackElement(hidden)));
   return app;
}

function handlerFunction(eventInfo) {
    var app = UiApp.getActiveApplication();
    var parameter = eventInfo.parameter;
    var state = parameter.hEl;
    if (state == 'visible'){
        app.getElementById('deck').add(app.getElementById('visiblePan')); 
        app.getElementById("button").setText("Remove from DeckPanel");
        app.getElementById('hEl').setValue('hidden');
    };
    else{
        app.getElementById('deck').remove(0);
        app.getElementById("button").setText("Add to DeckPanel");
        app.getElementById('hEl').setValue('visible'); 
    };
    return app;
}
```




{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:04/02/13', 'FavoriteCount': 2.0, 'PostTypeId': 1, 'Tags': '<google-apps-script>', 'Title': 'How to use Deck Panel of Ui Services', 'ViewCount': 92, 'id': 15772357, 'user_AboutMe': '', 'user_AccountId': 987924.0, 'user_DisplayName': 'alcamla', 'user_Reputation': 424.0, 'user_Views': 23.0, 'user_id': 1005994.0}}