This content has been marked as final. Show 5 replies
user995809 wrote:Try redirecting to error page when validation fails. (means edit the validation and chose Error message display location as Error Page)
I've a report region query-
select distinct col1, col2,
When 'Y' (valid) selected from the select list and SUBMIT is clicked - a validation and then page processing pl/sql process will run for the record, branching to the same page.
If validation fails custom error message comes on screen, but value of column "Action" is reset to default 'No_Action'.
Can anyone please tell me how can I show the last selected value in column "Action"?
Please reply asap. Regards.
To be able to show the last selected value you need to make the value persistent, that is update it in some column in the table.
So the next time the report is run (refreshed) it fetches the value from the table/column . Then change your query to something like
COL_YN is the column where you stored the last selection. Unless you store it in some table/column you cannot get it back into the report when it is refreshed.
select distinct col1, col2, APEX_ITEM.HIDDEN(2,col3)|| APEX_ITEM.SELECT_LIST(1,NVL(COL_YN,'N'),'Valid;Y,Invalid;N') Action from <tab1>
The other way of course is to use APEX_COLLECTIONS , but that might be more complex.
However, you need to think whether you really need the APEX_ITEMs API for this? If you just edit the Report Attributed and Edit the column definitions you might be able to achieve the same thing without having to use APEX_ITEM.
Column "Action"(=apex_item.select_list()) is not present in table. This is an action expected from the user whether to allow this record saying valid or discard saying invalid. I've attached apex_item.hidden(col3) to be used as primary_key on the row.
Is there any property available in Report Region or apex_item.select_list that previous value selected in the item can be cached throughout the session?
Please reply. Regards.
This is not a best approach, but Why don't you create an application item and when user selects a value from the list item save it to the created application item and when page loads branched back to same page check if the application item holds any value if then set the app item value to your select list. won't this work ?