You need to sign in to do that
Don't have an account?

Visualforce PageBlockTable click to get row and then pass to apex:detail subject
Hello! I am trying to display a list of opportunities and when i click on a row of an opportunity i get the full opportunity in apex:detail below the list.
Any help would be appreciated!
Thanks
<apex:page standardController="Opportunity" extensions="opportunityControllerExtension" recordSetVar="opportunities" tabstyle="opportunity" sidebar="false"> <head> <apex:includeScript value="{!URLFOR($Resource.jQuery)}" /> <script type="text/javascript"> $j = jQuery.noConflict(); function clickElem(elem){ var row = parseInt($j(elem).find(".accId").html()); alert(row); $j(elem).find("myString").value = row ; } </script> <apex:variable value="{!0}" var="index" /> </head> <apex:pageBlock > <apex:form > <apex:panelGrid columns="9"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="list"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:panelGrid> <apex:pageBlockTable value="{!opportunities}" var="a" id="list" onRowClick="clickElem(this);"> <apex:column value="{!a.name}"/> <apex:column value="{!a.Created_Date__c}"/> <apex:column value="{!a.Underwriting_Stage__c}"/> <apex:column value="{!a.X0_Credit_Lines_Pre_Approval_Amount__c}"/> <apex:column value="{!a.Total_Paydowns__c}"/> <apex:column value="{!a.Term_Loan_Pre_Approval_Amount__c}"/> <apex:column value="{!a.Date_Signed__c}"/> <apex:column value="{!a.Reasoning_if_Failed_Credit__c}"/> <apex:column styleClass="accId"> <apex:outputText > <apex:variable value="{!index + 1}" var="index" /> {!index} </apex:outputText> </apex:column> </apex:pageBlockTable> </apex:form> <apex:pageBlock > <apex:detail subject="{!opportunities[myString]}" /> </apex:pageBlock> </apex:pageBlock> </apex:page>
Any help would be appreciated!
Thanks
Hi Tolby,
Screenshot :Try this piece of code.
Visualforce page
Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards ,
Suraj
All Answers
Hi Tolby,
Screenshot :Try this piece of code.
Visualforce page
Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards ,
Suraj