Quantcast
Channel: SCN : All Content - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2935

Using Javascript in a Datawindow

$
0
0

Hi ,

I'm using Powerbuilder 11.5 and I'm trying to understand how the Javascript feature works with the datawindow.

So I have created a webservice , a method which returns html code from a retrieved datawindow and in the deployed server I have created also a folder which I called Javascripts and I intent to keep all the js files.

The concept is to create an HtmlDatawindow  with a button inside, return the "HTML" syntax and BIND the button I have placed with a Javascript.

I want when I press the button to display a messagebox , or open a file open dialog box.

For example take a look at my datawindow in the webservice

 

Capture.JPG

It has a button which says attach. In the lower right corner I have created using the wizard a default js file. I have deployed in the appropriate folder the js and now in my web service method I have added the below

lds_data.Modify &

    ("DataWindow.HTMLGen.UserJSFile=" +&

     "'http://localhost/mywebservice/JavaScripts/test.js'")  

 

Also in the web generation tab I have the below checked

 

Capture1.JPG

 

From here I'm kind of confused.

Where do I go next ? How can I bind the button click event with something in the javascript ? If want to call a method from the javascript when the user presses the button how can I attach it with my datawindow button ?

 

For the Js file I used the Common Javascript option and I have generated client events and scripts.

 

Any help on this would be mostly appreciated.

if you have any article where I can read how to implement this it would be the ideal.

 

thank you


Viewing all articles
Browse latest Browse all 2935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>