+ Start a Discussion
Rakesh KumarRakesh Kumar 

How can i submit a matix value at Controller(Apex code) using Javascript?

Hi All,

 

I wanna submit below matrix of all white and black circles at Controller side using javascript.

I tried one of code like

var success = sforce.apex.execute("NOV_TargetActionClass","submitStatus",{a:kmsID,b:targetID,c:status});

 

My process

 Firstly i am collecting all circles (white & black) by using javascript and then i would like to submit all those recorde using above javascript method.

But its not working propertly.

 

My Matrix Data will be

 

Target NameKM01KM02KM03KM04KM05
Target 1
  ●   
Target 2
 〇   
Target 3
    ●
Target N 〇   〇 

 

Is there any way to submit my collected value using javascript?

Please share your idea.

 

Thanks in Advance

Rakesh

 

Best Answer chosen by Admin (Salesforce Developers) 
Rakesh KumarRakesh Kumar

 

I have solved my problem so i would like to share my solution..

 

Solution

instead of <apex:actionFunction .. >i just used <input type="hidden" name="paramList" value="" id="jsValue"/>

 

Controller 

 

paramValue = Apexpages.currentPage().getParameters().get('paramList');

 

 

All Answers

Rakesh KumarRakesh Kumar

Hi All,

 

This is my code...

 

Javascript code

 

 function saveMePermanent(){

    return "Please Save me";

}

 

VF Code

<apex:form>

<apex:pageBlock>

<apex:commandButton value="Save" onclick="doControllerSave(saveMePermanent())"/>

 

   <apex:actionFunction action="{!submitStatus}" name="doControllerSave">
       <apex:param assignTo="{!paramValue}" value="" />
   </apex:actionFunction>
   
  </apex:pageBlock>

</apex:form>
</apex:page>

 

Controller

 

  String paramValue{get;set;}
  public pagereference submitStatus(){


   System.debug('submitStatus ****************** ');
   paramValue = Apexpages.currentPage().getParameters().get('paramList');

 

 

   return null;

 

}

 

Problem is that my apex code is also not invoking i dont know where am i Missing.

According to reference book i have written code but <apex:actionFunction ... > is not wokring properly.

 

Is there any idea or clue that i can keep out such problem?

 

Thanks

Rakesh

 

Rakesh KumarRakesh Kumar

 

I have solved my problem so i would like to share my solution..

 

Solution

instead of <apex:actionFunction .. >i just used <input type="hidden" name="paramList" value="" id="jsValue"/>

 

Controller 

 

paramValue = Apexpages.currentPage().getParameters().get('paramList');

 

 

This was selected as the best answer