You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-user@jakarta.apache.org by Tobias Specht <to...@student.uni-augsburg.de> on 2003/01/02 16:08:02 UTC

Re: A feature suggestion (orginates from IBM's BSF discussion list[Fwd: A feature suggestion (and a solution to ... Re: [Bsf-discussion] Where's the script code if in BSFEngine.call() ??? Request for help.]

Hi,

2002-12-15 Rony G. Flatscher wrote:
> Therefore, I would like to suggest a method in BSFEngine which allows 
> for registering/loading the entire script program (possibly with 
> arguments for initialisation purposes). Then, a BSFEngine.call() could 
> relate to those functions/methods/routines which are defined there. 
> Scripting languages, like Rexx, which do not (yet) allow for such 
> behaviours, would be able to get access to the code, which then can get 
> executed by the call().
such a feature would indeed be *very* helpful for a project I'm doing at 
the moment: I'm trying to use the bsf to enable the use of the supported 
scripting languages for client side browser scripting in addition to 
javascript.
At the moment (it already works, but is still in a very early stage of
development),  everytime a function that is implemented in a bsf scripting
language is  called, the complete code is passed to the scripting engine
viaBSFEngine.exec(), with a loadScript() method, it would be possible to 
load the complete script-code when the document is loaded and only pass 
the function call when the execution of this function is triggered.
In addition, it would be possible to use 'real' script code (including 
predefined functions of the scripting engine, e.g. ~reverse in the  Object
Rexx scripting engine) in the event-handler pseudo urls instead  of
referencing the script to be executed by id as I do it at the moment.
Examples:
- with loadScript:

	<script type="x-bsf:x-engine">
	function someFunction
	...
	</script>

	...

	onClick="x-engine:someFunction()"

- without loadScript (current solution):

	<script type="x-bsf:x-engine" id="someFunction">
         script_code
	</script>

	...

	onClick="x-engine:someFunction"

Regards,

tobi