0

In one of my requirements I am populating a table with values from an apex controller. The values are being populated with the help of a list. The first column contains a link and when clicked an alert has to pop up wit the message and who the record is assigned to.

In the table assigned to value is displayed correctly. But when i use the same list to get the assigned to value to display in the alert only the id is displayed.

Can anyone tell me how to change the id to Name?

<apex:pageblockTable value="{!View.listOfRequestView}" var="RequestQ" rows="20" onRowClick="clickElem(this);" >
    <apex:column headerValue="WR #" >
       <apex:commandLink action="{!DetailPage}" onclick="return confirm - {!RequestQ[View.listOfFields[1]]}');" 
            <apex:param assignTo="{!RequestId}" name="IdPass" value="{!RequestQ.Id}"/>               
        </apex:commandLink>                  
    </apex:column>    
    <apex:column value="{!RequestQ[View.listOfFields[0]]}"  rendered="{!View.listOfColumnFlag[0]}" headerValue="{!View.listOfFieldLabel[0]}"/>
    <apex:column value="{!RequestQ[View.listOfFields[1]]}"  rendered="{!View.listOfColumnFlag[1]}" headerValue="{!View.listOfFieldLabel[1]}" />
</apex:pageblockTable>
7
  • 1
    Share your VF page and controller .
    – Mahmood
    Dec 10, 2014 at 12:08
  • Share your controller as well.
    – Mahmood
    Dec 10, 2014 at 12:33
  • Is the VF page working? You are using View.listOfRequestView as the collection for the table and Request to represent individual item/record in that collection. But you are not really using that variable in any place? Plz share your controller as well, it will save both of us time.
    – Mahmood
    Dec 10, 2014 at 12:43
  • I think there are some flaws in your logic, kindly read this article and associated pageblocktable exaple by googling.
    – Mahmood
    Dec 10, 2014 at 12:46
  • 1
    If you cant share the controller, which is quite strange and irritating to be honest, then would you like to tell what is RequestQ? What is it holding? P.S. but let me tell you, without proper information it would be very tough for us to help you.
    – Mahmood
    Dec 10, 2014 at 12:51

1 Answer 1

0

If the Assigned To is a lookup field to User on an sObject then in your SOQL query please use one more field name Assigned_To__r.Name and use it in the VF page. Eg:

<apex:repeat value="{!listOfRecords} var="a">
<tr>
<td>{!a.Assigned_To__r.Name}</td>
.
.
</tr>
</apex:repeat>
1
  • i tried using the .name after the {!RequestQ[View.listOfFields[1]]} expression, but did not work. Dec 10, 2014 at 12:51

You must log in to answer this question.

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