How to implement a confirmation java alert dialog

Hi,

In a portlet, Is there way to display a java script confirmation dialogue to alert the user and take confirmation from him and then proceed with the command action [i,.e action specified on a command button, link, icon] ?

Thanks in advance
Sudheer

Hello,

suppose you want to check the field Name. in the JSP you have your portlet controller Tag :

<portlet:controller name=“MyForm” context=“form” method=“validate” displayErrors=“false”>

  • validate is the PCAmethod (the action if you want)
  • checkMyForm is a Java script function that receive MyForm in argument, display an alert message and return False if the field MyForm.Name is empty.

best regards.
omar.</portlet:controller>

Hello,

suppose you want to check the field Name. in the JSP you have your portlet controller Tag :

portlet:controller name=“MyForm” context=‘form’ method=‘validate’ onSubmit=‘return checkMyForm(this)’ displayErrors=‘false’

  • validate is the PCAmethod (the action if you want)

  • checkMyForm is a Java script function that receive MyForm in argument,

If you are using webMethods CAF 7.x then the common way of implementing it would be to use toogle button and confirmation modal dialog.

Toogle button does not invoke action, instead it displays dialog. The dialog then contains a command button which invokes your action and cancel button which simply hides the dialog

Alex

Alex, we tried that, but using a toggle link aligns the buttons improperly if an image is used inside a toggle link.

You could always use a CAF javascript model to toogle any control you want. E.g. you may have just an image on the page with onClick() handler and call toogle javascript from this onClick() handler:

CAF.Model(’#{PageBean.clientIds[“popupDialogID”]}’).toogle();

For more information about CAF javascript model please look at:

http://www.ajax-softwareag.com/articles/3IE5OA/wm_cafshared-doc-7.1.1/wm_cafshared-doc-7.1.1/overview-summary.html

Alex