Problem with Wiki page

LabKey Support Forum (Inactive)
Problem with Wiki page saravanan adaikkalavan  2015-06-10 08:16
Status: Closed
 
Hi,

   How can I include one wiki page into another? I followed the documentation to embed live content(https://www.labkey.org/wiki/home/Documentation/page.view?name=include). I followed the AJAX way to include the page. But, It just shows the replication of the current page in the specified div. My new wiki page has HTML, CSS and Javascript contents.

To be more specific is the code I'm using

var test = new LABKEY.WebPart({
   partName: 'Wiki',
   renderTo: 'test_container',
   name: 'test_page',
});
test.render();

And, test_page is in the same directory as the page I'm having this code.

Thanks!
 
 
Jon (LabKey DevOps) responded:  2015-06-10 13:23
Hi Saravanan,

"test_page" isn't actually the directory, but the name of the actual wiki itself.

Your code is telling the page to render the wiki page called "test_page" into the Div Tag called "test_container".

For example, that URL you referenced here:

https://www.labkey.org/wiki/home/Documentation/page.view?name=include

That actual wiki page has the name of "include", so if I wanted to embed that into another wiki page, I would have written the code like this:

var test = new LABKEY.WebPart({
   partName: 'Wiki',
   renderTo: 'test_container',
   name: 'include',
});
test.render();

And it would populate in my Div Tag that has the id called "test_container".

Does that make more sense?

Regards,

Jon
 
saravanan adaikkalavan responded:  2015-06-11 06:03
Jon,

   Even I'm referring the test_page as the Wiki page only. What I meant to say was that test_page resides in the same directory as the page which is invoking it. I followed the same way which you have specified. My web page contains a query part and 2 button below that. I have attached a reference screenshot for you. The result I'm getting is that the same page gets embedded in the test_container instead of the test_page. I have checked that using firebug as well.

You inputs would be very helpful in this issue.

Thanks!
 
Jon (LabKey DevOps) responded:  2015-06-11 10:56
HI Saravanan,

Can you send us your code that you're having issues with? (Edit: Please send us the entire wiki code you're using on that page, not just a snippet).

From the looks of things, it appears you have two webparts within that wiki page.

Regards,

Jon
 
saravanan adaikkalavan responded:  2015-06-11 11:00
Yes Jon. I have query web part and I'm trying to embed Wiki web part as well in the same page.

Thanks!
 
Jon (LabKey DevOps) responded:  2015-06-11 11:25
Thanks for confirming this Saravanan.

Can you send me your full wiki page code you're using so I can better troubleshoot the issue you're having?

Regards,

Jon
 
saravanan adaikkalavan responded:  2015-06-11 12:26
Can you give your email id so that I can send you the code?
 
Jon (LabKey DevOps) responded:  2015-06-11 12:36
Hi Saravanan,

You have access to the URMC project, which you can drop your code there as a text file:

https://www.labkey.org/project/URMC/File%20Transfer/begin.view?

Or you can create a ticket for this and attach your code there:

https://www.labkey.org/project/URMC/Support%20Tickets/begin.view?

Unless your code has PHI data or other sensitive information in it, there shouldn't be any worry about providing the code to us here.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2015-06-15 21:50
Hi Saravanan,

So I looked over your VariantSelection.html file and it looks like there was a slight error in the code.

It looks like the partConfig: was missing in the code in the bottom section of the query. So instead of:

                name: 'popup_redirect',

It should actually be:

                partConfig: {name: 'popup_redirect'},

Reference: https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.WebPart.html

Also, the last line that has "initiateRedirect(mainURL);" actually has no reference in the rest of the code, so you will need to define it.

Otherwise, just make the change to partConfig and you should see it display correctly.

Regards,

Jon