Question
NJ Courts
US
Last activity: 4 Dec 2018 21:24 EST
Writing a page to clipboard
Hello,
I have a ClipboardPage myPage with some content, and I would like to write it to Clipboard, I see various methods such as Create, Remove, and Put a property value, but I don't see a method for a writing a complete page to the Clipboard?
Any idea?
Thanks,
Pradeep
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi, when you create a clipboard page it is already written to the clipboard. I am not sure what you are trying to achieve so could you elaborate your use-case.
In general following command creates a clipboard page (in baseclass) and you can add properties as needed:
ClipboardPage myPage = tools.createPage("@baseclass", "");
NJ Courts
US
I'm trying to create a top level page for a page list item from JSP.
So I got the page list item to a ClipboardPage object using the getPageValue and now I need to write this ClipboardPage object to the Clipboard.
Pegasystems Inc.
US
Since you are using JSP, one way to do it is running an activity from there to write it to clipboard so that the server gets the data and shows up in the clipboard.
NCS Pte Ltd
SG
If you want to crate any new page and want to set any value on to that page. please find sample steps below.
ClipboardPage myPage = tools.createPage("@baseclass", "");
String Label="Test";
myPage.putString("pyLabel",Label);
NJ Courts
US
Thanks for your quick reply, and this is something I know. My requirement is to write a complete page to the Clipboard, not just putting a property value onto the Clipboard.
Pegasystems Inc.
US
I think you are looking for the "copy" command since it takes a whole page and copies to a new clipboard page:
ClipboardPage targetPage = sourcePage.copy();
Hope it helps!
NJ Courts
US
No I tried that too, it just copies the data to another ClipbaordPage object, not to the actual Clipboard.
Pegasystems Inc.
PL
If it isn’t client side use case I’m pretty sure you need to copy the list item using Page-Copy and then Rename this page to give it the top level name. It is possible that you will need to use Java code to copy the page as the java api allows you to copy it with specifiyng read-only param (item.copy(false,false))
This should give you named top level page which will be the copy of page list item.