Ok… so I have a very simple portlet. All it has is a drop down and submit button.
If the drop down has more than one value the user must select one and hit submit. Submit will take them to a new page and pass the drop down value as a parameter
However…
If the drop down has < 2 values I would like that “redirect” (the Submit action) to happen automatically.
Can I:
perform this redirect (call a hidden command, perhaps) from an action?
perform an action based on the value returned from a WS?
I think the last thread that I posted on JavaScript validation would help you in this area. You would evaluate when CAF.model(“#{activePageBean.clientIds[‘your item to use here’]}”).raise();
But instead of raise you could do a clicked/or submit from there
Now you want this script block to run only when your dropdown has < 2 elements. You can achieve this by conditionally render script block based on the size of your list for dropdown