Reputation: 129
I want to hide a region and unhide it on a button click in Oracle apex, but its showing an error on false action that in when condition nothing is defined. Can anyone please help me regarding this. Regards, Anshul Ayushya
Upvotes: 1
Views: 6419
Reputation: 335
If you only want to have one button for showing/hiding the region, you might also use jQuerys .toggle() function. For that, add a static ID to your button and create a dynamic action with a JavaScript action that runs the following:
$("#<<STATIC_ID_OF_BUTTON>>").toggle();
This will hide/show your region on every click of the button. To load the region hidden, just add the following CSS for the region:
#<<REGION_STATIC_ID>>{
display:none;
}
With .toggle() you can also add options, such as defining a function to execute once the toggle actions has completed or the duration of the toggle animation such as:
$("#<<STATIC_ID_OF_BUTTON>>").toggle({
duration: 400,
complete: () => {"do someting here"}
});
See the jQuery documentation of the .toggle() function for a full list of options.
Upvotes: -1
Reputation: 81
You could have a look at collapsible region. Create a region, Appearance needs to be set to Collapsible (you can configure the options right below in Template Options). Some types of regions do not offer Collapsible (e.g. Interactive Report), but then you could just create a static content region, make it collapsible and create a subregion of the desired type. And you are done.
Upvotes: 2
Reputation: 143103
A simple way to do that is to create two buttons: one to hide a region, and another to show it.
Run the page and enjoy in hiding/showing the region.
Upvotes: 2