Changing string options in a combobox - user-interface

I am using andlabs/ui to create a simple GUI which has Combobox.
It seems that it is not possible to remove or change strings options once they have been added to Combobox (through its Append function).
The only functions available seem to be Append, OnSelected, Selected and SetSelected.
Can I change string options already added to combobox in andlabs/ui? Thanks for your help.

Related

LibreOffice Base - How to populate listbox values(not sql/table) from code?

I am toying with Base but am stuck on how to set the ListSource of a ListBox with an array of values rather than data from a query.
Any help would be appreciated.
To add entries manually, edit the form and create a new list box. Right-click on the control and choose Control. At General tab of control properties window, edit List entries property: add the first item, press Shift+Enter, and then add another item.
From How to Programmatically add or remove items in ListBox FORM control, #Lyrl writes:
The listbox array content is clunky; it's actually easier to work with if the form is connected to a Base file and the listbox content is determined by an SQL string.
That page also shows macro code to populate the list with an array of values.
oListBox.StringItemList() = Array("One", "Two", "Three")

Export Dropdown Selection in Kendo Editor to Word Document

I've been trying to get a selected dropdown option to appear in a Word Document on export.
The current default behavior is that all option tags appear in the exported document with no indication of which was selected. (This makes sense that this behavior would occur since the export function is simply exporting all the html as plain text).
So far, these are the approaches I've tried (none of which work):
-Capture the export event before it is sent to the controller via the javascript execute event (thus being able to strip out any unwanted text). The issue is the execute event and exportas event are asynchronous, so I can't modify the file before the export event call is executed.
-Modify the text on the controller side before it is converted to a Word document and downloaded (the text is sent through without special characters, which makes it nearly impossible to parse)
-Attempt to replace the dropdown with a kendo autocomplete widget (this would also be an acceptable solution). The widget does not render properly inside the document. All of the datasource options are there and even filters corretly, but it does not style correctly or open.
Has anyone else been able to find a solution to this problem or have another approach I could use?
EDIT:
As per requested, here is a screenshot of the base code:
My initial idea on how you could accomplish this:
1. Pull that select list out of your editor.
2. Bind an event handler to the change event of your list to add the value of your list into the editor. Are you using JQuery in your project? It's a dependency for Kendo so this ought to work:
$("#selectListId").on("change", function () {
$("#editor").val( $("#selectListId").val());
});
In reality though I'm guessing this approach will be used to populate some template of text with values selected by the user? In that case, you may want to save the template first before applying the value selected.
Now that you've identified you need that dropdown menu to be usable on the exported word document, attempt the following:
Create a new word document.
In that word document, open the Developer tab. (If you don't know about it, google how to enable it)
Insert a new Dropdown Menu Content Control using the Developer tab.
Select this content control, then open Properties menu item on Developer tab.
Update the content control with your values:
Save this word document.
Use the Kendo Editor Import to import this document containing your template.
Attempt exporting what was just imported.
If that works and the editor has editable dropdowns from that content control, I will be very surprised... Good luck!

Xpages valuePicker add value

Is there a way to add a field into the valuePicker with the possibility of adding new values in it? The valuePicker get's the values from a view, and I wouldn't want to add another addButton to add some values withing that view, in separate way. I would like a dialogBox like the valuePicker + the option to add new documents withing it. It is possible?
That functionality isn't available in the Value Picker. It's unlikely to be added, because of the variety of dataProviders, which makes it difficult to know where to add the option to make it available to other documents, and also ensure validation of options.
Typeahead on an Edit Box control allows you to add entries not in the list.
Alternatively, you can add a separate Edit Box to your XPage to include a value not in the list. But if you want to store the new option in the same field, you'll need to write the code to add the option to the source of the list. E.g. if it's the dataProvider of your Value Picker is a dominoViewValuePicker, you'll need to create a document in that view as well; if it's a simpleValuePicker, you'll need to compute the options so they also look to this field. Otherwise, when the user edits the document again, the option will not be available in the list, so may get removed.
Why do you want the user to insert new values into a field in valuePicker? Instead, let the user add the new value direct into the field which is the valuePicker related to.

How to access the data on a dropdown list in excel using WIN32OLE

I want to programatically choose one of the options available in a Excel Dropdownlist.
To manipulate the worksheet I'm using win32ole on ruby.
It works well until I try to change the value of the dropdownlist.
I simply don't know how and google has been of no help.
setting a value to a a cell is as simple as worksheet.Cells(x,y).Value=new_value. This is not choosing one of the alternatives available on the dropdownlist and it's not even possible since the cell in question is protected.
The protection doesn't stop me from changin the value manualy via excelso I figure there must be a method or functon somewhere that allows me to simulate this action aswell.
Help in advance for any suggestions.
EDIT:
I'm trying to choose one of the values available in the dropdown list.
I didn't find an api specific for dropdows, but I manage a work around. The data of the dropdown is somewhere in the workbook. Just choose from them and set it to the dropdown cell with "Cells.Value=new_value".
It was a little different for me since my workbook I was working on had some kind of protected custom dropdown but esencially the solution is realizing that the data of the dropdown can be found somwhere else in the workbook.

How to customize the Combobox dropdown list?

I have created a Combo box using HIComboBoxCreate(). When I have a long string in the dropdown list, it goes beyond the screen and the starting of the string is not visible. I want the string to be truncated with ellipsis in such a case. I have looked into the ComboBox attributes but couldn't find any that I can use to set this. I'm ready to write some extra code to do this, but I'm not sure if it possible. Can someone please help?
Try the HIViewSetTextTruncation function.

Resources