You need to sign in to do that
Don't have an account?
Thomasm
Display list view for custom object
I am looking to create a visualforce page that will show all the record of a custom object and when you click on the name for the record to ope up. So far i everything is displaying correctly but when i click on the record name nothing happens.
Here is my code
<apex:page standardController="Jobs__c" recordSetVar="jbs" sidebar="false">
<apex:panelGrid columns="1">
<apex:form >
<apex:pageBlock title="Current Accounts">
<apex:pageBlockTable Value="{!jbs}" var="a">
<apex:column >
<apex:commandLink value="{!a.name}" reRender="Out">
<apex:param name="ID" value="{!a.ID}"/>
</apex:commandLink>
</apex:column>
<apex:column value="{!a.name}"/>
<apex:column headerValue="Active" >
<apex:inputField value="{!a.Active__c}"/>
</apex:column>
<apex:Column value="{!a.Job_Number__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
<apex:outputPanel id="out">
<apex:Detail subject="{!$CurrentPage.parameters.id}" relatedlist="false"/>
</apex:outputPanel>
</apex:panelGrid>
</apex:page>
Here is my code
<apex:page standardController="Jobs__c" recordSetVar="jbs" sidebar="false">
<apex:panelGrid columns="1">
<apex:form >
<apex:pageBlock title="Current Accounts">
<apex:pageBlockTable Value="{!jbs}" var="a">
<apex:column >
<apex:commandLink value="{!a.name}" reRender="Out">
<apex:param name="ID" value="{!a.ID}"/>
</apex:commandLink>
</apex:column>
<apex:column value="{!a.name}"/>
<apex:column headerValue="Active" >
<apex:inputField value="{!a.Active__c}"/>
</apex:column>
<apex:Column value="{!a.Job_Number__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
<apex:outputPanel id="out">
<apex:Detail subject="{!$CurrentPage.parameters.id}" relatedlist="false"/>
</apex:outputPanel>
</apex:panelGrid>
</apex:page>
<apex:page standardController="Jobs__c" recordSetVar="jbs" sidebar="false">
<apex:form >
<apex:pageBlock title="Current Jobs">
<apex:pageBlockSection >
<apex:pageBlockTable Value="{!jbs}" var="a" id="List">
<apex:column >
<apex:outputlink value="/{!a.id}">{!a.name} </apex:outputlink>
</apex:column>
<apex:column headerValue="Active" >
<apex:inputField value="{!a.Active__c}"/>
</apex:column>
<apex:Column value="{!a.Job_Number__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
All Answers
Change:
<apex:param name="ID" value="{!a.ID}"/>
To:
<apex:param name="jobid" value="{!a.id}"/>
Change:
<apex:Detail subject="{!$CurrentPage.parameters.id}" relatedlist="false"/>
To:
<apex:Detail subject="{!$CurrentPage.parameters.jobid}" relatedlist="false"/>
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks
<apex:commandLink value= "View" reRender="Out">
<apex:param name="ID" value="{!a.ID}"/>
</apex:commandLink>
<apex:page standardController="Jobs__c" recordSetVar="jbs" sidebar="false">
<apex:form >
<apex:pageBlock title="Current Jobs">
<apex:pageBlockSection >
<apex:pageBlockTable Value="{!jbs}" var="a" id="List">
<apex:column >
<apex:outputlink value="/{!a.id}">{!a.name} </apex:outputlink>
</apex:column>
<apex:column headerValue="Active" >
<apex:inputField value="{!a.Active__c}"/>
</apex:column>
<apex:Column value="{!a.Job_Number__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>