Home > Net >  Why button disappeared after PL/SQL expression? Oracle APEX
Why button disappeared after PL/SQL expression? Oracle APEX

Time:04-01

everyone!

I need to check if two of the page item values are equal and only then redirect to another page in my oracle apex app. I chose Server-side Condition like this: enter image description here

But my button disappeared from the page. Help me find the problem

CodePudding user response:

A server side condition is evaluated at page rendering time. It does not take into account and changes in page item values once the page is rendered. In the case of your button, this means that the button is only rendered when the condition :P2_QR_RESULT = :P2_TAG_IDENTIFIER yields true when the page is rendered. The button doesn't "disappear" it just never "appeared".

It is unclear from your question what the business flow is. Here is one possible solution, but depending on your case there might be better ones. If the button needs to dynamically appear/disappear (or be enabled/disabled - this is more intuitive for a user) then the way to do this is by setting a Dynamic Action on each of the 2 page items. Evaluate the value of both page items and if there are equal, enable/show the button else hide/disable the button. Make sure the dynamic actions fire on page load.

CodePudding user response:

In the help attributes of this server-side condition it is specified with the brackets as:

To return successfully when the employee is in department 30 or is a manager:
( :P2_DEPTNO = 30 or :P2_JOB = 'MANAGER' )

So try your condition as:

(:P2_QR_RESULT = :P2_TAG_IDENTIFIER) 

If this also doesn't work, check the values of those items.

CodePudding user response:

That's OK. Apparently, values of P2_QR_RESULT and P2_TAG_IDENTIFIERS aren't equal so page didn't render the button so user's can't possibly go to another page. That's what you wanted, right?

Because, if values were equal, you'd see the button, you could click to it and it would take you to another page.


If you want to see the button but make it "do nothing" once it is pressed, then

  • let it submit the page
  • create a branch which will take you to the target page
  • set its (branch's) server-side condition to
    • run when that button is pressed

    • type: function body:

      return :P2_QR_RESULT = :P2_TAG_IDENTIFIER;
      

Note that this might act "funny" for users; they will see the button, they will press it, and nothing will happen. Make sure to let them know why button won't do anything.

  • Related