52
Views
6
Comments
Solved
Enable dropdown field with Yes/No option.

Hi everyone,

New to Outsystems :')

I am intending to enable my "Name (if report on behalf)" field when "Are you reporting on behalf" is switched to Yes. Else it will stay disabled. I think there is a need to have an onchange action but I am not sure how it works. It will be great if someone can guide me through the steps to complete my requirement. 

Thank you.

Reference:

mvp_badge
MVP
Rank: #18
Solution

Hi Alvin,

First of all SpecialListValue is deprecated, consider to use SpecialValue

Try this:

  1. Create a local variable to your screen call it OnbehallfSelectedValue data type integer
  2. Set the SpecialValue propertyto this new local variable
  3. On the AppointmentUser Droplist set Visible to an expression OnbehallfSelectedValue = 1
  4. In the Action Change_Yes_No add an AjaxRefresh widget and select AppointmentUser.

That should do it.

Regards,

Daniel


mvp_badge
MVP
Rank: #18

Hi Alvin,

Are you building a traditional web app or a reactive web app?

Regards,

Daniel

mvp_badge
MVP
Rank: #18
Solution

Hi Alvin,

First of all SpecialListValue is deprecated, consider to use SpecialValue

Try this:

  1. Create a local variable to your screen call it OnbehallfSelectedValue data type integer
  2. Set the SpecialValue propertyto this new local variable
  3. On the AppointmentUser Droplist set Visible to an expression OnbehallfSelectedValue = 1
  4. In the Action Change_Yes_No add an AjaxRefresh widget and select AppointmentUser.

That should do it.

Regards,

Daniel


mvp_badge
MVP
Rank: #18

Hi,

You can find the answer to conditional styling in this old post:

https://www.outsystems.com/forums/discussion/14468/css-color-dynamic/ 

Regards,

Daniel