2022.02.09 11:34 PM
Good day KX Dashboard guru,
Still new to do dev work in KX Dashboard. A simple question, Say I have a Text Field (map to a value that would pick up data from Q service) and a Text Box, after enter the value in Text Box, I would click on the submit button, the button would have 2 type of action
{[newDict;oldDict]
/ newDict: Contains list of items that I want to update
/ oldDict; Contains list of items that exists in the Dashboard
}
Everything is working as expected, however the text field remains unchange until I refresh the page, is it something that t I need to add to the code snipplet above to force the Text Field to pick up the new value?
Cheers
Tat
2022.02.10 10:53 AM
Hopefully the following helps:
For every viewstate we can populate : Default and Value
When the page loads, the default field is used to populate the value field.
Therefore, here in this circumstance, we need to override the value field.
Solution:
If using a viewstate mapping we can override the viewstate value on page load.
1. In the query editor, write a query to get the saved dictionary back from the backend
2. execute the query
3. There will be 3 tabs : Results, Mappings and Raw Output
4. In Mapping, click on the plus icon and map the value returned in the query to your dictionary viewstate
5. This viewstate will have the new value from the backend now
Thanks,
Leah
2022.02.10 10:42 AM - edited 2022.02.10 10:49 AM
Hello @ahtat78
Welcome to the KX Community!
Great content here, thank you for sharing with us.
Happy Coding,
Leah
2022.02.10 10:53 AM
Hopefully the following helps:
For every viewstate we can populate : Default and Value
When the page loads, the default field is used to populate the value field.
Therefore, here in this circumstance, we need to override the value field.
Solution:
If using a viewstate mapping we can override the viewstate value on page load.
1. In the query editor, write a query to get the saved dictionary back from the backend
2. execute the query
3. There will be 3 tabs : Results, Mappings and Raw Output
4. In Mapping, click on the plus icon and map the value returned in the query to your dictionary viewstate
5. This viewstate will have the new value from the backend now
Thanks,
Leah
2022.02.11 12:50 AM
Thank you Leah! Let me give it a try and let you know the result
Tat
2022.02.14 02:20 AM
Hi Leah,
I am still working on it 🙂 would accept as solution once I have it resolved and the result posted here
Cheeers,
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.