XPages, How to built a dinamic link on a Xpage view

Hi all,

I have a view (mydocuments.xps) which contain some links to documents. I would like to use those links adding some custom javascript like the example below:

onclick="myJavascriptFunction(‘Name Surname’,‘address’,‘15935462258824040025734600376E54’);

I put the javascript on viewColumn → Events field and set the column as link on column properties.

But what I get on the browser’s page is:

<a onclick="myJavascriptFunction(‘Name Surname’,‘address’,‘15935462258824040025734600376E54’);

class=“xspLinkViewColumn” href=“/xx/xx/mydb.nsf/%24%24OpenDominoDocument.xsp?documentId=5BAFBEC6C4EA527AC12576B3005C48E9&action=editDocument” id=“view:_id1:viewPanel2:4:viewColumn6:_id8”>Name

And if you click on it an error page will be displaied while the browser is looking for the link specified on href insted of use the onclick event.

How can I customize my link on a xpages view?

Subject: Re: XPages, How to built a dinamic link on a Xpage view

I assume you’re using a View Container Control rather than a repeat control. The repeat control offers much greater flexibility in presentation and manipulation, e.g. inserting Link Controls etc.

The “Show values in this column as links” means it adds a link to open the relevant document in either read or edit mode. It doesn’t just make it a hyper-link for you to handle what event is fired. One option is to remove the tick from “Show values in this column as links”, set the content type to HTML, set “Display data using” to a computed value and build your link manually. You can only show a column value or a computed value in a View Container control.

Subject: Thanks

Thanks, as suggested by you here a code snippet of my link:

return “<a onclick="copySoggettoIntestatarioID('”+rowData.getColumnValue(‘cognome’)+" “+rowData.getColumnValue(‘nome’)+”‘,’‘,’“+rowData.getColumnValue(‘id’)+”‘);" href=’'>“+rowData.getColumnValue(‘nome’)+”"