Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

69
Views
How to reset list to blank using javascript in Oracle apex

I have a select list component in Oracle apex and one button

Select list drop down as below values I can choose any one

-

  • A
  • B
  • C

On button click I have written a java script

if $('#P1_DROPDOWN').val() == 'A'
{
   alert.message('A value is selected') 
}
else
{
   apex.item.setvalue(index[0])  -- blank 
   or 
   reset the list to none selected 
} 

How do I reset the List item to none o original state

8 months ago · Juan Pablo Isaza
1 answers
Answer question

0

Here is an example for a select list that has "Display Null Value" set to "Yes" and no value for "Null Return Value".

if (apex.item( "P1_DROPDOWN" ).getValue() == 'A') {
    alert('a was clicked');
} else {
    apex.item( "P1_DROPDOWN" ).setValue( "" );
}

If there is a return value for the Null value, then change the setValue accordingly.

Side Note: Instead of clearing the selected value a validation indicating why the selected value is not the correct one might give a better user experience.

8 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs