So, I'm inclined to use OnCreateResultSet property but I can't refresh my dataListBox after a user makes changes on the page.
<dataListBox id="dlbCSub"
OnCreateResultSet="DLBRelationsContent"/>
and
Method DLBRelationsContent(Output tSC As %Status, pInfo As %ZEN.Auxiliary.QueryInfo) As %ResultSet
{
Set tRS = ""
Set tSC = $$$OK
if $Get(%session.Data("TableName"))
{
Set tFROM =$Get(%session.Data("TableName"))
}
else
{
Set tFROM ="Relationships"
}
s sql = "SELECT ID, Name FROM "_tFROM_" WHERE Context="_%session.Data("CurrConID")_"ORDER BY Name"
Set tRS = ##class(%ResultSet).%New()
Set tSC = tRS.Prepare(sql)
Set pInfo.queryText = sql
Quit tRS
}
Is it the right way to supply dataListBox with changing data (%session variables)?
If so, I need to refresh it as a user, for example, has chosen something in another list or typed data into a textfield.
Something like that, but it's not working. Please correct my mistake.
onchange="zenPage.setSessionVariabes();
and
ClientMethod setSessionVariabes() [ Language = javascript ]
{
zenPage.SetSession();
zenPage.getComponentById('dlbCSub').executeQuery();
zenPage.getComponentById('dlbCSub').refreshContents();
return;
}
Method SetSession() [ ZenMethod ]
{
s %session.Data("TableName")=..TableNameIs(%page.%GetComponentById("fsLink").value)
q
}
But after changing nothing happens...
I suppose I incorrectly try to refresh my dataListBox.
Cache 2012.
Thank you for your precious help!