Formatting parms in the onclick event

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
nwhite1114
New User
Posts: 14
Joined: Tue Nov 10, 2009 5:43 pm
First Name: Natalie
Last Name: Kondratenko
Company Name: Dupre Logistics
Phone: 337-314-2304
Address 1: 201 Energy Parkway
Address 2: Suite 500
City: Lafayette
State / Province: Louisiana
Zip / Postal Code: 70508
Country: United States
Contact:

Formatting parms in the onclick event

Post 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?
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Formatting parms in the onclick event

Post 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:

Code: Select all


window.open(get("REVURL"));

Note that HTML element ids are case sensitive.
nwhite1114
New User
Posts: 14
Joined: Tue Nov 10, 2009 5:43 pm
First Name: Natalie
Last Name: Kondratenko
Company Name: Dupre Logistics
Phone: 337-314-2304
Address 1: 201 Energy Parkway
Address 2: Suite 500
City: Lafayette
State / Province: Louisiana
Zip / Postal Code: 70508
Country: United States
Contact:

Re: Formatting parms in the onclick event

Post 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"
amc
Profound User
Posts: 67
Joined: Thu Jul 29, 2010 1:25 am
First Name: Tony
Last Name: Cusack
Company Name: Welding Industries
City: Adelaide
State / Province: Outside Canada/USA
Zip / Postal Code: 5139
Country: Australia
Location: Adelaide, South Australia
Contact:

Re: Formatting parms in the onclick event

Post 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
nwhite1114
New User
Posts: 14
Joined: Tue Nov 10, 2009 5:43 pm
First Name: Natalie
Last Name: Kondratenko
Company Name: Dupre Logistics
Phone: 337-314-2304
Address 1: 201 Energy Parkway
Address 2: Suite 500
City: Lafayette
State / Province: Louisiana
Zip / Postal Code: 70508
Country: United States
Contact:

Re: Formatting parms in the onclick event

Post 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!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest