KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Solutions Update Text Field in Dashboard once button is clicked

  • Update Text Field in Dashboard once button is clicked

    Posted by ahtat78 on February 10, 2022 at 12:00 am

    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

     

    ahtat78 replied 9 months, 1 week ago 2 Members · 2 Replies
  • 2 Replies
  • leahs

    Member
    February 10, 2022 at 12:00 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 

  • ahtat78

    Member
    February 14, 2022 at 12:00 am

    Hi Leah,

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

    Cheeers,

Log in to reply.