Oracle Apex - All tabs showing at once instead of only active tab - oracle-apex

I created an apex page wherein i need to split my classic report of 50 columns into 5 tabs with 10 columns displaying in each.
So for each section, i created a static content region with template as tabs container.
Inside it as sub region i added the classic report.
Start New Row->No so that the Tab headers are all side by side.
After doing this for all 5 tabs when i run the page it shows all 5 tabs whereas i need to see the 1st tab by default and the rest only when i click on the respective tab name.
So only the tab on which i click needs to be active.
What am i implementing incorrectly here?

I would use a region display selector for this.
Create a region with template 'blank with no attributes'. This is typically placed in breadcrumb bar location, and can be configured to not 'show all'.
Now any content region with attribute 'region display selector' is shown tabulated.
Often you'll need to take care to ensure inline dialogs or other note regions don't have this attribute selected.

Related

Apex: 22.1.1 - Based on the selection of the radio groups the form must be displayed dynamically

I am a newbie to APEX. I am currently working on radio buttons.. There are radio button groups in my page 1. For example :Radio 1 and Radio 2.Based on the selection of the radio button in these 2 groups , I need to dynamically show a Page items of the region in the same page. For a particular selection of the radio button groups, certain page items will be visible and certain will be hidden.
Also based on the values entered in the page items, on submit,the next page must display all the values which I entered in the region of the page elements.
What should be my approach to this. Please guide.
enter image description here
The way you described it, you'd use dynamic actions (Show / Hide) because they let you "dynamically" (and immediately) manipulate other items on the page.
You could use Server-side conditions as well, but they require page to be submitted first so - I guess that's not what you're after.
Therefore: initially hide all items you don't need (that's the same dynamic action, just set it to fire on initialization, i.e. when page is first rendered), and then show them as radio buttons' values change.
As of your next question: if you navigate to the next page using a button (so its action is to "Redirect to page in this application"), you can set next page's items' to values of items on this page. To do that, use Target - Link builder property (right below "Action").

How run a control-broken IG as collapsed in the first place?

I am using Oracle APEX 21.2.5. I have an Interactive Grid. I did a control break on a specific column. I need to display all grid rows as collapsed when I first run the page. But it's displayed as expanded. Is there a way to do so?
Please put the below code in the Javascript -> Execute When Page Loads section of the page
$("#YOUR_IG_STATIC_ID .a-GV-table tr.a-GV-controlBreak .a-GV-controlBreakHeader .a-Button.js-toggleBreak").click();
Note: In the above code replace YOUR_IG_STATIC_ID with the Static ID of your Interactive Grid region.

Oracle Apex dynamic action not firing on true condition

I have a page with two Interactive Grids. One shows Approved records. One shows Unapproved records. There is a button with processing underneath on each grid to set the selected rows to Approved/Unapproved respectively.
I want to hide these buttons based on if a user is an Approver. These values are store in some user managed tables.
I have a dynamic action on Page Load that runs the following and sets a page item to 1 / null depending on the return:
select 1 from users where upper(username) = upper(:APP_USER) and userrole = 'APPROVER';
Based on the value in the page item two dynamic actions fire on page load to set the buttons with
True=Show
False=Hide.
Client Side Condition: Item = Value: P1_PAGE_ITEM = 1
Now - on my local machine this works fine. I made the page item visible. Can see a 1 or null and the buttons are hidden/shown.
I moved this to a Development environment and now I get a warning about Unsaved Changes each time I click out of the page (doesn't happen on Local). And although I can see a 1 in the Page Item field the actions see this as False (I put an alert on to fire when true/false).
Question is: Why am I getting the unsaved changes warning on the new environment. And why would the actions see the field as FAlse.
I have compared all of the properties as best as I can and they seem identical. I have even arranged the sequence numbers to be identical in the two environments.
All thoughts welcome...
This doesn't need to be a DA that is modifying a field value, hence the alert.
Why not define a computation that executes during the render, and use that as a server side condition on your Dynamic Action?
Otherwise you've enabled a security threat, where the user can tweak some HTML to see the regions you've hidden.

Dynamically set Oracle Apex 5.1 interactive grid region header

I'm wondering if it's possible to dynamically change the interactive grid region header text. I have an IG that provides detail from a "master" report, and I'd like the HTML header text to update dynamically to display the title of the master record being displayed.
I'm guessing I'll need to create a custom dynamic action, but I'm not sure how to identify / reference the region header text element.
I appreciate any ideas.
I created a Master/Detail page based on DEPT/EMP to come up with these steps.
Give the child region a static id (I used js-ig-emps).
In the Page Designer, right-click the parent region and select Create Dynamic Action.
For the Dynamic Action, set Event to "Component Events > Selection Change [Interactive Grid]".
For the Action, set Action to "Execute JavaScript".
In Code, enter some JavaScript that updates the header of the child region using data from the parent.
Here's the code I used:
var selectedRecord = this.data.selectedRecords[0];
var selectedDept = this.data.model.getValue(selectedRecord, 'DNAME');
var newText = 'Employees in ' + selectedDept;
$('#js-ig-emps .t-Region-title').text(newText);
That assumes you're using Universal Theme. You'll need to make adjustments according to your requirements and the columns you have access to from the parent region.

Oracle APEX, create & save (insert) from Interactive Report page to DML Form

Need a help in understand underline logic here. I have created a simple APEX application. First page shows the table details and via a "Create" button "Interactive Search" region, directs to a form page. Now form page consists of "Save" and "Insert" buttons in correct regions. So whole app works. When I press "Create" from 1st page to 2nd, "Save" button is invisible and when I click the edit icon on the table of 1st page, "Create" button is invisible in 2nd. App works accordingly, but could not figure out what setting enable this set-up even though I was able to make it work.
1st Page : Interactive Report Page. 2nd Page : DML Form. Built the app from blank pages.
Could any of you explain how it works?
When you click the Create button on the Interactive Report page, it takes you to the Form page in insert mode, i.e. it allows you to enter a new row into the table. Therefore, the Form page has the Create (and the Cancel) button.
On the other hand, when you click the Edit button on the Interactive Report, it takes you to the same Form page, but this time in edit mode which enables you to modify values (and save those changes with the Apply Changes / Save button), delete that row using the Delete button, or - as previously Cancel current operation.
If you look at Form page's buttons' properties, you'll see that they have Server-side Conditions set which are then used to render (or not) a certain button. For example, if the Form page number is 13 and the primary key column is set to the ID column, then these conditions look like this:
Create: P13_ID IS NULL (i.e. the primary key column value doesn't exist yet, which means that this is a brand new row)
Apply Chanages / Save: P13_ID IS NOT NULL (i.e. the primary key column value exists, which means that row you see was fetched from the database)
Delete: P13_ID IS NOT NULL (the same condition as for the Apply Chanages / Save button)
Cancel: it is always displayed.