in a wiki page I put the following in order to load a QWP:
${labkey.webPart( partName='Query', showFrame='false', schemaName='lists', queryName='genetics_pricing', containerPath='/WNPRC/WNPRC_Units/Research_Services/Genetics_Services/Public', allowChooseQuery='false', allowChooseView='false' )}
this works find when loading this wiki from the same container as that list. however, when I try to load it from a different container it says 'list genetics_pricing not found'. according to the API page, containerPath should be accepted by a webpart.
does containerPath refer to the location of the webpart, and not the query itself? do I need to pass something like:
partConfig={containerPath="../"}
can I pass nested config options like that in a wiki? |
|
eknelson responded: |
2010-07-26 15:57 |
Hi Ben,
Adam is the expert on web part insertion, but he's partly offline this week. In the mean time, I have a partial answer for you. There's no guarantee that the wiki web part insertion syntax accepts the same parameters as the LABKEY.WebPart API. That may be the source of your bug. At present, the schemaName/queryName/containerPath combo is not doc'ed as being a valid set of paramters for wiki web part insertion.
Instead, the docs ( https://www.labkey.org/wiki/home/Documentation/page.view?name=webPartConfig) recommend using webPartContainer. From the doc page:
webPartContainer - - The ID of the container where the wiki pages live. If this param is not supplied, the current container is used. You can obtain a container's ID by using the containerId.view action in the admin controller. For example, to obtain the container ID for the Documentation folder on labkey.org, go to the following URL: https://www.labkey.org/admin/home/Documentation/containerId.view . The container ID appears as a hex string, in this case: aa644cac-12e8-102a-a590-d104f9cdb538. If this param is not supplied, the current container is used.
Thanks,
Elizabeth |
|
Ben Bimber responded: |
2010-07-27 05:56 |
elizabeth,
unfortunately that did not work either. on the wiki webpart, you can already pick the target container when you load the page, which i suspect might be doing just that. the problem is not loading the wiki page itself, but the fact that loaded wiki page has an embedded list. that embedded list is not being found. if nothing better can be found, i could put javascript in the wiki page, but this substitution syntax is nice b/c it looks more 'normal' to users when they try to edit the rest of the page. it's been a while since i've done anything that involved writing code direct in labkey, but i remember having bad experiences with javascript in wikis constantly getting screwed up when toggling between the source and visual editor tabs.
for what it's worth, it might be convenient if there were a link in the admin menu (maybe under developer links?) for 'current container Id'. |
|
eknelson responded: |
2010-07-27 09:29 |
Ah. Here's the problem-- containerPath is not listed as one of the supported parameters for Query web part insertion:
https://www.labkey.org/wiki/home/Documentation/page.view?name=webPartConfig
Sorry, I had wikis on the brain and misread that you were inserting a wiki web part, not a query web part.
Thanks for suggesting the admin link for "current container ID" - would you have an estimate of how often you've needed to use this? My impression (could easily be wrong) is that this info would not used anywhere near as often as the other links in the dev menu.
Thanks,
Elizabeth |
|
Ben Bimber responded: |
2010-07-27 09:34 |
ok, so if containerPath is not supported, then can i get around it somehow? is putting javascript in the page my only remaining option?
i would say that the "current container ID" would be used only rarely. it was just an offhanded idea. it just seems like putting a link to that somewhere out of the way wouldn't be a terrible idea. you'd want to bury that a level or two deep in the menu, since it would only by used rarely. however, it's not at all high of my requested features list. |
|
eknelson responded: |
2010-07-27 09:42 |
Hi Ben,
I know of the following options for you (others can chime in if they know more):
1. If you wish to insert this list on a portal page, you can use the Query web part
https://www.labkey.org/wiki/home/Documentation/page.view?name=queryWebPart
2. Open a bug to request that Query web part insertion support containerPath
3. Use JavaScript.
Thanks for letting me know you aren't a frequent user of "current container ID". I still like the idea of adding the item to the dev menu in an unobtrusive way (e.g., as a submenu).
Thanks,
Elizabeth |
|
Ben Bimber responded: |
2010-07-27 09:46 |
ok, thanks. i think i will use javascript, since the hope was to make the wiki content plus an embedded QWP appear as one unit (ie. not a wiki above a QWP). javascript should work fine. |
|
|
|