For Programmers: Free Programming Magazines  


Home > Archive > Rexx > October 2006 > ooRexx 3.0 and IE & doc









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ooRexx 3.0 and IE & doc
Mircea

2006-10-21, 7:03 pm

Hi,

unfortunately I was not able to find very good
documentation about using ooRexx inside IE.

I will only want to find the equivalent ooRexx instructions ( to
JavaScript):

set an entry to null
document.forms['form1'].sel.options[3] = null;

overwrite a list entry
document.forms['form1'].sel.options[3].text = 'Overwritten';

Thanks,
Mircea

rony

2006-10-21, 7:03 pm

Hi Mircea,

Mircea wrote:
> unfortunately I was not able to find very good
> documentation about using ooRexx inside IE.
>
> I will only want to find the equivalent ooRexx instructions ( to
> JavaScript):
>
> set an entry to null
> document.forms['form1'].sel.options[3] = null;
>
> overwrite a list entry
> document.forms['form1'].sel.options[3].text = 'Overwritten';


this is totally untested, but usually replacing the dot with a tilde (~) and replacing "null" with
".nil" does the trick. So I would suggest to try out:

> document.forms['form1'].sel.options[3] = null;


document~forms['form1']~sel~options[3] = .nil


> document.forms['form1'].sel.options[3].text = 'Overwritten';


document~forms['form1']~sel~options[3]~t
ext = 'Overwritten'


Please let us know whether this has helped you.

Regards,

---rony
Mircea

2006-10-22, 8:02 am

Hi Rony,

thank you for your answer, it helped me a lot.

I have ooRexx 3.0.

A. with CrazyBrowser ( it is using IE )

1. Your solution to overwrite the text part is working:
document~forms['form1']~sel~options[3]~t
ext = 'Overwritten'

2. Deleting an item is not working:
document~forms['form1']~sel~options[3] = .nil

when clicking "Delete 4th" button the following message appears:

Line: 7
Char: 0
Error: [97.1] Object method not found / Object "an OLEOBJECTS" does
not understand message "[]="
Code: 97

-- second message
Line:45
Char:0
Error: [40.1] Incorrect call to routine / External routine
"DELETEONE" failed
Code: 40

It seems that ooRexx DOES NOT HAVE an assign (=) method for that
type of object.

I will download and install ooRexx 3.0.1 and try again ( some
errors corrected in OLE ).

B. with Internet Explorer 6.0.2900.2180.xpsp_sp2_gdr.050301-1519

1. when clicking "Change 4th" button the following message appears:

Line: 49
Char: 0
Error: [48.1] Failure in system service / Failure in system service:
Host command invocation not allowed in sandbox mode!
Code: 48

BUT THE VALUE IN THE LIST ( for element [3] ) WAS MODIFIED FROM
"fourth option" to "Overwritten". Strange.

My objective is anyway to have my code in a HTA file.

Thank you again,
Mircea

PS: The test code:
-- CODE BEGIN ---
<HTML>
<Head>
<title>Test Options in Forms with ooRexx - Mircea 21.10.2006</title>
<SCRIPT LANGUAGE="Object Rexx">

::routine deleteOne public -- DOES NOT WORK !!!
-- window~alert("deleteOne")
if document~all~testform~testselect~options
~length > 3 then
document~all~testform~testselect~options
[3] = .nil
else window~alert("Cannot delete: Less than 4 elements in the list")
return 1

::routine deleteAll public -- works !!!
-- window~alert("deleteAll")
-- set length to zero, fastest solution - ONLY FOR TEST PURPOSES !!!
document~all~testform~testselect~options
~length = 0
return 1

::routine insertOne public -- works !!!
-- window~alert("insertOne")
i = document~all~testform~testselect~options
~length
-- window~alert(i)
sel_elem = document~all~testform~testselect
option = document~createElement("OPTION")
option~text = "Inserted "||i
option~value = "Inserted "||i
sel_elem~add(option) -- insert value at the end of the list (
add )
return 1

::routine changeOne public -- works !!!
-- window~alert("changeOne")
if document~all~testform~testselect~options
~length > 3 then
document~all~~testform~testselect~option
s[3]~text = 'Overwritten'
else window~alert("Cannot modify: Less than 4 elements in the list")
return 1

::routine showOne public -- works !!!
-- window~alert("showOne")
if document~all~testform~testselect~options
~length > 3 then do
opt0 = document~all~testform~testselect~options
[3]~text
window~alert(opt0)
end
else window~alert("Cannot show: Less than 4 elements in the list")
return 1

::routine howMany public -- works !!!
-- window~alert("howMany")
i = document~all~testform~testselect~options
~length
window~alert("There are "i" elements")
return 1

</SCRIPT>
</HEAD>
<BODY>
<p><b>Test Options in Forms with ooRexx</b></p>

<form name="testform">
<select name="testselect">
<option value="first">first option</option>
<option value="second">second option</option>
<option value="third">third option</option>
<option value="fourth">fourth option</option>
</select>
</form>

<p> <input type="button" value="Delete 4th" onclick="call deleteOne"
language="Object Rexx">  
<input type="button" value="Delete All" onclick="call deleteAll"
language="Object Rexx">  
<input type="button" value="Insert One" onclick="call insertOne"
language="Object Rexx">  
<input type="button" value="Show 4th" onclick="call showOne"
language="Object Rexx">  
<input type="button" value="Change 4th" onclick="call changeOne"
language="Object Rexx">  
<input type="button" value="How many " onclick="call howMany"
language="Object Rexx">
</p>
</body>
</HTML>
-- CODE END ---

rony schrieb:

> Hi Mircea,
>
> Mircea wrote:
>
> this is totally untested, but usually replacing the dot with a tilde (~) and replacing "null" with
> ".nil" does the trick. So I would suggest to try out:
>
>
> document~forms['form1']~sel~options[3] = .nil
>
>
>
> document~forms['form1']~sel~options[3]~t
ext = 'Overwritten'
>
>
> Please let us know whether this has helped you.
>
> Regards,
>
> ---rony


rony

2006-10-22, 7:04 pm

Hi Mircea,

> 1. Your solution to overwrite the text part is working:
> document~forms['form1']~sel~options[3]~t
ext = 'Overwritten'


Fine.

[Sometimes you need to explicitly query the value object (by sending the message "value" to the
DHTML object).]


> 2. Deleting an item is not working:
> document~forms['form1']~sel~options[3] = .nil


The documented way of removing an option from a select(ion) list in DHTML is to use the "remove"
method, hence you need to code instead:

document~forms['form1']~sel~options~remo
ve(3)

In your supplied HTML text and DHTML code you need to use for the same reason:

document~all~testform~testselect~options
~remove(3)


Cf. MS documentation at
<http://msdn.microsoft.com/library/d...nce/methods.asp> and
pick the "remove" method.


> I will download and install ooRexx 3.0.1 and try again ( some
> errors corrected in OLE ).


Please wait until the refresh for ooRexx 3.1.0 comes out (in the next two ws) which will take
care of a nasty bug in its OLE-supporting code (empty values cannot be assigned to OLE objects in
that build). That version indeed has additional bug fixes that are related to the OLE support,
thanks to Mark Miesfeld.

HTH,

---rony
Mircea

2006-10-23, 4:07 am

Hi Rony,

thank you again, remove is working perfect.

I will wait until the refresh for ooRexx 3.1.0 comes out.

Regards,
Mircea

rony schrieb:

> Hi Mircea,
>
>
> Fine.
>
> [Sometimes you need to explicitly query the value object (by sending the message "value" to the
> DHTML object).]
>
>
>
> The documented way of removing an option from a select(ion) list in DHTML is to use the "remove"
> method, hence you need to code instead:
>
> document~forms['form1']~sel~options~remo
ve(3)
>
> In your supplied HTML text and DHTML code you need to use for the same reason:
>
> document~all~testform~testselect~options
~remove(3)
>
>
> Cf. MS documentation at
> <http://msdn.microsoft.com/library/d...nce/methods.asp> and
> pick the "remove" method.
>
>
>
> Please wait until the refresh for ooRexx 3.1.0 comes out (in the next two ws) which will take
> care of a nasty bug in its OLE-supporting code (empty values cannot be assigned to OLE objects in
> that build). That version indeed has additional bug fixes that are related to the OLE support,
> thanks to Mark Miesfeld.
>
> HTH,
>
> ---rony


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com