| Summary: | HyperLink UI for Ajax | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Scott Rosenbaum <scottr> |
| Component: | BIRT | Assignee: | Wenfeng Li <wenfeng.fwd> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ptessier |
| Version: | 2.2.0 | Keywords: | plan |
| Target Milestone: | Future | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Scott Rosenbaum
My recommendation for implementing this is to use json syntax as defined at www.json.org.
This makes it pretty extensible and easy to navigate as you would navigate a dom.
So the UI would need to ask the user for a call back function.
Lets say the call back function was called 'loadMyReport'. Now when the output is generated by the Report engine it would generate something similar to the sample in this html syntax. Note the a href reference.
<html>
<head>
<script>
function loadMyReport(reportIdentifier)
{
alert(reportIdentifier.name);
alert(reportIdentifier.params[0].name);
}
</script>
</head>
<body>
<a href="javascript:loadMyReport({'name': 'targetReport', 'params':[{'name': 'test', 'displayName': 'test params'}] })">load the report</a>
</body
</html>
Doing it this way ensures that the birt engine doesn't need to hardcode the function name.
In addition since the syntax is json additional properties can be added without having users modify the function since the function only takes one single argument always irrespective of how may properties the object may contain.
Does this duplicate with 176838? *** Bug 176838 has been marked as a duplicate of this bug. *** The anchor tag("<a href=...") represents hyperlink isn't specify by UI. It's specify by html emitter in report output.
I think the case actually requires a customize HTMLActionHandler, in which the hyperlink URL is generated based on the BaseURL. In customize action handler, user can generates the URL as: javascript:HyperlinkHandler( param1, ... ). Then html emitter will output as: <a href="javascript:HyperlinkHandler( param1, ... )">. I let the js function named "HyperlinkHandler" here.
User has to define its own js function, including function name and its parameters. Whithin the function, user implements how to process without refreshing whole page. I think the JS function probably needs to take the BaseURL as parameter. As I understand, Ajax needs the BaseURL to tell him where to fetch content to replace current div.
In the user's web-app, the customize action handler can be specified in user own render option and pass to report engine.
Scott, please review if I understand the case correctly.
One more point: Since user develops own Ajax viewer framework, it directly calls report engine to generate Web-based report output. So I see the report engine caller in this case is user's own viewer, but not Report Designer. Report Designer calls model to represent hyperlink as action properties of report item, and then calls Report Viewer to present report. In this case, Report Viewer decides how to handle the hyperlink passed by report engine in its framework. Well I'm considering this requirements. I think this is part of the goal of new preview framework which is used by new preview prototype. I'm going to study this case and try to know if the new preview framework can fit this. But in general, I don't think we can have a simple GUI to do this. For the really generated url depending on the runtime container (web server for this case), so we can't assume the url inputed on the GUI is the same as the generated one by the runtime container. I think the user need provide it's own logic to generate the url as they wish. Maybe they need write it's own action handler or maybe a simple wrapper plug-in. Add plan keyword to consider support of Ajax based report item. The action would be a link to another report or could be an action that trigger some other presentation or transactions. Also consider a browser side Ajax event API on a report items. no real interest. Going to close. |