How to access specific buttons on a collection view tin 4 buttons and 1 image view - collectionview

I am currently populating a collection view with images but at the same time have some button option.
How can I know which button I press if let's say it populated about 4 of those cells?
How do I make a code to handle that event?

Add actions to each button in your collectionView cell. Or add one action to all of them and set tag for each button. Then in action method
UIButton *btn = (UIButton *)sender;
//btn.superview will be your button parent view (cell for example)

Related

Excel vba detect when any control form is clicked

I have a random number of radio buttons created dynamically according to table data. These buttons are all inside a Frame and each is individually named. What event controller or such do I use in order to detect which button has been clicked? I've put them all into the same 'GroupName'. I've tried groupname_click(), frame1_click(), mousedown_event detect. I'm not sure how to go about this.

Toggle a custom icon on an Action Button on Lotus Notes form

When editing the action button properties, it allows an #if statement to flip/flop two choices (lock/unlock). i.e. #If(enlock=1;"Unlock";"Lock") for the "Label" of the action button.
At the bottom of the Action properties, icons can be None, Notes, or Custom. When I select Custom, I want the #if to use either the Locked/Unlocked Notes icons. (actn084.gif and actn085.gif, respectively) Or numbers #62 (locked) and #(I don't know/can't find, the # for the unlock icon).
I've tried formula with the icon number, like in a view, "display as icons" for view column. Using an #if, I've tried the gif on local and server replica's and it didn't give any results.
Please see the example image below.
Image example: http://i.stack.imgur.com/UBac3.png
You have to add actn084.gif and actn085.gif to Resources/Images.
Then, you can use a formula
#If(enlock=1;"actn085.gif";"actn084.gif")
for calculating icon.
As an alternative, you could create two buttons and hide-when them depending on field enlock. You could assign label and icon direct to buttons without formula then.
The hide formula would be enlock=1 for first button and enlock!=1 for the second. In both buttons you would have to add #Command([RefreshHideFormulas]); at the end of your action formula to refresh the action buttons (or Call uiDoc.RefreshHideFormulas for LotusScript action code).

Menus with multiple item-columns javaFX 8

My goals is to create a menu with multiple columns. I went about this by using GridPane, to which I added Labels. Then I inserted the GridPane in a PopOver. I also added action listeners to Labels So when the users click on a cell, I can do a certain action. My current implementation is based on a button. Once clicked, the PopOver will show up.
As an example, font names:
Is there a way to have this in a menu?
I tried making the MyGridPane class that extends MenuItem. It allows me to add the GridPane to the menu, but it only comes in as an ObjectID. If I want it visually, the only way I found was to
menuItem.setGraphic()
But this make the whole GridPane one item. The cells and their action listeners get ignored.
Is there a way to add a grid pane as a menu item?
Is there a way to add a grid pane as a menu item?
Yes, you can try as
CustomMenuItem menuItem = new CustomMenuItem(gridPane);
menuItem.setHideOnClick(false);
To visually disable the highlight color for that menu/menuitem, customize the related CSS selectors of menu/menuitem.

onclick event of button requires double click

I have a viewPanel using DB2 for the datasource. I have created a comboBox containing all the possible viewPanel columns, a radioGroup to select ASC or DESC, a comboBox containing all the possible viewPanel columns with an onchange event to partially update the values in another comboBox, and a final comboBox that has all the values from DB2 according to the previous comboBox value that has an onchange event to partially update the viewPanel.
The onclick event for my button has this code and does a partial update of the viewPanel:
var sort:String = getComponent('comboBox1').getValue();
var order:String = getComponent('radioGroup1').getValue();
var vp = getComponent('panel_container').getData()[0];
vp.setDefaultOrderBy(sort + " " + order)
The problem is that I have to click the button twice to get the code to actually run. The first click is ensuring the onchange event is fired, then the second click activates the code. I have tried to use Full Update and checking the 'Set partial execution mode' with the partial update.
How do I get the onclick event for my button to work on the first click?
Too much event tango :-) Here is what I would do:
bind your combo boxes to viewScope variables. That's more robust than getValue() and allows to change the UI later (fancy some d&d)
use the combo box client side, not the server side onChange() event. This would require all values to be send down eg via Ajax
when you click the button make sure the fields are inside the panel you refresh
Hope that helps

list box items context menu WPF

I have list box that contains UserControl as item template
the user control contains few text blocks in a grid,
the thing is that I want to add context menu to my user control that will show on the list item right click but currently only right clicking the textbox inside the user control triggers the context menu appearance
clicking the spaces between those textboxes triggers nothing,
any idea about how can I trigger the context menu from the container list box?
Thanks
Eran
From the sounds of it you have set the context menu at the textbox level of the usercontrol.
If you want the context menu to function for the entire user control you would need to set teh contextmenu of the user control at the item template level.

Resources