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

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

Best Practice for Handling Either Dropdown or TextField Input (Exclusive Selection)

MA8731174
16-Pearl

Best Practice for Handling Either Dropdown or TextField Input (Exclusive Selection)

Hello ThingWorx Community,

I'm currently working on a use case where a customer can either select a value from a dropdown or manually type a custom value into a text field. The idea is to give users flexibility in providing input.

Here’s the intended logic:

  • If the user selects a value from the dropdown and leaves the text field empty → the selected value is passed to a service.

  • If the user enters a value in the text field and leaves the dropdown empty → the typed value is passed to the same service.

  • If both fields are filled, the service should not execute. Instead, a status message should inform the user to only fill one field.

  • If neither field is filled, the service also should not execute and prompt the user.

I'm currently thinking to use an expression function to validate the input combination and trigger a service on button click accordingly.

 

Before I finalize this logic, I’d love to hear your thoughts:

  • Would there be a more elegant way to handle this validation and control flow (perhaps with validators or service parameter bindings)?

Appreciate any suggestions or shared experiences!

Thanks in advance,

ACCEPTED SOLUTION

Accepted Solutions

I have used validator and expression and it worked well and as expected. 

View solution in original post

1 REPLY 1

I have used validator and expression and it worked well and as expected. 

Announcements


Top Tags