如何在中制作项目(列)超级链接?
我成功创建了具有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在列正文中执行以下操作,而不是
:Instead of
<apex:column value="{!item.name}" />
, try doing it like this in the column body: