Problem changing to R view from LABKEY.QueryWebPart

LabKey Support Forum (Inactive)
Problem changing to R view from LABKEY.QueryWebPart Will Holtz  2015-11-12 15:55
Status: Closed
 
Hi,

I have a webpart that contains the following:

<div id='RunsDiv'/>

<script type="text/javascript">
Ext4.onReady(function() {
    var qwp1 = new LABKEY.QueryWebPart({
        renderTo: 'RunsDiv',
        schemaName: 'assay.hplc.HPLC-Assay',
        queryName: 'Runs',
        buttonBar: {
            includeStandardButtons: true
        }
    });
});
</script>

From an instance of this webpart, I am able to change to different table views. If I try changing to an R view, then the table disappears, but it is not replaced with the output of my R view. On my javascript console I get the following error:

GET http://localhost:8080/project/home/HPLC/LABKEY/ext4/ScriptReportPanel.js?_dc=1447372276556 404 (Not Found)

Is there something more I need to add to my webpart to support R views? or is this a bug?

I am running v15.2 (without the August update).

thanks,
-Will
 
 
Will Holtz responded:  2015-11-12 15:58
I forgot to mention that for the purposes of a test case, the R view is just the default R view code that is contained in a new R view (spits the table back out).

-Will
 
Jon (LabKey DevOps) responded:  2015-11-13 14:25
Hi Will,

For the R-View to render, it needs to be utilized in a WebPart rather than a QueryWebPart.

Take a look at my example here. I used the default Importable Study we provide on LabKey.org and ran it locally:

<div id='RunsDiv'/>

<script type="text/javascript">

Ext4.onReady(function() {
    var qwp1 = new LABKEY.WebPart({
    partName: 'Report',
        renderTo: 'RunsDiv',
    containerPath: '/home/Importable Study',
        partConfig: {
        reportId: 'db:26',
        showSection: 'labkeyl'
        }
    });
qwp1.render();
});
</script>

The R view in question is coming from the Lab Results table in my study schema. If I access that R report directly, I can see the ID number of that report ID via my URL:

http://localhost:8080/labkey/study/home/Importable%20Study/dataset.view?datasetId=5007&Dataset.reportId=db%3A26

And if I go to the Source Tab of my R view, I can see the image being called is labkeyl due to the filename being indicated as: png(filename="${imgout:labkeyl}", width = 650, height = 480);

Note: It's optional for me to provide the containerPath or the showSection. Also, I could have written the same code above using jQuery like:

<p> ${labkey.webPart(partName='Report', showFrame='true', reportId = '26', showSection='labkeyl')} </p>

Configure the above code a try and see how that works out for you.

Regards,

Jon



References:

https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.WebPart.html
https://www.labkey.org/wiki/home/Documentation/page.view?name=wikiInsertExamples
 
Will Holtz responded:  2015-11-13 14:57
Hi Jon,

Thanks for the reply. It appears my original (two) posts failed to make my problem clear. I have a LABKEY.QueryWebPart on a custom page. By default this QueryWebPart displays a table. I'd like for users to be able to make use of the 'View' button that is part of the QueryWebPart and switch back and forth between various views of the data, including one or more R-views. I had assumed this was part of the functionality of a QueryWebPart, since it lists associated R views in the View button drop down by default.

-Will
 
Jon (LabKey DevOps) responded:  2015-11-13 15:12
Hi Will,

I will confirm this, but from what I understand, the R view is considered to be a Report rather than a Query, which would explain why a QueryWebPart would prevent it from rendering. Query results always render as a grid, as opposed to the R view, which would make sense as to why it doesn't render.

I'll circle back with you once I get this confirmed.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2015-11-13 16:47
Hi Will,

So this may in-fact be a bug. I am trying to get some additional details sorted out though, specifically certain fields that are available under the WebPart API but not QueryWebPart API when it comes to Reports.

Thank you for your patience.

Regards,

Jon
 
Will Holtz responded:  2015-12-08 11:47
Hi Jon,

Did you get a chance to look into this any further? Thanks!

-Will
 
Jon (LabKey DevOps) responded:  2015-12-08 12:41
Hi Will,

It is indeed a bug, but I hadn't created it yet since I was trying to get the full scope of the issue. Specifically, if this problem is more than just R since our JavaScript docs look like they might have a problem as well.

Let me get some confirmation on this and I'll get the bug made.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2015-12-14 11:20
Hi Will,

Sorry for the delay. The bug https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=25130 has been created to further investigate this issue.

Regards,

Jon
 
Will Holtz responded:  2015-12-14 11:25
Great -- thanks!

-Will
 
Jon (LabKey DevOps) responded:  2016-02-28 18:49
Hi Will,

Just an FYI, this has been fixed in our upcoming 16.1 release of LabKey next month.

Regards,

Jon
 
Will Holtz responded:  2016-02-29 07:59
Thanks Jon -- I look forward to trying it out!

-Will