spring mvc remember selected option in drop down - forms

I have a spring mvc form with a drop down and radio button.
I want to redisplay the form for confirmation and the drop down and radio buttons are not retaining the selections in the command object.
The drop down displays all the contents from the list but doesnt show the selected option from the command as 1st option.
Appreciate your help.

use the spring forms tags and set the path attribute to the name of the variable in which you are storing the radio and drop-down selections.

Make sure that you are using form:radiobutton and not form:input type="radio".

Related

How to create a form allowing multiple checkbox selection in Wix?

Does anyone know if there's a possibility to create a form where users can select multiple checkbox options instead of just one? I need users to be able to check multiple boxes. Any help for a newbie would be greatly appreciated.
I know I'm late, but if you're using Wix Forms, you can click on the form, click the plus sign, then click "Selection" in the left column, then click "Multi Checkbox Field" to get checkboxes where users can select more than one. Right now you're probably using Radio Buttons, which are often used as the default in most form templates but only allow for one box to be selected.

TAB key navigation for sap.m.Table

I have some data input fields inside a sap.m.table. Wanted to use Tab key to navigate to the input fields but it doesn't work.
It seems the SAP application interface hasn't implemented this feature.
I tried with some custom function and not working.
Any solution or alternative for this feature?
SAP itself now come up with the solution. Navigation with the TAB key is available form SAPUI5 version 1.44.
SAP NOTE 2387996 - SAPUI5 unable to use Tab to move to next field.
We have to press F2 key to activate this.
It's no longer necessary to use a custom solution for this. As of SAPUI5 version 1.38.0 sap.m.table has a property called 'keyboardMode' that can be set to 'Edit' which will change the tab behaviour to navigate focus through all editable fields in the table.
This mode is suitable if the number of items is limited and if there
are editable fields within the item.
While the last/first interactive element within an item has the focus,
pressing tab/shift+tab moves the focus to the next/previous element in
the tab chain after/before the item .
https://sapui5.hana.ondemand.com/#/api/sap.m.ListKeyboardMode
Attach browser event
new sap.m.Input({
value:"{first}"
}).attachBrowserEvent("keydown",function(oEvent){
if(oEvent.key == 'Tab'){
alert(this);//this reference to input control
//Your logic here
}
})
Sample JSBIN

Tracking form properties besides fields

I have a multi-page form, using a vertical tabs UI, in redux-form, and I'd like to track the current tab selection in the redux-form store.
What's the best way of doing this?
I would track the current tab selection outside of redux-form, but I've integrated redux-form with redux-undo, and I'd really like for undoing a form change to go back to the tab of the modified control.
I tried using a selected redux-form field, but this means that changing the selected tab marks the form as dirty.
From reading the docs, I could probably use reducer.plugin to add arbitrary properties to the redux-form store, but I don't see any documentation of which arbitrary property names are "safe," and I'd have to update the plugin for every form that should behave this way.
Any ideas?

GWT Customize CellList Multi-Selection Model for Mobile Devices

I have an application, that uses the MultiSelectionModel, and it works great, but I need the site I'm developing to work on mobile devices, and so I can't use the keyboard to assist in selecting the elements (since it doesn't exist). EX: On the desktop I just hold ctrl and click on all the element that I want to select.
So on the mobile device, I would like to modify the default behavior of the MultiSelectionModel so that when you click on a CellList item, it toggles the selection state of that item.
I have looked through the source for it and cannot see anyway to implement the behavior that I need. (Mobile MultiSelection).
Whether you add a checkbox column or not, you'll have to add a cell preview handler. The easiest way to define one is to use DefaultSelectionEventManager, either using a checkbox manager in combination with a checkbox column, or creating a custom one (you'd map a click event into a toggle action).
You can see it used, the checkbox variant, in the GWT Showcase; it uses the setSelectionModel overload with two arguments to add the CellPreviewEvent.Handler at the same time.
Just adding an extra checkbox column would be a more user friendly solution.

Display Additional Form on Update - RadGrid

I'm using a RadGrid for changing record status's. Users have the ability to select a status from a dropdown and update that record with that status. Depending on the status chosen, when the user clicks update I want to popup an additional form so the user can fill out more data required for the update. I'm not sure the best way to go about implementing this. Any suggestions are appreciated.
One way is to use the RadWindow like a modal and pop it up to the user via client-side JavaScript. We use RadWindows in our applications and it works. Or, the RadWindow supports a Nested Grid or View that you can have as a record's child; so you can have the master record, click on the arrow on the left and expand the record to view a nested grid of data, or a custom view (via the NestedViewTemplate property). You can also have the form in a DIV, hide it, then show it via JavaScript too.
Those are two ways.
HTH.