• TharunKumar Chada
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Controller
public class PosAppController {

    public Id selectedposition{get;set;}
    
    public List<Job_Application__c> AppplicationDetails{get;set;}

    public List<Job_Position__c> getMypositions() {
    
        return [SELECT id,Name FROM Job_Position__c];
    }
    
    public void PositionClicked(){
    
      AppplicationDetails = [SELECT Name FROM  Job_Application__c WHERE Job_Position__c.Id = :selectedposition]; //showing error when trying to match the id 
    }

}
VisualForce Page
<apex:page controller="MyController">
  <apex:form >
    <apex:dataList value="{!myaccounts}" var="acct">
       <apex:commandLink action="{!accountclicked}" reRender="ContactDetail">
       <apex:outputText value="{!acct.name}">
       </apex:outputText>
       <apex:param name="id" value="{!acct.id}" assignTo="{!selectedAccount}"/>
       </apex:commandLink>
    </apex:dataList>
    <apex:outputPanel id="ContactDetail">
       <apex:repeat value="{!contactsInformation}" var="contact">
         <p> {!Contact.FirstName & ' ' & Contact.LastName} </p>
       
       </apex:repeat>
    </apex:outputPanel>
  </apex:form>
</apex:page>

I need to show up the job positions names on the page and clicking on each position should show up the job application names related to that position and the relationship between position and application is look-up
Controller
public class PosAppController {

    public Id selectedposition{get;set;}
    
    public List<Job_Application__c> AppplicationDetails{get;set;}

    public List<Job_Position__c> getMypositions() {
    
        return [SELECT id,Name FROM Job_Position__c];
    }
    
    public void PositionClicked(){
    
      AppplicationDetails = [SELECT Name FROM  Job_Application__c WHERE Job_Position__c.Id = :selectedposition]; //showing error when trying to match the id 
    }

}
VisualForce Page
<apex:page controller="MyController">
  <apex:form >
    <apex:dataList value="{!myaccounts}" var="acct">
       <apex:commandLink action="{!accountclicked}" reRender="ContactDetail">
       <apex:outputText value="{!acct.name}">
       </apex:outputText>
       <apex:param name="id" value="{!acct.id}" assignTo="{!selectedAccount}"/>
       </apex:commandLink>
    </apex:dataList>
    <apex:outputPanel id="ContactDetail">
       <apex:repeat value="{!contactsInformation}" var="contact">
         <p> {!Contact.FirstName & ' ' & Contact.LastName} </p>
       
       </apex:repeat>
    </apex:outputPanel>
  </apex:form>
</apex:page>

I need to show up the job positions names on the page and clicking on each position should show up the job application names related to that position and the relationship between position and application is look-up