Oracle Apex version 24.2
I have created on global page an item P0_YEAR of type select list .
The P0_YEAR is SELECT YEAR , STATUS FROM TABLE_YEARS , which contains also column STATUS.
STATUS can have two possible values ('OPEN', 'ÇLOSE').
When the value of the YEAR is changed, I would like to synchronize the background color of the item P0_YEAR
with the value of its STATUS.
I try to achieve this with creating the dynamic action New_YEAR at the item P0_YEAR When the Event Change
with action Execute JavaScript Code :
var item_S_Value = $v('P0_STATUS');
var item_Y_Value = $v('P0_YEAR');
var item_Y_Element = document.getElementById('P0_YEAR'); // Get item element
if (item_S_Value == 'OPEN' ) {
item_Y_Element.style.backgroundColor = '#4CAF50'; // Green
} else {
item_Y_Element.style.backgroundColor = '#eed202'; // Yellow
}
Whet the Year is changed the color is applied only for a short moment and then disappears.
What is а Change the background color of the Item on change its value.
Oracle Apex version 24.2
I have created on global page an item P0_YEAR of type select list .
The P0_YEAR is SELECT YEAR , STATUS FROM TABLE_YEARS , which contains also column STATUS.
STATUS can have two possible values ('OPEN', 'ÇLOSE').
When the value of the YEAR is changed, I would like to synchronize the background color of the item P0_YEAR
with the value of its STATUS.
I try to achieve this with creating the dynamic action New_YEAR at the item P0_YEAR When the Event Change
with action Execute JavaScript Code :
var item_S_Value = $v('P0_STATUS');
var item_Y_Value = $v('P0_YEAR');
var item_Y_Element = document.getElementById('P0_YEAR'); // Get item element
if (item_S_Value == 'OPEN' ) {
item_Y_Element.style.backgroundColor = '#4CAF50'; // Green
} else {
item_Y_Element.style.backgroundColor = '#eed202'; // Yellow
}
Whet the Year is changed the color is applied only for a short moment and then disappears.
What is the practice to achieve the change of background color in this circumstances.
Regards,
Kostadin