I found a control that displays a CheckedListBox for the dropdown of a combobox. I like this but I want to improve upon it. I want to perfectly replicate the behavior of the standard combobox like so:
When the user clicks the combobox the dropdown (CheckedListBox) opens.
When the user clicks inside the dropdown they have no problem checking multiple options.
When the user clicks the ComboBox again the DropDown hides.
When the user clicks off the combobox (ANYWHERE, be it on a control or just the form), the DropDown gets hidden.
I found on P/Invoke.net the PostMessage function in the User32.DLL library that allows you to send a message to the ComboBox using the CB_SHOWDROPDOWN (0x014F) message to force it to immediately close the native DropDown.
The problem in doing so is that it will automatically force call the OnDropDownClosed function of the base ComboBox control. This I would not care about but it stops the natural feeling of the control (for me at least) in that if you do some trickery with it to keep your custom dropdown open, it still stays open when you click off the control (because the ComboBox thinks it's dropdown is closed already).
That is the behavior I want to avoid. I want the ComboBox to think that it's DropDown is still open when it's not (until the user either clicks the combobox to close it or clicks off the control).
Also, the problem I was experiencing before just letting it open the native combobox dropdown was that when I went to click on the custom dropdown, the ComboBox fires the OnDropDownClosed function and (seeing as how I override that method to hide the custom dropdown), my dropdown is hidden.
So...
How do I override the OnDropDown method to open up a custom custom dropdown that, when clicked, will not fire the OnDropDownClosed method, I guess, is the short way of asking the question.
Related
how can I establish a partial refresh after I select the OK button in the xe:namePicker control ?
I only have the for property which does copy the selected value in the assigned field.
The onchange event for that field does not always seem to recognize the value change.
Instead of an Edit Box, I would recommend using Dojo Name Text Box, as covered here. It avoids the need for validation - with an Edit Box even though you provide a Name Picker, users can still enter values manually and can edit them after selecting from the name Picker. The Dojo Name Text Box and Dojo List Text Box are the only controls I use with pickers and almost always use onChange with them, without issue.
One caveat is that the Events tab defaults to onClick. On more than one occasion I've coded onClick instead of onChange, but it's easily identifiable and rectifiable.
I want to be able to Click on one Checkbox on Excel VBA that is able to Click on 5 other Checkbox's. My scenario is I want to create a table that shows 5 types of Data, what I want to accomplish is to create a Checkbox that clicks all of these other checkbox's, and therefore loads all data without the user having to check all 5 of these other Checkbox's. I want this checkbox to also be ticked if the user has ticked all 5 other options, and when the user has clicked then unclicked this Checkbox, for all the options to unselect itself. Hope someone can help?
inside the main check box click function add the oleobjects.object.value property
sub checkbox1_click()
activeworkbook.sheets(1).oleobjects("checkbox_2").object.value=true
end sub
you can add more check boxes in a similar way....so whenever the main check box (checkbox 1 ) is enabled all other checkboxes within the checkbox sub will also be enabled
I am trying to make a 2nd djFilteringSelect using a #Dbcolumn depending on the value selected in the 1st djFilteringSelect control. That's a common task, using a partial refresh. However, each of the controls is within a dialog control from the extension library. One dialog pops up, the user selects a value, and automatically the 1st dialog closes and the 2nd opens. YOU CAN'T SEEM TO REFRESH THE FIELD (I'm guessing b/c it's not in the DOM). I've tried writing the first value to to an computed field and/or a text box on the main Xpage using CSJS and then looking for that value for the second lookup. Also, tried with SSJS, etc. I tried do updates and writing to fields on either the onChange or on the click of button. How do I go about using the selected value of the first to do the lookup in the 2nd?
You can use a single dialog control where you hide and show the relevant controls. I am using this approach in several apps.
I have a button that calls a Dialog that has a combo box bound to a sessionScope variable. The combo box contains a list of form names that I use to then call an XPage to create a new document. The first value in the forms list is "" so the user needs to select a value. I have a button with the onClick event of:
var c = getComponent("CreateDocDialog");
sessionScope.put("ssSelectedForm","")
c.show();
I have the button and dialog on a customControl with a repeatControl and when the button to open the dialog is clicked the ssSelectedForm is null and the current value of the combo is blank, which is exactly what I want it to be. However, if I add the same button and dialog to a customControl with a dataView control the dialog displays but ssSelectedForm is not null so the combo box displays the last value of ssSelected. I have placed the button outside the dataView, in several of the facets on the dataview, but all with the same results.
Very confusing.
Bill,
I am going to answer the same as my comment since I am pretty confident about what I said.
Go ahead and change the scope from sessionScope to viewScope. I had a similar issue once, and I 'fixed' it by clearing out the sessionScope variable after I used it. This worked, but I realized that it was not necessary, and that by changing to viewScope the lifecycle will be shorter and there was no need to clear out the value when I was done with it.
I don't know why this fails when added to the data view, but if this fixes it that would be all that matters.
I would like to create a dialog box or message box in excel WITH custom button labels i.e. FIRST and SECOND. I would like for this box to open up when the file is first opened...and doesn't allow user access to the worksheet until they select either FIRST or SECOND.
I can make a form, but I would rather not add a form since this should be simple... I remember doing something very similar back in the VB6 days, but that has been sometime.
The MsgBox function does not support different names (than the given ones) for the buttons, and neither the InputBox method or function will allow you to change the button names.
You'll have to make a simple form.