cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

thingworx mashup how to disable a button if a value returned from a service is false

mahitejg
11-Garnet

thingworx mashup how to disable a button if a value returned from a service is false

 
1 ACCEPTED SOLUTION
9 REPLIES 9

Use a Validator widget, create an input for it and check with expression input=false, then bind the Boolean output of the widget to Disabled input of the Button widget

mahitejg
11-Garnet
(To:zyuan1)

Is there any place  I can read about validator in detail. my scenario is to read a property  from  a thing and validate it using the validator

slangley
23-Emerald II
(To:zyuan1)

Hi @mahitejg.

 

If you of the responses provided by @zyuan1 has allowed you to solve your issue, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Thank you for using our Community!

 

Regards.

 

--Sharon

mahitejg
11-Garnet
(To:zyuan1)

Hi  @zyuan1 I am able to execute the validator but it only works once when i click one button it disables the other but for some reason it does not refresh back when I hit the second button

In your question description you just mentioned one button controlled by service result, what's your second button here for?

 

You can change the Validator expression to follow your business logic.

mahitejg
11-Garnet
(To:zyuan1)

@zyuan1 I have two buttons which are start and stop I just want the functionality in such a way where  when one starts the system and other stops it  when I applied 2 validators which read the property and validate the states of these buttons the issue, however, is this process is only happening once even when I checked the auto evaluate property of the  mashup I'm unable to work it out 

When the decision process is complex, you could draw a work flow chart including [input value] [expression] [trigger event] [result] to check why it failed.

 

Another way around, since you need 2 buttons, you could also try the CheckBox widget (Boolean) or RadioButton widget (state definition with 2 String type, OPEN / CLOSE). Carefully design the validator expression and it could be easier than using 2 Buttons.

slangley
23-Emerald II
(To:zyuan1)

Hi @mahitejg.

 

If you have found a solution to your problem, please post it here or mark one of the existing replies as the Accepted Solution for the benefit of others with similar issues.

 

Regards.

 

--Sharon

Top Tags