Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
// This function displays an options list for the user to choose from the available options.
this.fm.registerHandler("cbxclick", "LIST_POPUP", 
                        function (fm, event, fieldName, value) 
						{
            				var config = 
							{
                				title: "Select a Loan",
								items: 
								[{
                        			text: "Personal Loan",
									value: "personal loan"
                    			 },
								 {
                        			text: "Home Loan",
									value: "home loan"
                    			 },
								 {
                        			text: "Four-wheeler Loan",
									value: "fourwheeler loan"
                    			 },
								 {
                        			text: "Gold Loan",
									value: "gold loan"
                    			 },
                    			 {
                        			text: "Two-wheeler Loan",
									value: "twowheeler loan"
                    			 }],
								
								selectedValue: "fourwheeler loan",
								doneButtonLabel: "Done",
								cancelButtonLabel: "Cancel"
            				};
            				canvas.env.listPicker.showPicker(config, ListPickerSuccess, ListPickerError);
});

// This function is called when a value from the options list is successfully selected.
function ListPickerSuccess(item) 
{
    showAlert("You have selected " + item);
}

// This function is called when a value from the options list is not selected.
function ListPickerError(err) 
{
    showAlert("You have cancelled");
}

...