Hello guys i have written one part of my page and class. here whenever i will click on the jobid i want jobapplicants related to thios jobid should render in the down table. i have given param for that but now if i am clicking nothing is happening it is not going into the method.can anybody suggest me where i went wrong..here is the view

VF Code:

<apex:repeat value="{!jbList }" var="jb">
    <tr class="odd gradeX" >
    <td class="center"><center><apex:commandLink action="{!showJA}" reRender="tb2"><apex:outputText value="{!jb.Name}"><apex:param value="{!jb.id}" assignTo="{!jobid}"/></apex:outputText></apex:commandLink>
<apex:outputPanel id="tb2">
    <apex:pageblockTable value="{!jaList}" var="ja">
        <apex:column headerValue="Applicant ID">
        <apex:outputField value="{!ja.Name}"/>

Apex class:

public List < Job__c> jbList {get;set;}
public List <Job_Applicant__c> jaList{get;set;}
public id jobid {get; set;}

public void showJA(){
   //Integer index = Integer.valueof(Apexpages.currentPage().getParameters().get('indexNum'));
   //index -= 1;
   jaList=[select id,Name,Contact_Talent__c,Action__c
                                                         from Job_Applicant__c where Job__c=:jobid  ];
       //RETURN NULL;

On click jobid you have to call javascript. Use actionfunction to call controller method. See below code.

function ImageOver(ProgImage) {  
    alert("The paragraph was test.src.****"+ProgImage);

<apex:actionFunction name="getstId" action="{!getCoursesModule}" rerender="a">
    <apex:param name="setcorsId" assignTo="{!courseId}" value=""/>
</apex:actionFunction> `

Use variable in your controller public string courseId{get;set;}

  • thanx @rahul srivastava but i am using <apex:repeat> so i cant use <apex:actionFunction > i think because we cant use this inside an iteration component. so what will be a way out any idea? – geek_sfdc May 17 '17 at 11:29

Please see below code :

function coursemod(getmodule) {  

<apex:actionFunction name="getstId" action="{!getCoursesModule}" rerender="a">
    <apex:param name="setcorsId" assignTo="{!courseId}" value=""/>

<apex:repeat var="a" value="{!Courses}"> 
    <apex:outputLabel id="crse" style="font-weight:bold;background-color:#3B9557; width:800px;height=1px;" value="{!a.name}" onclick="coursemod('{!a.Id}')"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.