cancel
Showing results for 
Search instead for 
Did you mean: 

Update Text Field in Dashboard once button is clicked

ahtat78
New Contributor II

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 

  1. View State mapping - where I believe it would store the value
  2. Data source - that would do operation code snipplet would looks something like following

{[newDict;oldDict]

  / newDict: Contains list of items that I want to update
  / oldDict; Contains list of items that exists in the Dashboard

  t:cols[someTbl]#enlist oldRFDict^newRFDict;
  dosomething[]

 }

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

 

Tat
1 ACCEPTED SOLUTION

LeahS
Moderator Moderator
Moderator

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 

View solution in original post

4 REPLIES 4

LeahS
Moderator Moderator
Moderator

Hello @ahtat78

Welcome to the KX Community! 

Great content here, thank you for sharing with us. 

Happy Coding, 

Leah 

LeahS
Moderator Moderator
Moderator

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 

ahtat78
New Contributor II

Thank you Leah! Let me give it a try and let you know the result

Tat

Tat

ahtat78
New Contributor II

Hi Leah,

I am still working on it 🙂 would accept as solution once I have it resolved and the result posted here

Cheeers,

Tat