cancel
Showing results for 
Search instead for 
Did you mean: 

How to Open TableView link in new window (which opens PDF on the fly )

Former Member
0 Kudos

Hi Can any one help me how to open TableView link in new window. This new window is PDF which gets created on the fly by calling bapi from JSPDyn Bean.

I used OnClientClick() event in bean but results page disappears.

And even I have tried using onClientClick() taglib event in <hbj:Link> but it says there is no even attribute of that type.. As this is very urgent issue.....I need any expert guidence soon..

Regards,

Joseph

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Joseph,

the HTMLB link object misses the support for onClientClick through the tag lib, see and for similiar problems and workarounds.

With this workaround, you can call for example an AbstractPortalComponent, implement doOnNodeReady (with an empty doContent method) and return the PDF, settings the content type on the http before etc.

Hope it helps

Detlev

PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

Former Member
0 Kudos

Hi Detlev,

From component I'm calling a method in bean which creates PDF from tableview link. Please clarify me if i use AbstractPortalComponent how can i open PDF in new window on clicking tablview link.

Even after keeping generate method of PDF creation in AbstractPortalComponent how can i open the link in new window. Please give me some more hints.

Thanks,

Joseph

detlev_beutner
Active Contributor
0 Kudos

Hi Joseph,

directly call the component from the link. You can use the portal URLGenerator to create the link target, which then you can use within some small JavaScript within onClientClick. That means: OnClientClick is a small JS fragment, calling window.open(<your target-url to your APC>);

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev,

Thanks for your suggestion.

But i'm facing problem with dynamic data.

I'm able to open pdf with static data in new window from AbstractPortalComponent which i have written the code to generate pdf in doContent method.

But I'm unable to communicate with bean, in which i'm calling BAPI and assigning the values to PDF.

Can you please guide me how to call values from Bean to doContent method in AbstractPortalComponent.

Or else please let me know how can I access bean values in AbstractPortalComponent.

Thanks,

Joseph

detlev_beutner
Active Contributor
0 Kudos

Hi Joseph,

if you have put your bean for example into the component session and are calling a different component now (your APC, called from a different component, for example a JSPDynPage component), you cannot access it. So you will have to put the bean into some "wider" container. For the PRT implementation does not offer something like an application session (which would be great in this place), you'll have to use the HttpSession as the container to which both components have access to.

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev,

Thanks for your valuable suggestions.

I have done this in another way to open pdf in new window.

This is how i have done...

linkID.setClientEvent(EventTrigger.ON_CLICK,"javascript:window.open('/irj/servlet/prt/portal/prtroot/Services.CreatePDF?linkID="+linkID.getId().toString() +"');");

It has worked fine

Thanks and Regards,

Joseph

Answers (0)