Issue 25276 - JavaScript and BeanShell script providers do not pass parameters to scripts
Summary: JavaScript and BeanShell script providers do not pass parameters to scripts
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: 680m24
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: tomaisoc
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks: 21176 21179
  Show dependency tree
 
Reported: 2004-02-09 18:04 UTC by tomaisoc
Modified: 2005-01-06 11:25 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description tomaisoc 2004-02-09 18:04:50 UTC
The JavaScript and BeanShell ScriptProvider implementations
do not pass the parameters passed to the invoke command to
the scripts. This is particularly important when executing
scripts for UI controls in dialogs.
Comment 1 tomaisoc 2004-02-10 16:39:59 UTC
.
Comment 2 tomaisoc 2004-02-18 17:23:26 UTC
This is can be fixed by pushing a global variable called ARGUMENTS into
the scope of the BeanShell or JavaScript script when invoking it. The
script should then be able to use the ARGUMENTS array to access the
parameters and use them.

One of the difficulties in assigning a BeanShell or JavaScript script
to an event for a UI control (eg. a button in a dialog) is that when
the script is executed the ActionEvent object passed in will have the
button in its Source member variable, but it won't have the XDialog
in which the button is placed. The script will have to get the XDialog
by calling getContext on the XControl interface of the button. We
should provide examples of how to write BeanShell and JavaScript scripts
to handle dialog events.
Comment 3 tomaisoc 2004-02-18 17:24:10 UTC
.
Comment 4 tomaisoc 2004-02-19 17:57:18 UTC
BeanShell and JavaScript XScript implementations now pass the parameters
on to the interpreters via a global array variable called ARGUMENTS. The
Highlight example has been modified for BeanShell and JavaScript to
include a ButtonPressHandler script that looks for a com.sun.star.awt.ActionEvent
as the first element in the ARGUMENTS array.

See issue 25271 for a test case to verify this is working.
Comment 5 joerg.skottke 2004-04-14 09:01:44 UTC
verified
Comment 6 tomaisoc 2005-01-06 11:25:54 UTC
closing, i have verified this in an m69 build