2
votes

I have a strange problem in Flex. I have a ButtonBar with 7 buttons and always the fifth is invisible. Even when I switch places of buttons always the one which is the fifth is the one I cannot see.

Here is my code:

<s:HGroup x="6" y="6" visible="{entityId > 0}">     
                <mx:ButtonBar height="20" x="10" horizontalGap="4" itemClick="onButtonBarClickHandler(event)" id="buttonBar">
                    <mx:dataProvider>
                        <s:ArrayList>                           
                            <fx:Object label="xxx" action="AddItem" icon="{_addIcon}" />
                            <fx:Object label="zzz" action="DeleteItem" icon="{_deleteIcon}" enabled="{_dg.selectedItem as TemplateFile != null}" />
                            <fx:Object label="yyy" action="Generate" enabled="{_dg.selectedItem.IsTemplate}" />
                            <fx:Object label="aaa" action="PublishSharePoint" enabled="{_dg.selectedItem.IsTemplate}" />
                            <fx:Object label="bbb" action="SetDefault"/>
                            <fx:Object label="Download document" action="DownloadDocument"/>
                            <fx:Object label="Show Tags" action="ShowTags"/>
                        </s:ArrayList>
                    </mx:dataProvider>
                </mx:ButtonBar>

            </s:HGroup>

Do you have any idea what is wrong here?

1
I've copied your code and supplemented the missing code. I can't reproduce it! - splash
I've just noticed that I have also a popup which is also displaying this view and there i can see all buttons. I really don't know why it isn't working on my main screen. - Paweł Reszka
In this case your posted code should not be sufficient to answer your question. - splash
Not a solution, but your code has a bad "smell" to it. Generally, when determining whether a component should be enabled or not is a function delegated to a Presenter/Controller/Supervisor model. - Black Dynamite
You might want to show the code that contains the above HGroup (not in the pop up but in the main app where the button is missing). A screen shot might be useful too: is there an empty space where the missing button is, or does the button bar just contain 1 less button?. Finally, you might want to switch to using a Spark ButtonBar component instead of MX (use: <s:ButtonBar> instead of <mx:ButtonBar> - Sunil D.

1 Answers

0
votes

Tried to reproduce it, no success - they are all visible. My guess is that you have some code that causes it to become invisible.