0

I have a page with 3 different items:

list of values: resource list of values: status Text field (which will be converted to a hidden item later on)

Whenever the user selects a checkbox on the IR, the row id value of the selected row goes into the Text Field item. It concatenates as necessary. Thing is, I'm trying to add a dynamic action that enables or disables a button based on these 3 items described initially, like this:

Dyn Action: on change of my 3 items (on true) Javascript expression to enable:

$v("my_text_item").length > 2 && ($v("my_resource_lov") != "" || $v( 
"my_status_lov" ) != "" )

Javascript expression to disable:

$v("my_text_item").length > 2 && ($v("my_resource_lov") == "" && $v( 
"my_status_lov" ) == "" )

But it doesn't work. I tested it out on the console and it runs perfectly (true or false when needed). Anyone knows why?

Thanks

1 Answer 1

1

You want the button to be disabled when (1) one of the 3 events occurs and (2) a combination of values meets a certain condition. There are 2 ways to do this - well probably more but here are 2.

The "old" way. Create an on-change dynamic action for each of the 3 events with a disable action that has a javascript condition you described. Downside is that you have an identical action for all 3 dynamic actions which could be a maintenance issue.

The "modern" way. Create an on-change dynamic action for each of the 3 events with a javascript true action that triggers a javascript event. Create a 2nd dynamic action that acts on the event with a disable action that has a javascript condition you described. A similar technique is described in this post.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.