Reputation: 158
Trying to add a read condition to my page. Nothing I am doing works. I would like to use the PL/SQL Expression condition type but cannot get it to evaluate properly. My app is a workflow application and I want the page to display in READ mode when the status is not DRAFT. So, naturally I try to code the Expression as:
:P2_PDD_STATUS_CD != 'DRAFT'
This results in the page being opened in edit mode no matter what the status value. What am I missing? I've verified the column name several times. As a matter of testing, I was not able to get the Expression 1 = Expression 2 condition type to work either.
Upvotes: 1
Views: 6401
Reputation: 2021
The Quick Answer: Wherever you place the page item that influences the READ-ONLY state of the text field page/region item, the change in its value/state has to happen sequentially before the event that fetches and displays the conditionally read-only text field...
The best way to make sure the state you have changed "sticks" is to associate a page redirect with that field so that the rest of the page items and dependent properties has an opportunity to recognize that the read-only page indicator value has been altered (from DRAFT to non-DRAFT, etc.)
This example uses a single table. The text-document is an oversized VARCHAR2 typed field, though it really could be anything... even a LOB/CLOB typed value for larger capacity. The schema:
The example is designed in a single page. Two regions: The speech catalog (top) and the speech editor form (bottom) are processed in the following order:
SPEECH_ID
value was designated at page-load (or reload) fetch all fields for the speech document record where the speech id = the page item containing the speech id value.The FORM Region Design
This defines what the "edit" button does from the report output of possible speech selections. Notice that selecting this button value sets an automatic redirect to the same page, containing the revised STATUS-MODE
value.
Rendering Sequence Design
The rendering of the page passes through each region and design block once. If a item value is upstream (i.e., processed before) from a defining item value (such as the STATUS: DRAFT, ARCHIVE, etc.)... or it can be changed after the page render is completed, a redirect action would help in this case.
The Conditional READ-ONLY Page ITEM Property
Normal Speech Edit (DRAFT) Mode
Archive Mode for READ ONLY Speech Text Access
It is possible to do this with a workflow that spans multiple pages. It might even be easier that way. For example, the determining, incoming page item properties should be set at ANY time prior to when the previous page is redirected to it.
Sorry in advance for the slightly abnoxious-sized watermark-credits text on my screen-captures. I'm set up with a new tool (Skitch) and it is nearly impossible to get a sense of scale when it's finally home within a Stack Overflow post...
Enjoy anyways: Onward!
Upvotes: 3