Lapas

Saturday 10 April 2010

Embedded view from External DB

1. Standard method replacing replicaid in form using dxl.
2. Advanced method using forms, frameset and embedded editor.

You have 2 databases, form1 (db1) and view1 (db2) which should be displayed. How to make it without composite applications and DXL tools?

Simply:
1. Create frameset1 in db1 with 2 frames, Top and Bottom. Make top frame 1 Pixel height.
2. Create empty form in db1, let's call it Form1Embed, set it to open in frameset1 Top frame.
3. Create form or page in db2, let's call it Form2Embed. Add embedded view1 to this form. Then add simple code in postopen:
dim ws as new notesuiworkspace
dim uidoc as notesuidocument
set uidoc=ws.currentdocument
'// fill some field with universal id of uidoc.document, then set single category from this field for view1
What this code do? the uidoc we get is parent document (form1).

3. Embed Form1Embed in form1 through embedded editor.
4. In frameset1 Bottom frame compute db2 path and our created element Form2Embed (that Form2Embed could be opened)

Now what happeps when you open form1?
1. form1 is loaded
2. Embedded editor loaded for form1embed, lotus opens this form in frameset1 top frame, which is not visible. Then computes Bottom frame with our form2embed from db2, which on load gets form1 document and uses it unid as single category key.


No comments:

Post a Comment