如何在中制作项目(列)超级链接?

发布于 2024-09-30 21:22:13 字数 1524 浏览 0 评论 0原文

我成功创建了具有 salesforce 提供的样式的表格。 (就像鼠标悬停时突出显示的那样)

但我希望列的值成为显示对象详细信息的链接。 当我不创建自己的 Visualforce 页面时,表格看起来不错,列 值(记录)都是超链接的,但无法从 Visualforce Apex 代码中弄清楚如何做到这一点。

pageBlockTable 和列定义似乎没有属性或任何内容 使其成为超链接。

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>

我可以通过像下面这样扔掉好的设计来实现我的目标,但我想保留上面的代码。

这可行,但没有应用销售人员风格。

 <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>

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

But I want the value of 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 hyperlink.

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风情万种。 2024-10-07 21:22:13

尝试在列正文中执行以下操作,而不是

<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">

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">
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文