Using Collapse hide() breaks the widget

26 views
Skip to first unread message

Manu Botija

unread,
Oct 15, 2013, 2:30:45 PM10/15/13
to gwt-bo...@googlegroups.com
I use an standalone Collapse with no problems for long time. 

<b:Collapse ui:field="collapseReviewDialog" defaultOpen="false">


                        <b:FluidRow>


                                <b:WellForm>


                                        <b:TextArea ui:field="reviewTextArea" height="150px"


                                                width="100%" placeholder="" />


                                        <b:HelpBlock>


                                                <ui:msg description="Helpblock for enter review text box">Enter your review and click send (you


                                                        need to be logged in)</ui:msg>


                                        </b:HelpBlock>


                                        <b:Alert ui:field="saveSuccessAlert" type="SUCCESS"


                                                visible="false" close="false" animation="true"></b:Alert>


                                        <b:SubmitButton ui:field="saveButton">


                                                <ui:msg description="Send button on new review form">Send</ui:msg>


                                        </b:SubmitButton>


                                </b:WellForm>


                        </b:FluidRow>


                </b:Collapse>


I toogle() it using a button.

Just recently I wanted to hide the Collapse whenever I navigated to another place in my application so that the next time I go back to the place where the Collapse is, it would be collapsed (hidden). [Note that by that time the collapse is already instantiated, so the UIBinder annotation defaultOpen="false" is not taken into account].

So I do something as simple as calling myCollapse.hide(); whenever I am navigating away from the place where the collapse is.

But this seems to break the Collapse, since next time I try to toogle() it, it does not get shown. I have verified the changeVisibility function gets called, but it does nothing.

I have a workaround, but it is kind of expensive. Each time I call .hide(); I also call .reconfigure(); But this is not ideal. 

Another possible workaround would be to do

if(isShown()) toogle();

but there is no isShown() on Collapse.

Is there anyother way to do what I need? Thanks!
Reply all
Reply to author
Forward
0 new messages