I have been trying to set mandatory dropdowns to be selected in order to go to the next screen.
Next screen is called End
Dropdown is called type_4
This is the code that I used but it doesn't seem to go through:
If(
IsBlank(type_4.Selected.Value),
Notify("Fill all the fields to continue", NotificationType.Error),
Navigate(End,ScreenTransition.Cover) )
This issue is specific to dropdown inputs. If it was a text field all I do is replacing Selected.Value by Text and it works fine.
Dropdowns are my only problem so far.
EDIT: The default value of the dropdowns is Select your answer (first choice of the dropdown).
If the default option for your dropdown is 'Select your answer', then you can use an expression similar to the one below:
If(
type_4.Selected.Value = "Select your answer",
Notify("Fill all the fields to continue", NotificationType.Error),
Navigate(End,ScreenTransition.Cover) )
Related
I have a form in oracle apex with more than seven items on it. they are
SUBJECT_ID,GRADE_ID,DOMAIN_ID, CATEGORY_ID, STANDARD_CODE, STANADARD_STATEMENT, LEARNING_TARGETS.
I want these items SUBJECT_ID,GRADE_ID,DOMAIN_ID, CATEGORY_ID, STANDARD_CODE type to be select list. additionally, I want to make LOVs for each of these items.
LOV for SUBJECT_ID: I am making this LOV using a table SUBJECTS having TWO columns. MY query is SELECT SUBJECT_ID, SUBJECT_NAME FROM SUBJECTS It's working fine.
LOV for GRADE_ID: I am making this LOV using a table GRADES having TWO columns. MY query is SELECT GRADE_ID, GRADE_NAME FROM GRADES It's working fine.
LOV for DOMAIN_ID: I am making this LOV using a table DOMAIN having TRHEE columns. MY query is SELECT DOMAIN_ID, DOMAIN_NAME FROM DOMAIN WHERE SUBJECT=:P48_SUBJECT_ID. It's working fine.
LOV for CATEGORY_ID: I am making this LOV using a table CATEGORIES having FOUR columns. MY query is SELECT CATEGORY_ID, CATEGORY_NAME FROM CATEGORIES WHERE DOMAIN=:P4.8_DOMAIN_ID It's working fine.
LOV for STANDARD_CODE: I am making this LOV using a table CURRICULUM having MORE THAN EIGHT columns. MY query is SELECT CURRICULUM_ID CI, STANDARD_CODE SC FROM CURRICULUM WHERE SUBJECT=:P48_SUBJECT_ID AND GRADE_ID=:P48_GRADE_ID AND DOMAIN_ID=:P48_DOMAIN_ID AND CATEGORY_ID=:P48_CATEGORY_ID. It's not working for me.
Kindly tell me how I can correct the 5th LOV. Thanks
I wouldn't say that any of LoV queries you posted return desired result and "work fine". Their format should be:
select display_value, --> you see it on the screen
return_value --> you don't see it; it is stored into the table
from ...
Code you posted suggest just the opposite, e.g.
SELECT SUBJECT_ID, --> are you REALLY displaying ID to users and
SUBJECT_NAME --> storing NAME into the table?
FROM SUBJECTS
As of your final LoV: just as MT0 commented, we have no idea what "not working" means. You posted a whole lot of more or less useless information (queries that "work"; what should we do with them?), but said nothing about problem you have.
Therefore, I'll guess: you forgot to include
P48_SUBJECT_ID, P48_GRADE_ID, P48_DOMAIN_ID, P48_CATEGORY_ID
into the Parent Item(s) property within the "Cascading List of Values" section, e.g.
Note that query you posted presumes that all page items have a value; if any of these is NULL, query won't return anything so that would be my second guess:
SELECT curriculum_id ci, standard_code sc
FROM curriculum
WHERE ( subject = :P48_SUBJECT_ID
OR :P48_SUBJECT_ID IS NULL)
AND ( grade_id = :P48_GRADE_ID
OR :P48_GRADE_ID IS NULL)
AND ( domain_id = :P48_DOMAIN_ID
OR :P48_DOMAIN_ID IS NULL)
AND ( category_id = :P48_CATEGORY_ID
OR :P48_CATEGORY_ID IS NULL)
In that case, switch the "Parent required" property OFF.
I have a form with items P1_APP and P1_USER.
P.S. P1_USER is select list.
Display John
Return 1
Display Andy
Return 2
I need to disable when user selects John.
When P1_USER = 'John', P1_APP should get disabled which is a multi select list.
I created dynamic action on P1_APP, True Action= Disable,Affected element P1_APP
Client condition : Item =Value
Item= P1_USER
Value= John
However this is not working.
I have used similar logic to disable interactive grid items and was able to do so. Why is this not working for form?
EDIT: In Value now i am putting 1 which is return value for John.
However when i select John. It disables P1_App upon clicking. But remains disabled even when i choose Andy.
This works for me using the following configuration.
Create form and report on EMP - everyone has access to that sample data, it is a good idea to post questions based on that.
In the form P3_DEPTNO is a select list with source
SELECT d.dname, d.deptno FROM dept d
Add a page item to my form P3_APP. This is a select list with "Allow multi selection" enabled. Select list has 2 static values.
Create a dynamic action on change of P3_DEPTNO.
Client side condition: Item = Value
Item: P3_DEPTNO
Value: 30 (note that this is the return value for SALES, not display value)
add true action of "Disable", affected item P3_APP
Click true action and select "Create Opposite Action". Save.
When I run this it work. Selecting SALES in the select list disables the item P3_APP and selecting something else enables it.
I use plugin Select2 on Apex.
I have scenario like this:
I have three tables: ROOM, MASTER_STUDENT and MAP_STUDENT_ROOM
One ROOM can have many STUDENT
User can select more than one student(with Select2 from MASTER_STUDENT) when create ROOM
When user edit ROOM, previously selected student show in Select2 item(selected item by MAP_STUDENT_ROOM), so user can remove or add more Student
How to achieve point number 4, item Select2 list of values is MASTER_STUDENT but with default selected by MAP_STUDENT_ROOM?
I found this documentation, but i dont know how to apply it.
I'm not familiar with the Select2 plug-in.
Have you considered using the built-in Popup LOV, which since APEX 19.1 now allows multiple selection.
Whether you're using the Select2 plug-in or the built-in Popup LOV, the issue will be the same. You have a form on ROOM, that's trying to take into account an item that isn't part of the ROOM table (its values are stored in MAP_STUDENT_ROOM). The trick is to populate the item correctly during page load so that the item can correctly display the currently assigned students.
How is the item's Source configured? If it's not, set Type to SQL Query (return colon separated value). Assuming you have a primary key item on the page for the room (e.g. P1_ID), enter a query like the following:
select student_id
from MAP_STUDENT_ROOM
where room_id = :P1_ID
Then set Used to Always, replacing any existing value in session state.
This should get the item to display correctly when the page loads. However, you'll still have to figure out how to map the values back to the MAP_STUDENT_ROOM table correctly when the page is submitted. You'll need to add some logic that first deletes rows from the room (P1_ID) that are not in the selection (e.g. P1_ASSIGNED_STUDENTS). You can use APEX_STRING.SPLIT_NUMBERS to help:
delete from map_student_room
where room_id = :P1_ID
and student_id not in (
select column_value
from apex_string.split_number(:P1_ASSIGNED_STUDENTS, ':')
)
Then you can insert rows that are in the selection but not already in the room.
insert into map_student_room (
room_id,
student_id
)
select :P1_ID,
column_value
from apex_string.split_number(:P1_ASSIGNED_STUDENTS, ':')
where column_value not in (
select student_id
from map_student_room
where room_id = :P1_ID
)
I've not tested any of this code, but it should get the points across.
Another option would be to use an Interactive Grid instead of a list of values item. This is a classic master/detail scenario where students could be added and removed below the form region (typically only done after create).
I have an interactive report apex5.0 which contains several fields.
Would like to disable 'edit' pencil option link where payment_date & code is populated.
Link is to be enabled only where payment_date & code is null.
Disable the edit button for a particular row, based on a specific value in its column.
For ex. If a grid has 3 columns A,B,C and if B contains "Apple", and '01-jan-17', the edit button for that row must be disabled.
What are the different options to do this kind of functionality in apex5.0, enable & disable "EDIT" based on certain criteria?
You could also add a case statement to your report's query.
E.g.
(Case when [some logic] then
--display link
'<img src="#IMAGE_PREFIX#menu/pencil16x16.gif" alt="" />'
End) as col_link
The above example will only display a link if the case statement is met. The link will point to page 47 and we will pass the query's Id column to page 47's item P47_ID
In order to treat this new column as a link you must change the "display as text" property to "standard report column"; you can achieve this when editing the report attributes.
One way is to use JavaScript on page load:
Let's asume that first column is with ID and used to show edit link. Second column is your product name like Apple. Just disable click on this element(cell with ID) or change link, img etc.
var table = $(".a-IRR-table tbody");
table.find('tr').each(function (i, el) {
var $tds = $(this).find('td'),
productId = $tds.eq(0).text(), //first column with ID and edit link
product = $tds.eq(1).text(), //second column
Quantity = $tds.eq(2).text(); //third column
if (product == 'Apple'){
$tds.eq(0).click(false);
$tds.eq(0).replaceWith('');
}
});
Thanks to this answer for JavaScript: Loop Through Each HTML Table Column and Get the Data using jQuery
EDIT:
To hide value based on your Query use CASE. For example:
SELECT
CASE
WHEN B = 'Apple' THEN
'<img src="#IMAGE_PREFIX#edit.gif" alt="">'
ELSE ''
END edit_link,
A,B,C
FROM TABLE_NAME
Click on column edit_link and make it of type Link
Choose your target to edit page
For link text select #EDIT_LINK#
Escape special characters must be set to NO
On Report Atributes set **Link Column** to **Exclude Link Column** (you have custom link column so don't display original link)
*Check your online workspace, page 3*
I have a dialog list which use Use View dialog for Choices.
I have a row in a table which its appearing depends on the value selected from that dialog list. ( I am using Hide when formula... ) The form has Automatically refresh fields checked.
The problem is that after I select a certain value from the dialog list, and I even had selected Refresh fields on keyword change property, I MUST hit F5 or just TAB ( to go to a next field ) in order to make that row table to appear. I also tried to add uidoc.Refresh at the Exiting/OnChange event(s) of the dialog list.
I have noticed the following:
the refresh works fine for combo box, list box, radio button or check box
the refresh works fine for dialog list where you are using a list of choices / formula.
the refresh doesn't work for dialog list where you are using view dialog for choices ( my case ).
Is there any solution for this issue? I want when I selected a value from the dialog list, immediately the row / line should appear/disappear.
Thank for your time!