You need to sign in to do that
Don't have an account?

How to use datastructure in following method?
I have written following javascript function for some processing.
In js method have more than 15 parameters to pass to Controller using Saveaccount actionFunction.
<apex:actionFunction name="Saveaccount" action="{!createSavedSearch}" ">
<apex:param assignTo="{!text1}" value=""/>
.
.
.
.
.
.
<apex:param assignTo="{!text15}" value=""/>
</apex:actionFunction>
function save(){
Saveaccount($('.text1').html().replace('%',''),$('.text2').html().replace('%',''),$('.text3').html().replace(/[^\d]/g,''),$('.text4').html().replace(/[^\d]/g,''),
$('.text5').html().replace('x',''),$('.text6').html().replace('x',''), $('.text7').html(),$('.text8').html(),$('.text9').html().replace('%',''),
$('.text10').html().replace('%',''),$('.text11').html(),$('.text12').html(),$('.text13').html(),$('.text14').html(),$('#text15').val()
);
}
How to use data structure - a map (hash), a JS object, or a custom class in above save method?
How to improve this action function and it's associated JS and Apex code, calling it with one parameter?
Hi,
Try grouping the parameters of the method in an apex class:
And in JavaScript populate a dictionary with the wrapper fields:
Regards,
Kresimir
Apex Editor LS - free alternative to Force.com apex editor.
Give kudos (click blue star under my icon) if this was useful