Orbeon forms - get dropdown's label - orbeon

example form:
https://demo.orbeon.com/demo/fr/orbeon/builder/edit/f44c7d78e5c9e76ec00df2bf9bdcf63d3b708c76
I'm trying to get dropdown label value. I was able to get label value (by attribute #label) from dynamic dropdown when 'Service performs search' is set to Yes. But when 'Service performs search' is set to No or when I use static dropdown I was unable to get label value.
Is it possible to get label value in other cases?

If you had a regular dropdown, you would use the xxf:itemset() function. That function returns XML or JSON that represents all the choices, with the selected choice marked as such. For more on this, see the doc on xxf:itemset(). So you could do something like:
xxf:itemset(
'my-dropdown',
'xml',
true()
)/itemset/choices/item[#selected = 'true']/value
But currently, xxf:itemset() doesn't work with XBL controls, and the Dropdowns with search are XBL controls. This is covered by request for enhancement #768.

Related

In Orbeon xform, How to get selected drop-down label on change of drop-down in a input field

In Orbeon xform, how to get selected drop-down label on change of drop-down in an input field.
I am able to get drop-down value but not it's label name. Please share ideas about how to obtain it.
To access the label, you need to use an Orbeon extension function, xxf:itemset(), which returns the current itemset for a given selection control. For instance, if your control id is my-select, you would call:
xxf:itemset('my-select', 'xml', true())/itemset/choices/item[#selected = 'true']/label

Getting value from a text field when button is clicked using aspnet mvc Razor in ext.net

I'm having some issues referencing a component to get its value. I have a simple form with a numberfield and a button. To test I just want to output the value of the numberfield when the button is clicked
I have a basic js function
var saveNewSats = function (component) {
console.log(component.getValue());
};
In razor I wire it together like this
X.Button()
.Text("Save")
.Listeners(l => l.Click.Handler = "saveNewSats(#{newSatsField});")
Where newSatsField is the html id of the numberfield. I tried to reference the field in multiple ways like App.newSatsField, but no luck. What is the correct syntax to get the value from the numberfield?
Best regards
So I found the solution.
I did set the InputId which renders the html id attribute. What I needed was to set the ID as this is the one referenced by ext.net. Now both the #{id} and Ext.Cmp syntax works as expected.

how to populate values in listbox based on value entered in textbox in BIRT?

I want to populate values in a list box based on a value entered in textbox. It cant be aceived through cascading paramters as all parameters in Cascading parameters are List Boxes. But my requirement is to populate values inside a ListBox based on the value entered inside a textbox. Please help.
Cascading parameter is the only way to define a dependency between two parameters. As you can see, the birt web viewer displays a textbox just below each combobox, and a radio button to select if we fill each list parameter from the combobox or the textbox:
I know some users had exactly the same requirement, and have successfully modified "ComboBoxParametersFragments.jsp" to display only the textbox when it is needed. For example we can use a specific prefix in the parameter name, or a user property, so that we can decide in the JSP if we hide the combobox or not.

Asp.NET MVC 2 dynamic editor template based on dropdown value

I am working on a model criteria builder. I have a dropdown list with all of the model properties, a dropdown list with static operators (less than, equals, like, etc) and a user input form element for the value. The issue is that the form element type (dropdown, date, text box, etc) for the user input value needs to be based on the data type of the model property chosen in the first dropdown list. What is the best way to achieve this using MVC 2? Ideally I would like to just create an Html extension method and use it like Html.CriteriaFilterFor(model => model) and be able to customize the display using model attributes and metadata.
You should use JQuery to populate the other one. An AJAX call would allow you to pull the second drop down's list. Populating Dropdownlist Using MVC2 Based On Another Dropdownlist (Cascading DropDownList)

String[] vs Integer[] in Struts2 action attribute

I am new t struts2. i built one page, that shows list of employees. I can seach the employes based on his name by applying filter criteria and click on find button. At the same time, i provided check box in the left side for each employee name for delete operation. for all checkboxes, i gave Integer[] attribute name which is declared in Custom Actionclass.deleteaction is working fine. But when i click Find button the action is not getting submitted. Then i changed Integer[] to String[] both functions are working fine. What will be the problem? is it something like, attributes should only be String type.
The cause of your problem is that the Struts2 checkbox sets a boolean property on the action class:
Struts 2 Form Tags: Checkbox
When you defined the checkboxes as an Integers, the framework couldn't covert the boolean to an Integer. However it was able to convert the boolean to Strings. If you check the results in your action class, you should see the String[] populated with "true" and "false".
In general Struts2 is pretty good at converting submitted form data to whatever object type you want. Check out the docs on type conversion for more info.

Resources