ZK BindComposer value set programmatically not applied while retrieving - binding

I am using zk BindComposer for form binding. I have a combobox to which I set value programmatically . When I retrieve the value it's null. How to refreshing programmatically set value while using bindcomposer?
<div apply="org.zkoss.bind.BindComposer"
viewModel="#id('vm') #init('in_raster_hms.formCtrl.patient.PatientViewModel')"form="#id('patient') #load(vm.patient) ">
<combobox id="comboCity" selectedItem="#bind(patient.city)" ></combobox>
Controller:
comboCity.setSelectedIndex(2);
I set selected item programmatically. When I retrieve patient object from binder the value of comboCity is null. I think the combobox selection to be reload.
If I choose from combo manually it works fine.

Related

How to access and control a checkbox that's inside a style?

I have a style for list box items which contains a checkbox. For every list box item, there is a property called isChecked that I can read and write to just fine, but it does not influence the checkbox in the style. Any idea how to make the checkbox synchronize with the isChecked property?
Here's the style structure:
Just found out list box contains a boolean property named "ShowCheckboxes"...

Value from dropdown on IconTabBar empty

change view (XML) contains IconTabBar with 3 IconTabFilters, which contain input controls (input, combobox, datePicker...). These input controls have pre-filled value from OData model. On the bottom of the view is button "Save". When I click on "Save" button, in my "onSave" function I am reading values from input controls from all IconTabFilters, but only values from the input controls on the first IconTabFilter are filled. Values from the rest of the fields are empty.
When I click on all IconTabFilters (without changing values), click "Save", then I'm getting all values correctly.
Please what I'm doing wrong? Odata model contains all required values, and also IconTabFilters contain all required values. But I can't read them from input controls before clicking on all IconTabFilters.
The Controls on the tabs only get initiated when they have to be displayed. This is done to improve the felt performance of the UI.
Since you are already using model binding, you should take the values out of the model instead of the input fields.

How to handle listbox(asp control) in Jmeter

I have a listbox control and dynamically populated values within that. On selecting a value from listbox and clicking a button, the selected value from listbox will be set in one or more textboxes.
In Jmeter, the selected list box value is not set and button action doesnt proceed further.It leads to error page.
Could someone please help me in handling this.
Attaching the screenshots for the same
Listbox with values
Selected value set in the sampler during recording

how to get all selected row key values using checkbox selection of devexpress gridview in mvc in javascript

I am using devexpress gridview in mvc with checkboxes. I want all selected checkbox key values of gridview to controller when i am selecting some checkboxes with paging in gridview
Use recommendations from the How to get all GridView selected keys and pass them to a Controller sample.
Key values of all selected checkboxes in the gridview can be retrieved by iterating though all the rows of gridview one by one using a simple loop and checking if the checkbox is selected or not. If yes you can retrieve key value of that row using built in functions(sorry i don't remember the function name, that you need to look yourself) and save the retrieved values in an array. These values can then be passed on to controller. Remember, everytime you check/uncheck even one box you still need to iterate all rows again. Hope it would solve your problem.

Using WPF combobox ,datatable, mvvm

I have very simple scenario ,
I have WPF Combo , i am using MVVM , i am assigning a datatable as a datasource to this WPF combo, i am able to assign , able to view data but not sure how to get the selecteditem in my viewmodel layer, i dont want to pollute my UI codebehind .
Thanks in advance for your help
You can create a SelectedDataRow property on your ViewModel and bind the SelectedItem of your Combo to that property on your ViewModel.
This property will be updated when your selected item of the combobox changes and as an extra you can change the selection of your combobox from the ViewModel by changing the SelectedDataRow property.
Make sure that your property raises the PropertyChanged event of your ViewModel

Resources