I don't think you need the ButtonGroup stuff in there at all.  When you
put something in a button group, it is expecting that one of the group
will always be selected, and since you only have one in each group, that
one will always be selected!  Try it without the groups and see what you
get.

~Roger Whitcomb

-----Original Message-----
From: pavan vadavalli [mailto:[email protected]] 
Sent: Wednesday, September 26, 2012 3:36 AM
To: [email protected]
Subject: Context Menu with Multiple Selections

Hi,
I want to create a control like attached. Basically a context Menu with
Multiple Items that can be selected and deselected.

when the following Menu Section is created (basically a lift from
Context menu example from Kitchen Sink), i am able to have each Button
as individual selectable items, but once the option is selected, the
option doesn't switch off.
I tried to listen to the butttonPressListner and wanted to toggle
selected State, but all through the listen events i always got Selected
as true.

I see that something similar is done in the List box with  multiple Need
quick help, Please.


<Menu.Section xmlns:bxml="http://pivot.apache.org/bxml";
     xmlns="org.apache.pivot.wtk">
     <bxml:define>
         <ButtonGroup bxml:id="imageMenuGroup"/>
     </bxml:define>
     <bxml:define>
         <ButtonGroup bxml:id="imageMenuGroup1"/>
     </bxml:define>
      <bxml:define>
         <ButtonGroup bxml:id="imageMenuGroup2"/>
     </bxml:define>
<!-- $imageMenuGroup -->
     <Menu.Item  bxml:id="button1" buttonData="IMG_0725_2.jpg" 
toggleButton="true"
         buttonGroup="$imageMenuGroup" action="selectImageAction">
         <userData image="IMG_0725_2.jpg"/>
     </Menu.Item>
     <Menu.Item  bxml:id="button2" buttonData="IMG_0735_2.jpg" 
toggleButton="true"
         buttonGroup="$imageMenuGroup1" action="selectImageAction">
         <userData image="IMG_0735_2.jpg"/>
     </Menu.Item>
     <Menu.Item  bxml:id="button3" buttonData="IMG_0767_2.jpg" 
toggleButton="true"
         buttonGroup="$imageMenuGroup2" action="selectImageAction">
         <userData image="IMG_0767_2.jpg"/>
     </Menu.Item>
</Menu.Section>

Thanks and Regards,
Pavan

Reply via email to