|
Re: Validate input parameter in script [message #363457 is a reply to message #363455] |
Tue, 24 June 2008 15:54 |
Eclipse User |
|
|
|
Originally posted by: loic_malassis.yahoo.fr
Hello
I have been investigating to reach a somehow similar objective.
I came up with this solution:
1) Calling an event handler at the initialize time of the report
2) Recuperate the parameters
3) Call any verification functionI want using java
4) Decide what to do based on the result of this function
I came up with a solution for parts 1), 2) and 3) and I am expecting help
on the part 4).
Maybe this could be of some help to you.
If you wish, give a look at my post, ant is eventual follow-ups.
http://www.eclipse.org/newsportal/article.php?id=28829&g roup=eclipse.birt#28829
Best regards
Loic
|
|
|
|
|
|
|
|
Re: Validate input parameter in script [message #696087 is a reply to message #695852] |
Wed, 13 July 2011 08:50 |
arlene86 Messages: 6 Registered: July 2011 |
Junior Member |
|
|
thanks for reply...
I want to validate the null value. If parameter with display type = textbox and isRequired = false, the parameter page will display Null Value radio button below the textbox.
As what i can see, when i checked the radio button (Null Value), parameter is not validated.
thanks,
arlene
[Updated on: Wed, 13 July 2011 08:51] Report message to a moderator
|
|
|
Re: Validate input parameter in script [message #696291 is a reply to message #695634] |
Wed, 13 July 2011 16:02 |
|
The validate script needs to return true or false. False will launch
the validation failure error. Do something like:
if( params["myparm"].value != whateveryouarechecking ){
true;
}else{
false;
}
Jason
On 7/12/2011 4:05 AM, arlene86 wrote:
> Hi..
>
> I need some help here..
> I'm using BIRT 2.6.1..i have created one parameter with data type =
> String and display type = textBox. How to validate the paramater using
> validate event even though the parameter value is null (which means the
> radio button with Null Value is checked)?
>
>
> thanks,
> Arlene
|
|
|
|
Re: Validate input parameter in script [message #698051 is a reply to message #696444] |
Mon, 18 July 2011 16:59 |
|
It looks like the validate event is not being called if the parameter
value is null. Can you log a bug for this? You could check in the
beforeFactory and then add a script tag in a text element to forward to
another location:
//beforeFactory script:
if( params["NewParameter"].value == null ){
reportContext.setGlobalVariable("forw", true);
}else{
reportContext.setGlobalVariable("forw", false);
}
//Text element with type set to html
<script type="text/javascript">
function forward() {
if( <VALUE-OF>reportContext.getGlobalVariable("forw");</VALUE-OF>){
var temp = new String(location.href);
//var detailReport =
"nameofreportcontainingerrormessageyouwanttodisplay.rptdesign";
//var TargetURL = temp.replace(/forwarddetail.rptdesign/, detailReport);
//location.replace(TargetURL);
location.replace("http://www.google.com");
return false;
}
}
forward();
</script>
Jason
On 7/13/2011 9:04 PM, arlene86 wrote:
> Hi Jason,
>
> I still got a problem.When i checked the Null Value, i don't get any
> error message.
> I want to allow blank for the input parameter but disallow null. How to
> do something like this? i'm using BIRT 2.6.1.
>
>
> Thanks,
> Arlene
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.07066 seconds