[
http://jira.codehaus.org/browse/DISPL-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_101222
]
Christine Ferdinand commented on DISPL-452:
-------------------------------------------
I've done some code changes for this feature.
Maybe someone who has set up the CVS project is willing to create a patch.
After the change it is possible to specify the export target by adding the
following tag inside the table tag:
<display:setProperty name="export.target" value="_blank" />
Here is what I did:
class org.displaytag.properties.TableProperties
added:
/**
* Property <code>export.target.value</code>. Name of the target frame used in
exportLinks
*/
public static final String PROPERTY_STRING_EXPORT_TARGET_VALUE =
"export.target";
/**
*
* @return the target frame used for construction the exportLinks
*/
public String getExportTargetValue()
{
String result = getProperty(PROPERTY_STRING_EXPORT_TARGET_VALUE);
return result;
}
********************************************************
class org.displaytag.util.Anchor
added:
private String target;
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
/**
* Creates a new Anchor whith the supplied Href and body text.
* @param linkHref baseHref
* @param linkBody String link body
* @param target target frame for the link
*/
public Anchor(Href linkHref, String linkBody, String target)
{
this.href = linkHref;
this.linkText = linkBody;
this.target = target;
}
private String getTargetString()
{
if (this.target == null)
{
return TagConstants.EMPTY_STRING;
}
return " target=\"" + this.target.toString() + "\""; //$NON-NLS-1$
//$NON-NLS-2$
}
changed
line 116
return TagConstants.TAG_OPEN + TagConstants.TAGNAME_ANCHOR + getHrefString() +
TagConstants.TAG_CLOSE;
to
return TagConstants.TAG_OPEN + TagConstants.TAGNAME_ANCHOR + getHrefString() +
getTargetString() + TagConstants.TAG_CLOSE;
********************************************************
org.displaytag.render.HtmlTableWriter
Method writeExportLinks()
added in line 580
if(this.properties.getExportTargetValue()!=null){
anchor.setTarget(this.properties.getExportTargetValue());
}
> New parameter target for export link
> ------------------------------------
>
> Key: DISPL-452
> URL: http://jira.codehaus.org/browse/DISPL-452
> Project: DisplayTag
> Issue Type: Improvement
> Components: Export
> Affects Versions: 1.1
> Reporter: gabriele mariotti
>
> Whe generating export link in HTMLTableWriter (method writeExportLinks) I
> would setting a new parameter target for link generated.
> Actually is not possible set it (for example _blank).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
displaytag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel