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

Calling an ACL function from an XUI dialog

ptc-925411
1-Newbie

Calling an ACL function from an XUI dialog

I'm a complete
novice at both ACL and XUI, but I'm trying to learn. One of the things I'm
trying to learn is how to create my own file picker dialog. I'd like to
create a dialog box with a button that allows the user to select a file using a
standard file picker.


I have created a
dialog box in XUI (XUI is cool!), but I can't find a file picker for XUI.
I found one in ACL, though - file_selector. Can I call an ACL function
from a XUI button? I saw how to do that with Javascript in the customizing
guide, but it looks like you can't do this with ACL.


Any
advice?


Steve
5 REPLIES 5

Steven,

Yes, you can call ACL from a XUI button. The button element offers a
"command" attribute which is for ACL commands or functions. The problem
with this is that you won't get the file path back that you will want to
use (otherwise why have a file selector in the first place). You could
call an ACL function of your own creation from the command attribute
that calls the file picker function and then does something with the
returned path. There is another option that would probably be easier,
though.
You can call ACL functions and commands from JavaScript using the Acl
object. So in the script element associated with your button element you
would do something like:
var filePath = Acl.eval("file_selector()")
What you do with filePath at that point is up to you.
--
Brian Jensen

Kyoshinsha Co. Ltd.
brian@kik.co.jp
2-9-5 Morinomiya-chuo Chuo-ku
Osaka 540-0003 Japan
Tel: 81-6-6941-8881
Fax: 81-6-6941-1053


Steven Anderson wrote:
> I'm a complete novice at both ACL and XUI, but I'm trying to learn. One of the
> things I'm trying to learn is how to create my own file picker dialog. I'd like
> to create a dialog box with a button that allows the user to select a file using
> a standard file picker.
>
> I have created a dialog box in XUI (XUI is cool!), but I can't find a file
> picker for XUI. I found one in ACL, though - file_selector. Can I call an ACL
> function from a XUI button? I saw how to do that with Javascript in the
> customizing guide, but it looks like you can't do this with ACL.
>
> Any advice?
>
> Steve

<br /><br />Hi Steve—<br /><br /><br /><br /><br /><br /><br /><br />You can use the Acl.eval() javascript<br />function to do this. Here’s an example from one of our custom dialogs:<br /><br /><br /><br /><br /><br /><br /><br />&lt;button label="Browse..."&gt;<br /><br /><br /><br />&lt;script&lt;br/&gt;ev:event="DOMActivate" type="text/javascript"&gt;<br /><br /><br /><br />// Show file dialog and get result<br /><br /><br /><br />filename =<br />Acl.eval("file_selector('.','xml','XML files|*.xml|All files|*.*','Select<br />Document')");<br /><br /><br /><br />if (filename != null) {<br /><br /><br /><br /> dlgdoc =<br />Application.event.target.ownerDocument;<br /><br /><br /><br /> href =<br />dlgdoc.getElementById("href").firstChild;<br /><br /><br /><br /> if (href.firstChild != null)<br />href.removeChild(href.firstChild);<br /><br /><br /><br /> text = dlgdoc.createTextNode(filename);<br /><br /><br /><br /> href.appendChild(text);<br /><br /><br /><br />}<br /><br /><br /><br />&lt;/script&gt;<br /><br /><br /><br /><br /><br /><br /><br />The script pops up the dialog, and the<br />user can select a file. (If the user cancels, the function returns null.) Then<br />the script populates the associated text box (with id = “href”) with<br />the value selected.<br /><br /><br /><br /><br /><br /><br /><br /> --Clay<br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br />From: Steven Anderson<br /> <br /><br />Sent: Wednesday, September 20,<br />2006 9:50 PM<br /><br />To: adepters@arbortext.com<br /><br />Subject: Calling an ACL function<br />from an XUI dialog<br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br />I'm a complete novice at both ACL and XUI, but I'm trying to<br />learn. One of the things I'm trying to learn is how to create my own file<br />picker dialog. I'd like to create a dialog box with a button that allows<br />the user to select a file using a standard file picker.<br /><br /><br /><br /> <br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br /> <br /><br />I have created a dialog box in XUI (XUI is cool!), but I<br />can't find a file picker for XUI. I found one in ACL, though -<br />file_selector. Can I call an ACL function from a XUI button? I saw<br />how to do that with Javascript in the customizing guide, but it looks like you<br />can't do this with ACL.<br /><br /><br /><br /> <br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br /> <br /><br />Any advice?<br /><br /><br /><br /> <br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br /> <br /><br /> &lt;span&lt;br/&gt;style='font-size:10.0pt;font-family:Arial'&gt;Steve<br /><br /><br /><br /> <br /><br />&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 />


Look here, Steven:


An interesting feature, that I wasn't aware of until now. However,
it seems that the "command" attribute is supported by menu/toolbar buttons only.

On Thu, 21 Sep 2006 00:16:08 -0400, "Brian Jensen" <brian@kik.co.jp> said:
> Steven,
>
> Yes, you can call ACL from a XUI button. The button element offers a
> "command" attribute which is for ACL commands or functions. The problem
> with this is that you won't get the file path back that you will want to
> use (otherwise why have a file selector in the first place). You could
> call an ACL function of your own creation from the command attribute
> that calls the file picker function and then does something with the
> returned path. There is another option that would probably be easier,
> though.
> You can call ACL functions and commands from JavaScript using the Acl
> object. So in the script element associated with your button element you
> would do something like:
> var filePath = Acl.eval("file_selector()")
> What you do with filePath at that point is up to you.
> --
> Brian Jensen
>
> Kyoshinsha Co. Ltd.
> brian@kik.co.jp
> 2-9-5 Morinomiya-chuo Chuo-ku
> Osaka 540-0003 Japan
> Tel: 81-6-6941-8881
> Fax: 81-6-6941-1053
>
>
> Steven Anderson wrote:
> > I'm a complete novice at both ACL and XUI, but I'm trying to learn. One of the
> > things I'm trying to learn is how to create my own file picker dialog. I'd like
> > to create a dialog box with a button that allows the user to select a file using
> > a standard file picker.
> >
> > I have created a dialog box in XUI (XUI is cool!), but I can't find a file
> > picker for XUI. I found one in ACL, though - file_selector. Can I call an ACL
> > function from a XUI button? I saw how to do that with Javascript in the
> > customizing guide, but it looks like you can't do this with ACL.
--
Kleist IT Consulting, Karl Johan Kleist
Frankfurter Allee 45, DE-10247 Berlin

+49 30 42 01 70 91 (office)
+49 17 38 35 82 06 (mobile)

Maintainer of <http: adepters.org=">

Clay, thank you so much! Not only does that help me
with this particular problem, but it helps me understand the ACL command
better.


KJ, thanks for reminding me about adepters.org. I
need to peruse that more before asking these kind of
questions.


face=Arial color=#0000ff size=2>Steve





From: Helberg, Clay

Sent: Wednesday, September 20, 2006 9:17 PM
To:
adepters@arbortext.com
Subject: RE: Calling an ACL function from an
XUI dialog




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi
Steve-



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You can use the
Acl.eval() javascript function to do this. Here's an example from one of our
custom dialogs:



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><button <br="/>label="Browse...">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><script <br="/>ev:event="DOMActivate" type="text/javascript">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">// Show file dialog and
get result



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">filename =
Acl.eval("file_selector('.','xml','XML files|*.xml|All files|*.*','Select
Document')");



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">if (filename != null)
{



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> dlgdoc =
Application.event.target.ownerDocument;



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> href =
dlgdoc.getElementById("href").firstChild;



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> if
(href.firstChild != null) href.removeChild(href.firstChild);



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> text =
dlgdoc.createTextNode(filename);



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
href.appendChild(text);



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">}


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></script>


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The script pops up the
dialog, and the user can select a file. (If the user cancels, the function
returns null.) Then the script populates the associated text box (with id =
"href") with the value selected.



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
--Clay



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">





style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From: face=Tahoma size=2> Wednesday, September 20, 2006 9:50
PM
Subject:
Calling an ACL function from an XUI dialog


style="FONT-SIZE: 12pt">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm a complete novice at both ACL
and XUI, but I'm trying to learn. One of the things I'm trying to learn is
how to create my own file picker dialog. I'd like to create a dialog box
with a button that allows the user to select a file using a standard file
picker.




style="FONT-SIZE: 12pt">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have created a dialog box in XUI
(XUI is cool!), but I can't find a file picker for XUI. I found one in
ACL, though - file_selector. Can I call an ACL function from a XUI
button? I saw how to do that with Javascript in the customizing guide, but
it looks like you can't do this with ACL.




style="FONT-SIZE: 12pt">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any advice?



style="FONT-SIZE: 12pt">



style="FONT-SIZE: 12pt"> style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Steve


style="FONT-SIZE: 12pt">>> To unsubscribe from the list, send an email to
listmanager@maillist.arbortext.com with the following in the body: unsubscribe
adepters - For additional information on the adepters list (how to subscribe or
unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the
following in the body: info Adepters - You may also go to forums.arbortext.com,
enter the Adepters folder and change your subscription options and
preferences.>>


>> To unsubscribe from the
list, send an email to listmanager@maillist.arbortext.com with the following in
the body: unsubscribe adepters - For additional information on the adepters list
(how to subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com with the following in the body: info Adepters
- You may also go to forums.arbortext.com, enter the Adepters folder and change
your subscription options and preferences.>>
Announcements