Has anyone used a Button to trigger ISF Code

Unanswered Question
Nov 17th, 2011

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.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 0 (0 ratings)
Enrico Pagayucan Thu, 11/17/2011 - 18:16

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 Thu, 11/17/2011 - 18:16

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 Thu, 11/17/2011 - 18:16

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 Thu, 11/17/2011 - 18:16

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?

ChrisMMorris Wed, 02/01/2012 - 07:49

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

Actions

Login or Register to take actions

This Discussion

Posted November 17, 2011 at 6:16 PM
Stats:
Replies:5 Avg. Rating:
Views:866 Votes:0
Shares:0

Related Content