Hi team,
I want to display a refresh button in a interface after upload action(record action item) takes place.It should not be displayed when the interface loads. I tried using a!refreshVariable but it is not working as the variable is always true as in value field. can anyone tell any ways of achieving this?
Thanks in advance.
Discussion posts and replies are publicly visible
What is the purpose of this "refresh" is there any background action you are waiting for?
yes , i am putting some logic inside refresh button to query some data and append to existing rule input.
What kind of UI are we talking about? Normal site pages do not use rule inputs.
Can you put some intense light on your use case?
This is not site page. This is child interface which is called from different objects like PM, expression rule, other interfaces etc..
OK. I really need to ask this again. Do you start some activity in the background and want to allow the user to refresh to see whether this activity is completed?
If this is the case, you will have to query the status of that activity and display the button according to its progress.
Sorry, what i need is that after the user clicks on the upload button( this is a record action item in the interface which starts a process model with start form which uploads some data to db), once this process ends it should show the refresh icon in the interface so that the user clicks it and see the updated data in the grid.
This is difficult, if not impossible to implement using a record action. The problem is that a record action cannot return any values.
Now, how long do you expect that upload, or maybe import, to run in the background. I mean, if this takes longer, you can use a process report to check for the process status and show that refresh button as long as the process is active.
Thanks for your reply, i understand it but is there any other workaround using localVariables and showWhen we can achieve this? like by default the refresh button should not be visible as the localVariable is false when the interface loads and once the user clicks on the upload action, the variable changes to true and hence makes the refresh button visible?
Now i just wanted to know if it is possible to change the localVariable to true after the "RECORD_ACTION" using a!refreshVariable(refreshAfter: "Record_Action", value:true) or something like this.
Unknown said:This is difficult, if not impossible to implement using a record action. The problem is that a record action cannot return any values.
RefreshAfter "RECORD_ACTION" makes it pretty easy IMHO.
a!localVariables( local!formLoadTime: now(), local!lastRecordActionTime: a!refreshVariable( value: now(), refreshAfter: "RECORD_ACTION" ), local!isActionRun: local!formLoadTime <> local!lastRecordActionTime, /* then use the above boolean to determine other on-form behavior, like showing/hiding components etc */ ... )
Thank you so much Mike Schmitt, It worked!!!
Mike Schmitt , that's a nice trick I will keep in mind, but I wanted to understand the actual problem.
If there is that process running in the background, I would have wanted to show that refresh button only as long as that process is active. And on clicking, I would have wanted to display the status of it.
Agreed, and it also seems as if the user here might be trying to solve a problem via brute-force "refresh button" that should be inherently solved by properly chaining through the necessary write nodes of the Record Action and then refreshing the local data afterwards (though i believe refreshAfter RECORD_ACTION is also the most likely tool to help us with this, apart from some of my other / older tricks).