Page 1 of 1
PDF in a new pop up window
Posted: Sun Jul 14, 2013 11:58 am
by dpankowski
I just started using UI last week. I have my first project almost done. In order to demo it to managment, I need to have a .pdf pop up in a seperate window that can be moved and resized. Also I have images I want the user to be able to resize, now they are fixed. These are scanned a/p invoices, so some of the them are hard to read unless to can expand them.
Thanks
-dan
Re: PDF in a new pop up window
Posted: Sun Jul 14, 2013 1:16 pm
by dpankowski
I was able to use an onClick
for the hyperlink:
{
window.open("
http://socadmin:8090/profoundui/userdata/rvi/pcard.pdf");
}
This works but, I need to change the url it's opening. The hyperlink will be in a grid, so the url will be different in each sfl record.
Thanks
Re: PDF in a new pop up window
Posted: Mon Jul 15, 2013 12:07 am
by Scott Klement
The ID's in a grid are suffixed by the row number. The row is passed in a variable (named 'row') to your onclick code.
Profound UI provides an API named get() that's an easy way to retrieve the value of an element. The parameter to get() is the ID of the element to retrieve. (Note that ID may be different from the bound variable name, depends on how you coded it. Also, ID is case-sensitive.)
So, for example, if you had a button in a subfile that needs to retrieve the contents of a field that has the ID of 'ItemNo" from the same subfile record, you can do this:
Code: Select all
window.open("/profoundui/userdata/rvi/item" + get("ItemNo." + row) + ".pdf");
Even though you assign the ID 'ItemNo' to the subfile record, Profound UI will automaticalyl add a dot followed by row number, so the first row is "ItemNo.1", the second row is "ItemNo.2", and so forth. So we build the ID name on the fly with "ItemNo." + row to get the same subfile row as the one that has been clicked. Then, we pass that to get() to get the value of the ITemNo field, and use it to build a URL to pass to window.open().
Make sense?
Re: PDF in a new pop up window
Posted: Mon Jul 15, 2013 4:32 pm
by dpankowski
Thanks Scott,
That work perfectly!
Thanks again
-dan