You need to sign in to do that
Don't have an account?
Rustyboy
select list warning based on option selected
I have a SelectList which contains a list of user actions (replaces the need for multiple buttons). I have successfully implemented AcionSupport to invoke an Apex call, but I want to issue a "confirm" dialog on 2 of the actions in the list. My JS skills are very primitive, so I suspect this is not really a difficult task.
Here is my VF code excerpt:
<apex:selectList id="nextAction" value="{!nextAction}" size="1"
I want to put an "onchange" event on the selectList which passes the selected option to a JS script which checks the action and optionally displays a confirm warning.
Any help greatly appreciated
Here is my VF code excerpt:
<apex:selectList id="nextAction" value="{!nextAction}" size="1"
Title="Select the next action">
<apex:selectOptions value="{!nextActionList}"></apex:selectOptions>
<apex:actionSupport event="onchange" action="{!doNextAction}" />
</apex:selectList><apex:actionSupport event="onchange" action="{!doNextAction}" />
I want to put an "onchange" event on the selectList which passes the selected option to a JS script which checks the action and optionally displays a confirm warning.
Any help greatly appreciated
Note that it doesn't do an action:support. Instead, we define an actionFunction, which (behind the scenes) creates a JavaScript function named doSave() which, when called, invokes the controller's save() action.
The onChange attribute on the selectList defines a JavaScript function that gets called when the user changes the selectList's value. The function checks the new value, and decides whether to call doSave()
Is that close enough to what you're looking to do?
All Answers
Note that it doesn't do an action:support. Instead, we define an actionFunction, which (behind the scenes) creates a JavaScript function named doSave() which, when called, invokes the controller's save() action.
The onChange attribute on the selectList defines a JavaScript function that gets called when the user changes the selectList's value. The function checks the new value, and decides whether to call doSave()
Is that close enough to what you're looking to do?