Is there a way to retain CDT values on page reload/refresh?

Certified Associate Developer

I have a requirement in an application to retain values even if use refresh or reload the page. 

Is there a way to retain CDT values on page reload/refresh?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    More info is needed in order to help with this - for instance, what "page" are we talking about?  Are you talking about using the hard refresh in-browser (like hitting F5), or some internal refresh button/link on the interface?  What CDT values are you talking about and where are they currently being stored?  Can you give a big picture overview of the current behavior in a bit more detail, and what you would hope could happen instead?

  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    Thanks for the response!

    Actually, I have an application where the user is attempting an entry test with some questions and a timer. While the user is answering questions, if a hard refresh is performed, it should be in the same position like his answers should remain there and not lost and timer should be at the same time.

  • 0
    Certified Lead Developer
    in reply to ahmedh0001

    If the user's data inputs are saved into Rule Input variables during a task in a live process instance, then doing a hard refresh will cause the browser to ask the user to confirm they want to leave the current page.  If the user insists, then I don't know of any easy functionality by which to prevent their data from being cleared.  One fairly easy way to prevent this is to allow a user to save in-progress form values, which is built in functionality.

  • 0
    A Score Level 1
    in reply to ahmedh0001

    I guess the best solution (even though it is not a best practice) is that once the user enters a value, you do a do "saveInto" with a!writeToDataStoreEntity.

    I have never tried, but I guess this should work.

                          a!textField(
                            label: "",
    ...
    ...
    saveInto: a!writeToDataStoreEntity( dataStoreEntity: cons!APP_DS_FORM, valueToStore: ri!myCDT, ... ) )

  • 0
    Certified Lead Developer
    in reply to ManuelHTG

    Agreed, this could potentially work, though it requires, perhaps, exponentially more manual setup and manual upkeep.  A slightly stronger solution might be to give a soft "save" button (not the default OOB one) that saves a CDT value to the DB when the user chooses; though using the same manual approach could also submit the task, save the values to PVs, then reopen the task which would perhaps be better.