Sevvo
Sevvo

Reputation: 41

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

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...

Upvotes: 1

Views: 1808

Answers (1)

Scott
Scott

Reputation: 5035

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.

Upvotes: 2

Related Questions