|
Re: Uh-Oh (re: #786618) [message #787447 is a reply to message #786751] |
Tue, 31 January 2012 15:37 |
|
Mike
What version of BIRT are you using and what app server. This worked
fine on my deployment. Also are you using the viewer?
Jason
On 1/30/2012 2:35 PM, Mike Schlossberg wrote:
> I just tried the solution presented in message #786618 to accomplish a
> redirect upon an error condition (bad DB username / password). This
> seems to work fine from the Designer, but when I deploy the report to
> Tomcat, I get the following (note that the code resides in the onCreate
> event of a table (id=935).
> Any idea what I need to do differently to make this work from the web
> viewer (deployed to Tomcat)?
>
>
> TypeError: Cannot call method "getTask" of null
> (/report/body/table[@id="935"]/method[@name="onCreate"]#5) (Element ID:935)
>
> birt.core.JavascriptCommonError ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: There are
> errors evaluating script "var taskid =
> reportContext.getHttpServletRequest().getAttribute("attributeBean").getTaskId();
>
>
>
> var mytask =
> reportContext.getHttpServletRequest().getSession().getAttribute("tasks").get(taskid).getTask();
>
>
>
> if( !mytask.getErrors().isEmpty() ){
> //you could iterate the errors here as well
> reportContext.setGlobalVariable("myerrors",true);
> }else{
> reportContext.setGlobalVariable("myerrors", false);
> }":
> TypeError: Cannot call method "getTask" of null
> (/report/body/table[@id="935"]/method[@name="onCreate"]#5) (Element ID:935)
>
>
|
|
|
|
Re: Uh-Oh (re: #786618) [message #789958 is a reply to message #789346] |
Fri, 03 February 2012 16:08 |
|
Can you log an enhancement for this?
Jason
On 2/2/2012 5:13 PM, Mike Schlossberg wrote:
> My test env.: win 7, Eclipse 3.7.0, Tomcat 7.
> I'm not sure what was up. I was under a bit of a deadline so I ended up
> un-jar-ing viewservlets.jar, then I added a big blurb in the paramter
> box prompt message about how 'the red error message means that you've
> entered your username and password incorrectly -- use your browser's
> back button if this happens' and the re-jar-ed . . . this was good enough.
>
> I would like to work this out for future projects, though.
> Even better would be a way to edit the message text, catch the actual
> error at this level, etc.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04266 seconds