Could work something like that? :
 
<a id=<wo:WOString value ="[mySess.selectedPerformance.primaryKey]"/> href =
"javascript:ShowContent(this.id);" 
 onMouseOver = "ShowContent(this.id); return true;"
 onMouseOut = "HideContent(this.id); return true;">
 
Ciao,
Bjoern

  _____  

From: webobjects-dev-bounces+bw=condat...@lists.apple.com
[mailto:webobjects-dev-bounces+bw=condat...@lists.apple.com] On Behalf Of
Johan Henselmans
Sent: Thursday, February 18, 2010 9:45 AM
To: WebObjects Development
Subject: Quoting hell, anybody a solution?


I am trying to call a webobjects string in an a href; 

First i tried this:

<a href = "javascript:ShowContent('<wo:WOString value
="[mySess.selectedPerformance.primaryKey]"/>') "; 
 onMouseOver = "ShowContent('<wo:WOString
value="[mySess.selectedPerformance.primaryKey]"/>'); return true;"
 onMouseOut = "HideContent('<wo:WOString value
="[mySess.selectedPerformance.primaryKey]"/>'); return true;">


Of course, that gave errors about the quoting. It said: 'The character '<'
must be escaped'.  Expected behavior, too many quotes. 

Smart ass as I am (just have been listening to Bonzo Dog Doo-bah Band's
'Look at me I'm wonderful') I thought that using the &quot; instead of "
would take care of it:


<a href = &quot; javascript:ShowContent('<wo:WOString value
="[mySess.selectedPerformance.primaryKey]"/>') &quot; 
onMouseOver = &quot; ShowContent('<wo:WOString
value="[mySess.selectedPerformance.primaryKey]"/>'); return true; &quot;
 onMouseOut = &quot; HideContent('<wo:WOString value
="[mySess.selectedPerformance.primaryKey]"/>'); return true; &quot; >


I would assume that the webobjects parser would parse the WOString bit, then
pass the rest to the webserver which in return would pass it to the browser
where the &quot; quoting would be returned to it glorious " quoting and be
interpreted by the browser as being a javascript. 

Unfortunately that resulted in:


SAXParseException: Open quote is expected for attribute "href" associated
with an  element type  "a".
  at org.apache.xerces.parsers.AbstractSAXParser.parse(null:Unknown)
  at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(null:Unknown)
  at
com.webobjects.appserver.parser.woml.WOMLTemplateParser.process(WOMLTemplate
Parser.java:339)
  at
com.webobjects.appserver.parser.woml.WOMLTemplateParser.parse(WOMLTemplatePa
rser.java:653)
  at
com.webobjects.appserver.parser.WOHTMLTemplateParser.parse(WOHTMLTemplatePar
ser.java:40)
  at
com.webobjects.appserver.parser.WOComponentTemplateParser.templateWithHTMLAn
dDeclaration(WOComponentTemplateParser.java:438)
     ... skipped 1 stack elements
  at com.webobjects.appserver.WOComponent.template(WOComponent.java:499)
  ... skipped 17 stack elements


Anybody a correct way of quoting? 

(Because the liberal use of quotes in this document, you should not feed
this document to your SAXParser)

Johan Henselmans
jo...@netsense.nl <mailto:jo...@netsense.nl> 




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to