Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSF h:selectOneMenu onchange() event issue

804987Mar 16 2009
Hi All,

First of all i would like to thank you for your previous valuable suggestions. Currently iam working on a JSF page where i need to open a popup message if the user changes value in a dropdown list box. And if the user clicks ok in the confirm window, we need to submit the form, and if he clicks Cancel we need to retain on the same page.

My code is as follows.
----------------------------------
<h:selectOneMenu id="deductibleType" onchange="javascript:onChangeDeductibleType();" value="#propertyCoverageBBean.propertyCoverageView.deductibleType}" >
<f:selectItems value="#{propertyCoverageBBean.deductibleAmountList}"/>
</h:selectOneMenu>

function onChangeDeductibleType() {
if (!confirm('Deductible - Are you sure you want to change the deductible?')
{
return;
} else {
document.forms[0].submit();
}
}

I am able to get the confirm window popup....but when i clicked on 'Ok', nothing is happening and control remains on the same page. Could anyone please help me out on this.

Thanks
vijay
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2009
Added on Mar 16 2009
0 comments
722 views