I have used following the code in my Onclickjavascript(custom button).
I have used two buttons in his pop and I would like to call the apex method from here.So, kindly let me know how to achieve this?
Code:
{!REQUIRESCRIPT('/soap/ajax/26.0/connection.js')}
var j$ = jQuery.noConflict();
var iframe_url = '{!URLFOR("/apex/apexpage")};
var j$modalDialog = j$('<div id="opppopup"></div>')
.html('<div align="center" style="margin-bottom:5px;"><input type="button" value="Save" class="btn" style="width:50px;"/>
<input type="button" value="Update" class="btn" /></div>
<iframe />')
.dialog({
autoOpen: false,
title: 'PDF Preview',
resizable: true,
width: 800,
height: 540,
autoResize: true,
modal: true,
draggable: true
});
Apex method:
Public Class TestMethod(){
Public void Update(){
}
}
How to call the "Update" method when click the button in the above javascript frame code?
<apex:commandButton />
for this instead anHTML
button? Is so you can simply setaction="{!update}"
to call the method. Also is this your controller of your VF page?