I inherited an APEX application that is still in development. I am new to both APEX and javascript.
Within the application there is a form which also contains a tabular form that is populated by the following SQL Query
select
"ROWID",
"METER_ID",
"PERMIT_NUMBER",
"RENEWAL_ID",
"COMPANY_NAME",
"SERIAL_NUMBER",
"DESCRIPTION",
"BEGINING_READING",
"ENDING_READING",
"DATE_ISSUED",
"DATE_RETURNED",
"REPAIR_COST",
"REPAIRS_NEEDED",
"COMMENTS"
from "#OWNER#"."V_PERMIT_HISTORY"
WHERE PERMIT_ID=:P49_PERMIT_NUMBER
The fields ROWID thru COMPANY_NAME are type hidden
The fields SERIAL_NUMBER thru BEGINING_READING, DATE_ISSUED, DATE_RETURNED, REPAIRS_NEEDED are type Plain Text
The fields ENDING_READING and REPAIR_COST fields are type Text Field
The field COMMENTS is a Text Area field.
On Load of the page and using some existing Javascript I was able to Disable fields as follows, using DATE_RETURNED which is a type Plain Text
$('td[headers="DATE_RETURNED"]').each(function() {
var qqq = $(this).text()
if ( qqq.trim() === '(null)') {
$(this).closest('tr').find('td[headers="REPAIR_COST"]').prop( "disabled", true );
$(this).closest('tr').find('td[headers="ENDING_READING"]').prop( "disabled", true );
$(this).closest('tr').find('td[headers="COMMENTS"]').prop( "disabled", true );
}
});
However, I am having a problem when I try to retrieve the data in the field REPAIR_COST, which is a type Text Field. The problem being that the data is not being returned for that field. I used and alert to verify that there is no data. Conversely, in the previous example I was able to see the data during each iteration with an alert. I also verified that there is not data being shown in the other Text Field, ENDING_READING.
$('td[headers="REPAIR_COST"]').each(function() {
var qqq = $(this).text()
if ( qqq.trim() !== '(null)') { ....
What I am trying to do processing on other fields based on any existing data that is being loaded to the table field REPAIR_COST.
I have looked on the Oracle Apex site and on various other sites found with Google regarding Apex or Javascript to determine what the problem is. Or to see if what I am trying to accomplish is even possible. I have tried a LOT of suggestions without success. Any help is appreciated.
I am able to retrieve the data in the type Text Area areas (COMMENTS.) I have noticed that in APEX there are HTML Expression options available for the type Plain Text but not the types Text Field or Text Area.
My questions are: Is it possible to retrieve the data from a type Text Field and use it in javascript? Is this the "best practice" for loading a tabular form?
Thanks in advance.