Benjamin's suggestion for how to pass string literals into script
functions (single quotes enclosing double-quotes) did work:
<button id="myButton" actionCommand='someScriptFunction("myButton")'/>
However, I still wanted the greater flexibility of xpath expressions,
so I took a stab at modifying HandleScriptFunctionAction in the 6.0
branch to support it. As with HandleClassMethodAction, script function
arguments can now be a mixture of xpath expressions and literals, such
<button id="myButton" actionCommand='someScriptFunction($myButton,
"string literal", $myButton/text)'/>
Let me know what you guys think.
--- Benjamin POUSSIN <poussin@...> wrote:
> On Tue, 20 Mar 2007 02:34:12 -0700 (PDT)
> JP <petersens@...> wrote:
> > Actually, that suggestion didn't work for me. It gives me a
> > ScriptException:
> > Caused by: Sourced file: inline evaluation of:
> > ``disableUnselectedTabs('resourceTabs');'' Token Parsing Error:
> > error at line 1, column 25. Encountered: "e" (101), after : "\'r":
> > unknown location>
> > It does work if I use escaped double-quotes like this:
> > <button id="myButton"
> > actionCommand="someScriptFunction("myButton")"/>
> perhaps try this:
> <button id="myButton"
> > But that seems kind of lame. Are there any other ways to pass
> > literals into script functions?
> > It would be great if HandleScriptFunctionAction.doCommand() could
> > modified to behave more like HandleClassMethodAction.doCommand(),
> > that XPath constructs could be passed to script functions.
> Benjamin, as
> > the author of those two classes, what are your thoughts about this
> > idea?
> I'm just the author of HandleClassMethodAction. The other is just cut
> and past of old code during refactoring and action support creation.
> I think, you can take example of HandleClassMethodAction to implement
> that you want (sorry i've time now for that).
> tél: +33 (0) 2 40 50 29 28
> email: poussin@... () campagne du ruban ascii
> http://www.codelutin.com /\ pour les mails en ascii
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.