-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi there. I have a problem with Java scripts.
I have this piece of code:
<zscript language="Java"> void aMethod() Source Code {//Method starts //Declarations-------------------------- String logVal; String pasVal; //Sentences----------------------------- logVal="a Value"; pasVal= "otherValue"; //Let check if values are the same if (logVal.equals(pasVal) & (logVal!=null)) {//If Block starts //Entry Condition: Two values match and logVal is not null alert ("You're Logged in") }//If Block endss else {//Else block starts //Entry Condition: Two values don't macth or logVal is null alert ("You aren't logged in, try again"); }//Else block endss }//Method endss </zscript>
if (!logVal.equals(pasVal) | (!logVal!=null)))
Hi,
this is a problem with escaping the ampersand, which has a special meaning in XML. You'll have to use a CDATA-Section like the following:
<zscript><![CDATA[
... here you can use & as you like...
]]></zscript>
I would recommend to always use a CDATA-Section within ZScript.
HTH, Maik
Thankyou very much mjablonski. I'll try as you recommend. I tried the && operator and works fine. Regards!!!
PD: It worked because I separated the code from the view, into a page called check.zul. This page was referenced using the src attribute for the zscript tag
Asked: 2008-09-03 15:10:51 +0800
Seen: 494 times
Last updated: Sep 03 '08