- The Dynamic Action must have a condition
- The condition must evaluate to false
It sounds simple enough but this important fact seems to loose itself on those that are new to Dynamic Actions. Even when this fact is understood, developers may still have trouble getting the false actions to fire because they can't think of a condition that will work for their situation. The key lies in understanding conditions and how flexible they can be.
Let's start by looking at a simple example. Let's say you want to hide/show a region based on the value of an item:
The When portion of the Dynamic Action may look like:
Obviously the true action in this case is to show the region and the false action would be to hide the region. In this example we were able to make use of one of the declarative condition types: "equal to". Here are all of the options you have for the condition:
If you select "- No Condition -", guess what, NO FALSE ACTIONS! At that point only the event matters - in our current example that's the change event on the item P1_HIDE_SHOW. The Dynamic Action framework does a good job of making this point obvious by hiding the false actions when there is no condition but I wanted to make sure to remind readers of this fact here.
Let's look at another example. Here the show/hide is based on two conditions rather than one:
I could have simply hard coded the id for the first element but I wanted to show how one could use this.triggeringElement as it's more flexible - imagine using it in a tabular form where there are many checkboxes with "random" ids.