How can I get Roo to produce a link that opens a create or edit page instead of text when it generates output for a page?

☆樱花仙子☆ 提交于 2019-12-11 00:57:16

问题


Currently in the list view for an entity, references to other entities are just output as the key value in plain text. Instead, I would like references to other entities to be output as hyperlinks.

I tried modifying the list.jspx but I couldn't figure out what I needed to add to the URL to make it open to the right controller. A pointer in the right direction would be helpful.


回答1:


I find the roo tag libraries always point me in the right direction. Here is an example from src/main/webapp/WEB-INF/tags/form/fields/table.tagx that does something similar to what you are requesting:

 <spring:url value="${path}/${itemId}" var="update_form_url">
    <spring:param name="form" />
 </spring:url>
 <spring:url value="/resources/images/update.png" var="update_image_url" />
 <spring:message arguments="${typeName}" code="entity_update" var="update_label" htmlEscape="false" />
 <a href="${update_form_url}" alt="${fn:escapeXml(update_label)}" title="${fn:escapeXml(update_label)}">
    <img alt="${fn:escapeXml(update_label)}" class="image" src="${update_image_url}" title="${fn:escapeXml(update_label)}" />
 </a>

Hopefully you can tweak this example to meet your needs.



来源:https://stackoverflow.com/questions/13273043/how-can-i-get-roo-to-produce-a-link-that-opens-a-create-or-edit-page-instead-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!