在display:column标签中增加target
关键:
1.displaytag.tld
<attribute>
<name>target</name>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<description>
href target.</description>
</attribute>
2.org.displaytag.util.Anchor
public void setTarget(String target) {
this.attributeMap.put(TagConstants.ATTRIBUTE_TARGET, target);
}
3.org.displaytag.model.Column
public String createChoppedAndLinkedValue() throws ObjectLookupException, DecoratorException {
String target = (String) htmlAttributes.get(TagConstants.ATTRIBUTE_TARGET);
Anchor anchor = new Anchor(colHref, choppedValue);
if (target != null) {
anchor.setTarget(target);
}
}
4.ColumnTag/TagConstants增加对应内容。
本文介绍如何在DisplayTag的display:column标签中增加target属性,实现链接目标窗口的指定。通过修改displaytag.tld文件及Column类的方法,使得在创建链接时能够自定义链接打开的位置。
132

被折叠的 条评论
为什么被折叠?



