| Summary: | Add the abilility to hide report parameters at run-time | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Josh Hall <joshdanhall> |
| Component: | BIRT | Assignee: | Birt-ReportEngine-inbox <Birt-ReportEngine-inbox> |
| Status: | REOPENED --- | QA Contact: | Xiaoying Gu <bluesoldier> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | bluesoldier, brandon.c.autrey |
| Version: | 2.6.1 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Josh Hall
Have you tried to add reportContext.getDesignHandle().findParameter('site_rptParam').hidden = true; in the parameter's getDefaultValueList event?
It works in my environment.
Set as worksforme based on comment #1. Please feel free to reopen if there is any issues. That did work. To me though, it feels like a work-around. It's not obvious to the developer that to set parameter attributes, one should add code to 'getDefaultValueList'. Re-opened this in the hope that an 'initialize' event may be added. It would be great if this was added to a Java event handler as well as the JavaScript one. I tried to unhide a parameter based on the selection of a boolean checkbox. This is so to only show the user what needs to be filled in. When the boolean is selected true, then you need to enter in the start and end date.
This is the code in the script for the boolean parameter of script type getDefaultValueList:
if (params["Enable_Completed_Date"].value)
{
reportContext.getDesignHandle().findParameter("StartDate").hidden = false;
} else {
null;
}
This doesn't work, but I would expect this to work as both of the params and reporContext variables work independently. I think there needs to be a new script type for event handling, like when this boolean value is changed, run this script. I suspect currently that it runs it all once when the parameter page first opens up.
|