function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chuckwalleychuckwalley 

Rendering a list with an object

I'm working wtih a previously developed and customized VF Opportunity page, which has a tabbed interface. My goal is to add a tab which replicate the process that allows a user to see the shares associated with an Opportunity. The catch is, the OpportunityShare has a field called UserOrGroupId, which requires a little more logic than just grabbing the name associated with the ID. 

 

Therefore, I'm trying to present a list of shares containing the Derived Name along with the AccessLevel and RowCause coming directly from a query. 

 

To capture the name, I created a list, along with a getter method to populate it. I have a separate getter method to populate the OpportunityShare info. 

 

The Apex side seems to be working fine, returning both lists. However, I'm having a problem finding a way to mix the two. I've resorted to using the <apex:repeat> component, but cannot do so because it is within a pageBlock. 

 

 

<apex:tab label="Who can see this opportunity" style="background-color:white; border-top-color:#DDB929; vertical-align: middle;">

	<apex:pageblock id="OpportunityShares" mode="maindetail">
		<apex:pageblockbuttons location="Top">

			<apex:commandButton action="{!YabaDabaDo}" value="Yaba Daba Doo"/>

		</apex:pageblockbuttons>

		<apex:pageBlockSection columns="1" Title="Opportunity Shares" collapsible="false">
			<apex:outputpanel rendered="{!OpportunityShares.size=0}" layout="block" style="border: 1px solid #D4DADC; padding: 5px 2px 4px 5px;">
				<apex:outputtext value="No records to display"/>
			</apex:outputpanel>

			<apex:pageblockTable value="{!OpportunityShares}" var="os" rendered="{!OpportunityShares.size>0}">

				<!-- 
				<apex:column headerValue="Action" width="30px">
					<b>
						<apex:outputLink value="{!URLFOR($Action.OpportunityShare.Delete, os.id, [retURL=URLFOR($Action.Opportunity.View, opportunity.Id)], true)}">Delete</apex:outputLink>

					</b>
				</apex:column>
				-->
                
				<apex:column headerValue="Person or Group ID" >
					<apex:outputtext value="{!os.UserOrGroupId}" />  
				</apex:column>
				
				
				<apex:repeat value="{!ListOfRealNames}" var="theName" id="allNames" />
				<apex:column headerValue="Name" >
   				   <apex:outputtext value="{!ListOfRealNames[0]}" id="oneName" />  
				</apex:column>				
             
                
				<apex:column headerValue="Access Level" >
					<apex:outputtext value="{!os.OpportunityAccessLevel}"/>
				</apex:column>

				<apex:column headerValue="Reason" >
					<apex:outputtext value="{!os.RowCause}"/>
				</apex:column>

			</apex:pageblockTable>
		</apex:pageBlockSection>

</apex:pageblock>
</apex:tab>

 

ListOfNames is the area in which I'm stummped. I do know I'm getting the entire list back -- I just don't know how to output the darn items. 

 

Am I pointed in the right direction or just flapping in the wind? Can I mix the two lists in this way and if so, can you please provide a clue to the stumped. 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
chuckwalleychuckwalley

Nevermind... 

 

/p/share/OppSharingDetail?parentId= -- this will get the sharelist.