0

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>
    </center></td></tr>
</apex:repeat>
<apex:outputPanel id="tb2">
    <apex:pageblockTable value="{!jaList}" var="ja">
        <apex:column headerValue="Applicant ID">
        <apex:outputField value="{!ja.Name}"/>
        </apex:column>
    </apex:pageblockTable>
 </apex:outputPanel>

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;
   system.debug('enterred');
   jaList=[select id,Name,Contact_Talent__c,Action__c
                                                         from Job_Applicant__c where Job__c=:jobid  ];
   system.debug('showjobid++++'+jobid);
       //RETURN NULL;
}

2 Answers 2

0

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);
    getstId(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;}

1
  • 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, 2017 at 11:29
0

Please see below code :

function coursemod(getmodule) {  
    getstId(getmodule);
}                                                                                                  

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

<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}')"/>
</apex:repeat>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .