cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2159
Views
0
Helpful
5
Replies

Has anyone used a Button to trigger ISF Code

Daniel Faust
Level 1
Level 1

Has anyone used a Button to trigger ISF Code

RequestCenter 2008.3
Oracle 10g
Websphere 6.1
IE6 & IE7

Hello:

The documentation specifies that a button can trigger a javascript instead of opening a browser window.  Has anyone done this?

Below is the section of the documentation that I am referring to.

Thank you
Daniel
Safeway Inc.

Designers can specify a caption (text to appear on the button)
and a URL. The URL can point to a JavaScript function or to
an external page accessible elsewhere on the network.

When referring to an external web page, use the fully qualified URL.
The URL may point to a JavaScript function, available in a library,
or embed JavaScript code
. Form data cannot be included in the
parameters, if any, included in a function call. However, the function can include ISF.

5 Replies 5

Hi Daniel,

First you'll need a dictionary field to contain the button. Add this dictionary to your Active Form Component.

Then in ServiceDesigner, go to Active Form Components, select your form, go to Display Properties tab, select the field, and check the "Add a Button" checkbox. Also enter the appropriate Button Text. Then In the URL field, enter "javascript:myFunction();" without the quotes, where myFunction is the name of your JavaScript function.

Tylor Hagerman
Level 1
Level 1

We do this in many services and it works fine.  You just need to reference a function that is defined in a JS library that is already referenced by the service.

Daniel Faust
Level 1
Level 1

Thanks all for the information - this works now.

I added an onLoad script
myfunction(a)
{
if (a==1)
{...}
}

for the active component url I put
javascript:myfunction(1);

This function loads with the service and fires when the button is clicked.

Thanks again for the assistance
Daniel

David Matta
Level 1
Level 1

As a follow-up question, I followed this advice and have a form that has a field followed by a button on a new dictionary. I am looking for a way to hide the field, but keep the button (I don't want to show the field, just the button). Any thoughts? Is this possible?

Yes, it's possible, David.  You just have to create a javascript function that runs onLoad and hide that field. 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: