Pages

Wednesday, June 30, 2010

Open documents in a traditional form from XPage View Control

Follow the following procedure in order to create links with in the XPage View Control Panel which will help u open up documents associated with the links in traditional notes environment rather than in xpages.

1. Create an XPage
2. Drag and drop a view control on to it and ensure that the view you embedded previews fine
3. Select the view control, go to the all properties section ->data >var . Mark this value as "rowData" case sensitive as illustrated in the following figure.


4. Now select the column where u would like to see the links to open the document in notes client (form - document environment)
5. In the properties pane, select the Data tab and click "computed value", as illustrated in the following figure


6. Now key in the following code in to the scripting section.

if (!rowData.isCategory())
"<a href='notes://serverName/dbPath/0/"+rowData.getUniversalID()+"?OpenDocument'>"
+rowData.getColumnValue("columnName")+"</a>"


*change the bolded values to match ur requirement


7. Now select the View Column tab. In the Column Display Properties, Select Content-type as "HTML" as illustrated in the following figure.
8.Now save and preview the page. You will be able to see your views with links that upon clicking will open the associated documents in the traditional way.

Hope this Helps :)

2 comments:

  1. >> 3. Mark this value as "rowData" case sensitive as illustrated in the following figure.

    the case sensitive part is sadly *not* illustrated in the following figure, and darned if I could find it. Why is it important?

    Also how do you make this work for web?

    ReplyDelete
  2. Hi Randal,

    Of course rowData is case sensitive, XPages are associated with JSF backend and hence are case sensitive. I just got it through my head, so it just did not occur to me that I should mention that :)

    And about the web part, if you are speaking about opening a form on the web(traditional webform and not through XPages... if thats what you mean....), just replace the word notes:// to http:// in the url that I have mentioned in the post and it should work

    let me know if that has answered your question :)

    ReplyDelete