Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I successfully created tables with the style that salesforce provided. (like the one that highlighted on mouseover etc)

But I want the value of the column to be a link to display detail info of the object. When I don't create my own visualforce page, the table looks nice and the column values (records) are all hyperlinked but can't figure out how to do it from visualforce apex code.

pageBlockTable and column definition does not seem to have attributes or anything that make it hyperlinked.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_pageBlockTable.htm
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_column.htm

<apex:pageBlock title="test">

    <apex:pageBlockTable value="{!workObj}" var="item">

        <!-- below needs to be hyperlink -->

        <apex:column value="{!item.name}" /> 

    </apex:pageBlockTable>

</apex:pageBlock>

I could achieve my goal by throwing the good design away like below but I would like to keep the code above.

This works but no salesforce style is applied.

<apex:pageBlock title="my test title" >    

            <apex:dataTable value="{!workObj}" var="wn" cellpadding="2" cellspacing="2">

                <apex:column>

                    <apex:facet name="header">仕事名一覧</apex:facet>

                    <apex:form >

                        <apex:commandLink value="{!wn.name}" />

                    </apex:form>

                </apex:column>

            </apex:dataTable>

    </apex:pageBlock>

1 Answer

0 votes
by (32.1k points)
edited by

Instead of <apex:column value="{!item.name}" />, try doing it like this in the column body:

<apex:pageBlock title="test">

        <apex:pageBlockTable value="{!workObj}" var="item">

         <apex:column>

              <apex:outputLink value="{!item.name}">{!item.name}</apex:outputLink>

         </apex:column>

    <apex:pageBlock title="test">

<apex:pageBlockTable value="{!workObj}" var="item">

Want to learn Salesforce in depth? Go through the Salesforce course online training provided by Intellipaat! 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...