Search Support
-
Cindy ChastangMay 6, 2016 at 12:03 pm #1719
I have a coach with multiple tabs. On the first tab the user enters some data into a table. Then on the last tab I want to take values from that table and use them as the items in a Single Select control. I have set up the Items configuration of the single select to Items from Configuration. I select my list and set up the appropriate data mapping. It works beautifully as long as the user has saved and closed the coach before they get to the last tab. If they go straight through then there are no items in the list to chose from.
The same thing happens for the multi-select control.
It feels like the items only get loaded when the page loads and it doesn’t recognize changes in the data.
I am using SPARK UI (4.2.1.1 – 8.5.7 CE)
SPARK SupportMay 6, 2016 at 2:12 pm #1720Hey Cindy,
Thanks for you question. Would you be able to provide some screen shots of your setup and code so I can assist you better?
Thanks,
Elliot P.
Cindy ChastangMay 9, 2016 at 7:24 am #1725Sure – Here are screen shots of the single select configuration.
Cindy ChastangMay 11, 2016 at 8:24 am #1732This is in 8.5.7 – I have a twx file I can send that has just the 2 fields if you would like to see that.
EQuintanillaMay 11, 2016 at 4:05 pm #1735Hey Cindy,
I have a solution for you, but it requires a few addition steps. First I would change the variable that is bound to the Single Select to a NameValuePair, this way you can set both the display name and value of the data. I added a Service Call control to the coach with an Ajax service that takes the data from the table and returns a list of NameValuePair.
In the Service Call, I bound it to the new list of NameValuePair, and set the Input Value to the “roleChoice” object. The Ajax service runs a simple script to set the name and value:
tw.local.results = new tw.object.listOf.NameValuePair();
for(var i = 0; i < tw.local.data.listLength; i++){
tw.local.results[i] = new tw.object.NameValuePair();
tw.local.results[i].name = tw.local.data[i].text;
tw.local.results[i].value = tw.local.data[i].text;
}Then, in the OnChange event of the text control inside the table I called the execute method of the Service Call:
${../Service_Call}.execute();
I then changed the variable that is bound to the Single Select from the list of String to the list of NameValuePair object.
I’m using a button to create a new line item for the table:
${Table}.appendElement({});
I hope this works with what you’re trying to accomplish,
Erick Quintanilla
Cindy ChastangMay 12, 2016 at 10:31 am #1746I tried your solution – but it still is not working as I expect.
The list of items to choose from in the single select does not update when new records are added to the table. I ran it through the debugger and can see the list of Name Value Pairs getting updated from the Service Call. But the new values do not appear in the single select.
I’m attaching screenshots – the stock Single Select is showing what I expect. Both controls bound to the NVP list.
EQuintanillaMay 12, 2016 at 12:58 pm #1755My mistake, I don’t think I mentioned the configuration options of the Single_Select control. Set the “Item Lookup Mode” to “Items from Static List”, then bind the “Item List” to the list of NameValuePair. I’m attaching a screen shot of how I set mine up.
Cindy ChastangMay 12, 2016 at 1:16 pm #1757I notice your configuration options are slightly different than mine. I wonder if you are using a more recent version of the toolkit than what I have. I am attaching a screen shot of my configuration and of the toolkit.
It feels like that configuration should work – but it doesn’t.
Brian FrenchMay 12, 2016 at 2:31 pm #1760Hi Cindy,
Since you are with IBM, you have access to Enterprise which has a newer version available for 8.5.7. Is it possible for you to upgrade?
Cindy ChastangMay 13, 2016 at 12:08 pm #1787My team just got the new version this morning. We have upgraded and your solution works. Thank you for your help.
-
|
You must be logged in to reply to this topic.