cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ACL: alias hooked to a menu item

Level 1

ACL: alias hooked to a menu item

If have an alias hooked to a menu item something like this
menu_add ".Menu." "MenuItem" -cmd {openUI;}

Where openUI is an alias looking similar to this
alias openUI {
$insertTag = oid_caret();
$insertPos = oid_caret_pos();
$xulState = LREClient::GetXulState();
# Start our GUI with a java call

}

This opens a java GUI

Now while this Java GUI is open and I try to select the same Menu Item again, I get the Error: "Reference to undefined alias: openUI

Has anyone an idea why ?
Or how I could catch this error, so I can tell the user that there's an active Java window, that needs to be closed first

Tia

René
Tags (2)
8 REPLIES 8

alias hooked to a menu item

<br /><br />You could try just making the GUI modal,<br />so you can’t select the Menu item again until the GUI is closed.<br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br />From: Rene Single<br /> <br /><br />Sent: Wednesday, April 18, 2007<br />8:14 AM<br /><br />To:<br />Adepters@maillist.arbortext.com<br /><br />Subject: ACL: alias hooked to a<br />menu item<br /><br /><br /><br /> <br /><br /><br /><br /><br /><br />If have an alias hooked to a menu item something like this <br /><br />menu_add ".Menu." "MenuItem" -cmd {openUI;} <br /><br /><br /><br />Where openUI is an alias looking similar to this <br /><br />alias openUI { <br /><br />$insertTag = oid_caret(); <br /><br />$insertPos = oid_caret_pos(); <br /><br />$xulState = LREClient::GetXulState(); <br /><br /># Start our GUI with a java call <br /><br /><br /><br />} <br /><br /><br /><br />This opens a java GUI <br /><br /><br /><br />Now while this Java GUI is open and I try to select the same Menu Item again, I<br />get the Error: "Reference to undefined alias: openUI <br /><br /><br /><br />Has anyone an idea why ? <br /><br />Or how I could catch this error, so I can tell the user that there's an active<br />Java window, that needs to be closed first <br /><br /><br /><br />Tia <br /><br /><br /><br />René &gt;&gt; To unsubscribe from the list, send an email to<br />listmanager@maillist.arbortext.com with the following in the body: unsubscribe<br />adepters - For additional information on the adepters list (how to subscribe or<br />unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the<br />following in the body: info Adepters - You may also go to forums.arbortext.com,<br />enter the Adepters folder and change your subscription options and<br />preferences.&gt;&gt; <br /><br /><br /><br />

alias hooked to a menu item

Benton, Ed L schrieb:
>
> You could try just making the GUI modal, so you can’t select the Menu
> item again until the GUI is closed.
>
I haven't been able to achieve this so far :-(
If I use the java_static_modal ACL provides, it succeeds the first time,
but fails in my Java code the second time. I'm using an embedded
mozilla, that doesn't seem to like the way it is called by ACL. I'm
looking into this issue on the java side as well, but I'm looking for a
workaround for this...

alias hooked to a menu item

I know that XUI can be made modal very easily, with the modal="true" attribute on the <window> tag.
You might want to try switching from Java GUI to XUI and referencing javascript functions within the XUI, with buttons or check boxes with a
You can reference the javascript (.js) file as an entiity declaration within the XUI, like this:
]>. Just put the .js file in the same directory as your XUI.

Just a suggestion/random thought.

alias hooked to a menu item

Benton, Ed L schrieb:
> I know that XUI can be made modal very easily, with the modal="true" attribute on the <window> tag.
> You might want to try switching from Java GUI to XUI and referencing javascript functions within the XUI, with buttons or check boxes with a
> You can reference the javascript (.js) file as an entiity declaration within the XUI, like this: >
> ]>. Just put the .js file in the same directory as your XUI.
>
> Just a suggestion/random thought.
>
>
Thanks for your ideas, but it is not as easy as that. I'm generating the
complete Java GUI (a wizard) dynamically via data obtained in an RDF
that is obtained via a server call. I have no idea whether something
like this is possible with XUI. So basically the Data from the server
determines the look of the wizard

alias hooked to a menu item


Rene, this may not be related to your issue: My general advice would be
to stay away from aliases, use a function instead. Aliases are an old construct
with many limitations and odd peculiarities.

/ K J

On Wed, 18 Apr 2007 09:43:59 -0400, "Benton, Ed L" <-> said:
> I know that XUI can be made modal very easily, with the modal="true"
> attribute on the <window> tag.
> You might want to try switching from Java GUI to XUI and referencing
> javascript functions within the XUI, with buttons or check boxes with a
>
> You can reference the javascript (.js) file as an entiity declaration
> within the XUI, like this: > XML 1.1//EN" "xui.dtd" [
> > NAME GOES HERE].js">
> ]>. Just put the .js file in the same directory as your XUI.
>
> Just a suggestion/random thought.
>

[BULK] Re: alias hooked to a menu item

Hi Rene--

XUI dialogs can definitely be dynamically generated and updated via scripts. So, you shouldn't have any problem executing your RDF query and using the result to add appropriate controls to the dialog via javascript, if you choose to go that route. Just add a script to your window that executes on windowload, so it can run the query, digest the results, and create the appropriate controls by adding them dynamically to the XUI document tree.

I'm not sure exactly what kind of controls are in your dialog, but most of the usual controls are available in XUI. XUI isn't as flexible as say Swing, so if you're doing fancy stuff you might have trouble porting it over to XUI. If you're wondering about specific controls, check the Customizing Guide in the doc directory, which explains how to use XUI and the available controls.

--Clay

alias hooked to a menu item

We use the following to ensure our java dialogs stay modal on top of Epic.

importPackage(Packages.java.awt);

importPackage(Packages.java.awt.event);

importPackage(Packages.javax.swing);




//create a function object, required to create java anonymous inner

var java_function = {eventDispatched: function (event) {

var source = event.getSource();

if (source instanceof JDialog){


source.setAlwaysOnTop(true);

}

}};


var listener = new AWTEventListener(java_function);

var toolkit = Toolkit.getDefaultToolkit();

toolkit.addAWTEventListener
(listener, AWTEvent.PAINT_EVENT_MASK);

Not sure if it'll help you, but might give you some ideas.

keith

On 4/18/07, Rene Single <
rene.single@tanner.de
> wrote:
Benton, Ed L schrieb:
> I know that XUI can be made modal very easily, with the modal="true" attribute on the <window> tag.

> You might want to try switching from Java GUI to XUI and referencing javascript functions within the XUI, with buttons or check boxes with a <script> tag in them, sort of like this:
> <script type="application/x-jscript" ev:event="DOMActivate">[JAVASCRIPT FUNCTION NAME GOES HERE];</script>

> You can reference the javascript (.js) file as an entiity declaration within the XUI, like this: >

> ]>.Just put the .js file in the same directory as your XUI.
>
> Just a suggestion/random thought.
>
>
Thanks for your ideas, but it is not as easy as that. I'm generating the

complete Java GUI (a wizard) dynamically via data obtained in an RDF
that is obtained via a server call. I have no idea whether something
like this is possible with XUI. So basically the Data from the server
determines the look of the wizard


Highlighted

alias hooked to a menu item

Karl Johan Kleist schrieb:
> Rene, this may not be related to your issue: My general advice would be
> to stay away from aliases, use a function instead. Aliases are an old construct
> with many limitations and odd peculiarities.
>
I tried to replace the alias with a function, but since the function
needs three parameters, that are different for each menu item, I need a
function that gets passed different values for each of thes menu entries.
So my function looks like this now:
function openUIAsFunction(URL, resource, type)

in the function I'm Creating my Menu I do this:

while(java_instance(itResource, "hasNext")) {
java_instance(itResource, "next");
local id = java_instance(itResource,
"getCurrentPropertyValue", "id");
if(id && id != ") {
if(iMenuAdded == 0) {
menu_add -menu -before .Help "$reusesMenuLabel";
}
local label = java_instance(itResource,
"getCurrentPropertyValue", "display-name");
local chromeURL = java_instance(itResource,
"getCurrentPropertyValue", "chrome-url");
local sResource = java_instance(itResource, "toString");
sResource = url_encode(sResource);
#response("url=". chromeURL. " sResource=". sResource .
" type=" . REF_REUSE)
# menu_add ".$reusesMenuLabel." "$label" -cmd {openUI
"$chromeURL" "$sResource" "$REF_REUSE";}
menu_add ".$reusesMenuLabel." "$label" -cmd
{openUIAsFunction( chromeURL, sResource, REF_REUSE);}
iMenuAdded++;
}

This gives correct results for theparameter values on call of the create
function, but when the Menuitem is invoked, the parameter values are
empty. I guess this is because the parameter values are not bound to the
function call.
So my question is now, how would I do this with a function needing
parameters ?


> / K J
>
> On Wed, 18 Apr 2007 09:43:59 -0400, "Benton, Ed L" <-> said:
>
>> I know that XUI can be made modal very easily, with the modal="true"
>> attribute on the <window> tag.
>> You might want to try switching from Java GUI to XUI and referencing
>> javascript functions within the XUI, with buttons or check boxes with a
>>
>> You can reference the javascript (.js) file as an entiity declaration
>> within the XUI, like this: >> XML 1.1//EN" "xui.dtd" [
>> >> NAME GOES HERE].js">
>> ]>. Just put the .js file in the same directory as your XUI.
>>
>> Just a suggestion/random thought.
>>
>