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
as:
<button id="myButton" actionCommand='someScriptFunction($myButton,
"string literal", $myButton/text)'/>
Let me know what you guys think.
-JP
--- Benjamin POUSSIN <poussin@...> wrote:
> On Tue, 20 Mar 2007 02:34:12 -0700 (PDT)
> JP <petersens@...> wrote:
>
> Hi,
>
> > 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:
> Lexical
> > error at line 1, column 25. Encountered: "e" (101), after : "\'r":
> <at
> > 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"
> actionCommand='someScriptFunction("myButton")'/>
>
> > But that seems kind of lame. Are there any other ways to pass
> string
> > literals into script functions?
> >
> > It would be great if HandleScriptFunctionAction.doCommand() could
> be
> > modified to behave more like HandleClassMethodAction.doCommand(),
> so
> > 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).
>
>
> --
> Benjamin
> --------------------
> 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.
http://tools.search.yahoo.com/toolbar/features/mail/
|