Posts: 1,275
Threads: 135
Joined: Dec 2010
Dean,
I'm trying to make a reusable list for variable driver stringlist types.
I want to pass in the address to the list.
Here is an example of what I'm passing on invoke popup:
"$(SystemState.IrrigationPrecipHistory)","Precip History"
On the popup template under preload I have:
Data::SetDblBrowserList
P1=%(LVar:CQCActParm_1)
LVar:CQCActParm_2 is the title
So far it's not working. Is this even possible? See anything I'm doing wrong?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Each of those lists should be a quoted comma list, separated by a newline though they themselves shouldn't be quoted. So something like:
"Title 1", "Title 2", "Title 3"\n"Value 1", "Value 2", "Value 3"
And the new line has to be an actual new line, whereas I just used \n to represent one in the text above.
When you set it, do this:
Data::SetDblBrowserList(%(LVar:CQCActParm_1, "^1"))
The "^1" formatting string prevents the expanded value of the variable from being processed any further, which would mess with the new line.
Dean Roddey
Explorans limites defectum
Posts: 1,275
Threads: 135
Joined: Dec 2010
06-29-2016, 02:05 PM
(This post was last modified: 06-29-2016, 02:12 PM by zra.)
Still having trouble with this. Let me back up a little.
The stringlist fields that I have are mostly quoted lists with a date and data. The macro just adds the object to a string array and then writes the array to the variable driver stringlist field.
"1/1/2001",".01","1/2/2001",".02","1/3/2001",".03" etc
You lost me when you started talking about newlines etc. Is that something I must do in order to make what I was doing work?
The reason I question it is because before I got the idea to make the template reusable whereby I pass the variable driver stringlist field into the template, I had a different template for each different data set that I was wanting displayed. I, therefore, just preloaded into the template the stringlist field and that was working. Like this:
Data::SetDblBrowserList($(SystemState.IrrigationPrecipHistory))
It's only when I attempt to pass it as a parameter into the "reusable" template that I'm getting errors. Clear as mud?
Posts: 40,483
Threads: 491
Joined: Aug 2002
These double lists are two quoted comma lists separated by a new line. The gotcha is that, if the value is processed in the usual way that an action command is processed, that will trash the new line. Any time you reference a variable that holds these types of lists, use the format I mentioned above, i.e.:
%(GVar:MyDblList, L"^1")
That will prevent the expanded value from being processed any further. Use this when you dereference the variable.
I'm not sure why your previous scheme worked, though you were getting it from a field and not as a variable. But still, generally the field value would have been expanded then another pass made to do any further processing that might have become available now on that expanded field value. The same happens with variables. If you do, in any action command parameter:
%(GVar:MyDblList)
then the value is expanded out, and then another pass is made to see if there's any further processing to be done. Generally this whacks the newline.
Dean Roddey
Explorans limites defectum
Posts: 1,275
Threads: 135
Joined: Dec 2010
"^1"
isn't making a difference.
I even simplified my data set down to one pair "1/1/2016", ".01" to test and it's not working.
Posts: 40,483
Threads: 491
Joined: Aug 2002
That definitely wouldn't work if you calling the command to set a double list. That takes two quoted comma lists, separated by a new line. Your example above is a single quoted comma list. If you just want to load a single list, there's another command for that.
Double lists are for when you want to have one list for the visible text, and another list that provides a behind the scenes value for each of the visible text values. So it's two lists of the same size, separated by a new line.
The single line one is something like SetBrowserList(). There's another, SetBrowserList2() that sets the visible/behind the scenes values as two separate lists. SetDblBrowserList is mostly for when getting a list from a driver that has to pass it as one chunk of text, but needs to provide two lists.
Dean Roddey
Explorans limites defectum
Posts: 1,275
Threads: 135
Joined: Dec 2010
06-29-2016, 04:38 PM
(This post was last modified: 06-29-2016, 04:40 PM by zra.)
Ok. I'm trying that.
In the invoke popup call, is this correct for the parameters?
"$(SystemState.IrrigationPrecipHistory)", "Precip History"
Specifically, do I need to quote: $(SystemState.IrrigationPrecipHistory)?
Posts: 40,483
Threads: 491
Joined: Aug 2002
What are you trying to do here? Do you want to put both those things into the list such that they are visible? or do you want one visible and the other not? And what's the content of that field? Does the field itself contain a quoted comma list? If so, and you just want to see those values, then don't pass anything but that, i.e:
MyBrowser::SetBrowserList($(SystemState.IrrigationPrecipHistory, "^1"))
allowing for errors because I'm typing this from memory. If it contains a quoted comma list, that would set the values in that list you get from the field as the entries in the list browser.
Dean Roddey
Explorans limites defectum
Posts: 1,275
Threads: 135
Joined: Dec 2010
06-29-2016, 05:17 PM
(This post was last modified: 06-29-2016, 05:20 PM by zra.)
The second parameter is just the title of the template. This is in the preload of the template.
Data::SetBrowserList
P1=%(LVar:CQCActParm_1,"^1")
Title::SetText
P1=%(LVar:CQCActParm_2)
Here is the call to the invoke template:
IntfViewer::InvokePopup
P1=\\User\\Support\\Configurable\\List
P2=$(SystemState.IrrigationPrecipHistory) "Precip History"
P3=-1 -1
Posts: 40,483
Threads: 491
Joined: Aug 2002
Have you used the action trace to see what you are actually getting, when you run this template? That will help you figure out a lot of issues. Is anything actually showing up in the command to set the browser list?
Dean Roddey
Explorans limites defectum
|