0

Syntax Error mark ... help me!

asked 2008-09-19 14:04:54 +0800

kgibrank gravatar image kgibrank
48 1

updated 2008-09-19 14:05:36 +0800

Hi, I'm nwb in ZK framework ... I installed ZK Studio 0.8.2 on Eclipse 3.4 Ganymede, i create my first file .zul with ZUL Editor and copy and paste the simple example in Dev Guide >> Interactivity:

<?page id="testZul" title=" New ZUL Title" cacheable="false" 
	language="xul/html" zscriptLanguage="Java" contentType="text/html;charset=UTF-8"?>
	<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
	xmlns:h="http://www.w3.org/1999/xhtml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
	<window title="My First Window" border="normal" width="200px">
		Hello, World!
		<button label="Say Hello" onClick="alert(&quot;Hello World!&quot;)"/>	
	</window>
</zk>

but Editor give me Syntax Error mark:

Multiple annotations found at this line:
	- Syntax error on tokens, delete these 
	 tokens
	- Hello cannot be resolved to a type
	- alert cannot be resolved to a type

on

onClick="alert(&quot;Hello World!&quot;)"
!!! Why ?????


Thanks ZK Team and ZK Community and sorry for my bad enaglish!!!

ORAZIO

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2008-09-20 07:46:45 +0800

hkn gravatar image hkn
246 3

as far as I remember ZK studio works with Eclipse 3.3 not 3.4. Please see http://www.zkoss.org/smalltalks/zkstudioins/

Regards
/Horst

link publish delete flag offensive edit

answered 2008-09-20 16:09:33 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

updated 2008-09-20 16:10:00 +0800

Hi, We are trying to let studio works both on 3.3 and 3.4.

There is some implementation issue in Studio.
In onXXX and zscript, we only supports Java Language, all text in this part will transfer to Java Code.

Which means any XML escape character the code segment cause Java Error , just like you type such code(text) in a Java class.

there are two way to work around this,
1.

<button label="Say Hello" onClick='alert("Hello World!")'/>	

or
2.
<button label="Say Hello">	
<attribute name="onClick">
alert("Hello World!");
</attribute>
</button>

link publish delete flag offensive edit

answered 2008-10-13 14:07:26 +0800

kgibrank gravatar image kgibrank
48 1

Hi, NKN, hi DENNIS

Thanks very much for your answers, I solved my problem

thanks

ORAZIO

link publish delete flag offensive edit

answered 2009-03-09 23:27:45 +0800

neomartigan gravatar image neomartigan
6

Hello all,

I have this same problem...

And I solved with the workaround, thanks ;)

Just one question... if I develop my application using the work around #1 i will not have any problems in the future??? or when this issue is resolved for Eclipse 3.4. I need to rewrite all my .zul pages? or is better use the work around #2? or is better download Eclipse 3.3?

Thanks in advance :)

link publish delete flag offensive edit

answered 2009-03-10 00:57:03 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

Yes, it will be no issue, I think case one is also the XML spec, and should works in both eclipse 3.3 and 3.4.
use case 1,2 to write some a simple demo code or prototyping are both good chooses,

link publish delete flag offensive edit

answered 2009-03-10 01:36:31 +0800

neomartigan gravatar image neomartigan
6

Wow thanks for quick response Dennis...

I downloaded 3.3.2 eclipse-jee-europa-winter-win32 and install in another PC, the Eclipse IDE, ZK Studio, Apache tomcat... and everything works fine....

Only when I try this simple example:

 <button label="Say Hello" onClick="alert("Hello World!")"/>

Eclipse marks an error in: alert(&
and said:

  Error:
  alert cannot be resolved to a type

  Error:
  Syntax error on tokens, delete these tokens


and in Hello text:
and said:

  Error:
  Hello cannot be resolved to a type


The ZUL Visual editor works very nice, and the page is rendered perfectly in Web Browser...


If I use the work arounds both of them work perfectly again.... :)

Then I still used the work arounds??? even in Eclipse 3.3?

I had hoped that with the 3.3.2 version the issue will be resolved.

Did you know wich combination Eclipse/ZK Studio the issue disappears?


Thanks :)

link publish delete flag offensive edit

answered 2009-03-10 01:51:47 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

Hi, neomartigan,
this is XML Character escaping issue, you cannot use " in "",
try this,
<button label="Say Hello" onClick='alert("Hello World!")'/>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-09-19 14:04:54 +0800

Seen: 1,350 times

Last updated: Mar 10 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More