On click of apex: command button I have to call method in controller so that I can get values. After calling the apex i have to call an javscript function.
I have used action function to call apex function.
<apex:commandButton value="Save" onclick="saveValuesDetails();" oncomplete="setvalue();" styleClass="buttonWidth"/>
<apex:actionfunction action="{!saveProduct}" name="saveValuesDetails" />
and in javascript I am calling as
function setvalue()
{
var prodId = getParameterByName('product');
alert(prodId);
window.parent.opener.document.getElementById(prodId).value={!oppty.Name};
}
in controller I am having an function
Public saveValuesDetails(){
//here I am initiallizing values.
}
I have to first inititalize my values and the assign it thorough javascript. Please help.