best way to programmatically make a dataregion refresh?

LabKey Support Forum (Inactive)
best way to programmatically make a dataregion refresh? Ben Bimber  2011-06-15 12:41
Status: Closed
 
hi kevin,

maybe i have my labkey terminology off. i was under the impression that dataRegion referred to the labkey grid itself. a QWP is the wrapper around a dataRegion that is used if you embed a dataregion in a page. if you're loading executeQuery.view, this page has a dataregion, but no QWP. is this correct?

so perhaps i should alter the question. what i'd ideally like to figure out is some sort of code that i can put in a button handler that can execute and refresh the associated labkey grid, whether it is loaded via executeQuery.view or whether it is loaded using a QWP embedded in some other page. it could well be that 2 distinct paths are needed; however, the code would need some mechanism to figure out the context of the current grid and which path to execute. you are correct that if executeQuery is used, you could just refresh the page.

-the code could use LABKEY.ActionUrl to figure out what the current page is. if it's executeQuery.view, then it would trigger a page reload.
-if it's not executeQuery.view, then we assume it's embedded and we want to use AJAX. is there a good mechanism to obtain a reference to the associated QWP? as far as i can tell, the button handler is passed a reference to the dataregion only, and not directly a reference to the QWP. does a dataregion that is part of a QWP have a reference to that QWP? what about the reverse?

thanks.