When I try to add toolbar button to the dashboard, tooltip is also added to the title. Eg: The following code
aqua.response.dashboard.addToolbarButton (aqua.project.getDashboardURL() + "/stock_risk_performance.xjs", "Risk Performance", "Risk Performance", "");
Shows title and tooltip together as "Risk Performance Risk Performance". Please see the attached screen shot for details. And here is the sample I used
//======================================== Start Stock Dashboard Code ========================================//
function buildDashboard()
{
var dashboard = aqua.response.dashboard;
dashboard.addToolbarButton (aqua.project.getDashboardURL() + "/stock_risk_performance.xjs", "Risk Performance", "Risk Performance", "");
dashboard.addToolbarSeparator();
dashboard.addToolbarButton (aqua.project.getDashboardURL() + "/stock_volatility.xjs", "Stock Volatility", "Stock Volatility", "");
dashboard.addToolbarSeparator();
dashboard.addToolbarButton (aqua.project.getDashboardURL() + "/stock_correlation.xjs", "Stock Correlation", "Stock Correlation", "");
}
//======================================== End Stock Dashboard Code ========================================//
buildDashboard(); // Creates an instance of the toolbar in the HTML page
aqua.response.write("<h1>Financial Examples</h1>");
|
|
91 KB
the last argument for addToolbarButton (the icon name) should be null, not an empty string.
if it's non-null, the code for an icon will get emitted, but since there is no real icon, it's 'alt' tag gets displayed.
IMHO, distinguishing between null and empty string in this case may not be a good idea but I leave it to the conventions we follow in our api. There is one minor issue I find in the html code generated for dashboard. Anchor tab <a> is added with an alt attribute which is not a valid one. Eg: here is the code generated from ADStudio
<a title="Risk Performance" alt="Risk Performance" href="/project/stock_risk_performance.xjs"> Risk Performance</a>
alt attribute is applicable for <img> tag only. We need to remove alt attribute from the anchor a tag.
Reference:
img tag
http://www.w3schools.com/tags/tag_IMG.asp
anchor a tag
http://www.w3schools.com/tags/tag_a.asp
IMHO, distinguishing between null and empty string in this case may not be a good idea but I leave it to the conventions we follow in our api. There is one minor issue I find in the html code generated for dashboard. Anchor tab <a> is added with an alt attribute which is not a valid one. Eg: here is the code generated from ADStudio
<a title="Risk Performance" alt="Risk Performance" href="/project/stock_risk_performance.xjs"> Risk Performance</a>
alt attribute is applicable for <img> tag only. We need to remove alt attribute from the anchor a tag.
Reference:
img tag
http://www.w3schools.com/tags/tag_IMG.asp
anchor a tag
http://www.w3schools.com/tags/tag_a.asp
#1. we don't perform any specific checks to see if an icon actually exists, so the logic depends on the name being non-null or null, as described in javadoc.
#2. fixed.
#1. we don't perform any specific checks to see if an icon actually exists, so the logic depends on the name being non-null or null, as described in javadoc.
#2. fixed.
Issue #5184 |
| Closed |
| Fixed |
| Resolved |
Completion |
| No due date |
| Fixed Build ads-9.0.10_04 |
| No time estimate |
the last argument for addToolbarButton (the icon name) should be null, not an empty string.
if it's non-null, the code for an icon will get emitted, but since there is no real icon, it's 'alt' tag gets displayed.