You need to sign in to do that
Don't have an account?
csbaa
dialog box from vf page
Hello Helpers
I would like to display a popup dialog box from inside the Visual force page After the action method is finished at the controller side. the diualog Box should display a simple message something like "operation succesfull"
<apex:commandButton action="{!FunctionFromapexcontroller}" "/>
I know how to diplay message boxes using Javascipt onclick() evewnt handler but these messages fire before the
action method starts
I need a message after the method in controller finish
any suggestions are welcommed
Thanks in advancs
csaba
Ok, In that case what may work is to use the oncomplete event to call a javascript function inside an apex:outputpanel which is re-rendered when the command button is clicked. Use a property alertMessage{get; private set} in your controller which holds the message. Set the message in your FunctionFromController Ex.
<apex:outputPanel id="ScriptPanel">
<script type="text/javascript">
function alertStatus(){
alert({!alertMessage});
}
</script>
<apex:commandButton action="{!FunctionFromapexcontroller}" oncomplete="javascript:alertStatus();" reRender="ScriptPanel"/>
All Answers
Hi,
You can add an alert('Message'); to the oncomplete event. Ex.
<apex:commandButton action="{!FunctionFromapexcontroller}" oncomplete="alert('operation succesfull')" />
Hope this helps!
My problem is that the popup dialog box should display a message returned by the method from the apex controller. Or should display a string member property of the controller class set by the apex method
Sent from my iPad
Ok, In that case what may work is to use the oncomplete event to call a javascript function inside an apex:outputpanel which is re-rendered when the command button is clicked. Use a property alertMessage{get; private set} in your controller which holds the message. Set the message in your FunctionFromController Ex.
<apex:outputPanel id="ScriptPanel">
<script type="text/javascript">
function alertStatus(){
alert({!alertMessage});
}
</script>
<apex:commandButton action="{!FunctionFromapexcontroller}" oncomplete="javascript:alertStatus();" reRender="ScriptPanel"/>