Page 1 of 1
Formatting parms in the onclick event
Posted: Fri Jul 01, 2011 12:31 pm
by nwhite1114
I have a program where a user can select a division. I want to pass that division to another software program(Sequel Viewpoint) that I am calling through a URL in an onclick event.
I have tried to create a hidden dynamic output field, REVURL, and have binded this to my program where I populate REVURL with the URL and correct parm. In the onclick event, I have - window.open(REVURL). But when I click on the hyperlink, it tells me REVURL is undefined.
What do I need to do to make this work?
Re: Formatting parms in the onclick event
Posted: Fri Jul 01, 2011 5:34 pm
by David
The DDS field names have no meaning in JavaScript.
To access their contents in JavaScript, you need to give them an HTML element id using the "id" property in the designer.
When you convert a screen, the DDS conversion automatically assigns the ids to match the DDS field names. For new screens you can assign it manually.
Then, you can use Profound UI's get() JavaScript function to retrieve the value from the element, given its id.
For example, to open a new window using the contents of a field with the id "REVURL" as the URL:
Note that HTML element ids are case sensitive.
Re: Formatting parms in the onclick event
Posted: Wed Jul 13, 2011 5:11 pm
by nwhite1114
I tried that, but the problem I am having now is that it appends a prefix to the front of my link.
So, where the link should be:
http://home.duprelogistics.com:80/SEQUE ... 6DIVCOD=CE
it is:
http://10.1.10.5:8080/profoundui/%22htt ... 6DIVCOD=CE"
Re: Formatting parms in the onclick event
Posted: Thu Jul 14, 2011 3:49 am
by amc
looks like you have a stray " at the start of the url you are putting in REVURL in your rpg code
else you have a stray " in the javascript where you get("REVURL")
either way, the result is that the browser pre-pends the internal address to the url being opened
remove the stray " and it should work
Re: Formatting parms in the onclick event
Posted: Thu Jul 14, 2011 11:10 am
by nwhite1114
Thanks. I had double quotes inside the link and then I had double quotes in the get command. I removed one of the sets of double quotes and it worked.
Thanks again!