Various quantity parameters of tablePane
I have a tablePane. TablePane can have one, or two, or three parameters. It depends on some conditions.
At first I add all three parameters to tablePane.
set p1 .id = ..id1
do table.parameters.Insert(p1 )
do %page.%AddComponent(p1 )
set p2 = ##class(%ZEN.Auxiliary.parameter).%New()
set p2 .id = ..id2
do table.parameters.Insert(p2 )
do %page.%AddComponent(p2 )
set p3 = ##class(%ZEN.Auxiliary.parameter).%New()
set p3 .id = ..id3
do table.parameters.Insert(p3 )
do %page.%AddComponent(p3 )
Then through javascript I set parameters values and query names.
If there is one parameter, I set
If there are two parameters:
table.setProperty('queryName', 'QueryWithTwoPars');
If there are three parameters:
table.setProperty('queryName', 'QueryWithThreePars');
Example of class queries
{
SELECT ID FROM Table WHERE (Field1 %STARTSWITH :par1)
}
Query QueryWithTwoPars(par1 As %String, par2 As %String) As %SQLQuery
{
SELECT ID FROM Table WHERE (Field1 %STARTSWITH :par1 AND Field2 = :par2)
}
Query QueryWithThreePars(par1 As %String, par2 As %String, par3 As %String) As %SQLQuery
{
SELECT ID FROM Table WHERE (Field1 %STARTSWITH :par1 AND Field2 = :par2 AND Field3 = :par3)
}
But this approach isn't working. After table.executeQuery the tablePane is empty. What I do wrong?
And how I can implement such approach, where tablePane can have various quantity of parameters?