Hey @nickduxfield
I think you can help me solve my issue regarding disabling buttons.
I have a screen which has 2 buttons:
AcceptButton and RejectButton [I have attached the scrren below]
When the customer is using this screen,
eg: If he clicks on AcceptButton the first time,the AcceptButton and RejectButton should be disabled and in the same case if he clicks on RejectButton the first time, the rejectbtton and acceptbutton should be disabled... he can only go back by presseing GO BACK button below.
Please help!
Thank you.
In the OnSelect property for your Accept and Reject buttons use an UpdateContext to set a variable to true, use the same variable for both buttons.
UpdateContext({buttons_off: true})
Then in the OnSelect property for your GOBACK button add:
UpdateContext({buttons_off: false})
Now set your DisplayMode property in both your accept and reject buttons to use the variable, buttons_off.
Hey thanks for the reply:
As you instructed:
on select property: I have done the same thing for reject button as well.
Go back button on select property:
Im getting an error in Displaymode:
What do I need to do?
Thanks.
Each button has it's own OnSelect. Do it like this:
For Accept button OnSelect
UpdateContext({buttons_off: true});
Patch(Your patch commands....
Then do the same for your Reject button's OnSelect.
Thenfor your Go Back button OnSelect:
UpdateContext({buttons_off: false});
Navigate(LoginScreen, Fade)
Now, for your Accept button's DisplayMode:
If(buttons_off, DisplayMode.View, DisplayMode.Edit)
Do the same for your Reject button.
That should do it. Your syntax with UpDate({AcceptButton: false, RejectButton: False...... is very wrong. That's where the errors are coming from.
If he clicks on AcceptButton the first time
in addition to your action to your database to confirm accept/reject you need to add this to the button properties.
AcceptButton.onselect =
UpdateContext({varActionButtons:false})
,the AcceptButton and RejectButton should be disabled and in the same case
AcceptButton & RejectButton .visibility field set to the contect variable varActionButton
When any button is selected it toggles variable between true false.
The .visibility field toggles visibility using true/false.
he can only go back by pressing GO BACK button below. (back meaning unlock buttons, not navigation)
UpdateContext({varActionButton:true})
Go back can unlock the accept/reject controls allowing another choice, and when unlocked,
could double as a navigate away to another screen. based on a safety dialogue box with a
'are you sure you want to go back?'
GoBack Button
Switch(varActionButtons,
true,UpdateContext({varActionButtons:false,varBackDialogueBox:true})
/*If pressed while action buttons visible, it means go back*/
,false,UpdateContext({varActionButtons:true}))
/*If pressed while action buttons are hidden, they become visible and active.
Dialogue box YES Button
UpdateContext({varActionButtons:false,varBackDialogueBox:false});Back()
No
UpdateContext({varActionButtons:true,varBackDialogueBox:false})
I trust you understand the concept,
further questions can be asked
User | Count |
---|---|
144 | |
97 | |
89 | |
78 | |
56 |
User | Count |
---|---|
194 | |
185 | |
105 | |
99 | |
91 |