0
votes

am Using Apex4.1,

in my application I have one Tabular form which has the following fields,

     Emp_id
     Emp_name
     Dept_id

Here Emp_id is the Updatable column and it is a select list LOV and

Emp_name is a upadatable column,

Here what I need is,

If I select the Emp_id from the LOV ,the Emp_Name should be stored automatically based on the value selected in EMP_ID,

In tabular form I could not create Dynamic action like creating in normal forms, Can anyone help me in this issue?

Thank you.

1

1 Answers

1
votes

APEX does not currently provide dynamic actions on tabular form items. Hopefully this may be addressed in APEX 4.2 but the Statement of Direction does not explicitly say so.

So for now if you need to do this you will have to write your own Javascript, using the unique IDs of the tabular form items to manipulate them (the IDs look like "fcc_rrrr" where "cc" is the column number and "rrrr" is the row number). See this SO q&q for sample Javascript code that uses these.

The Javascript you need to write is a little daunting (for a beginner), but one thing to note is that in your case you can avoid any need for using AJAX to get the employee name by embedding the name in the return value of the LOV something like this:

select emp_name d, emp_id||':'||emp_name r
from employee
order by 1

This way the return values will look like '123:John Smith'; your Javascript can parse this string and extract 'John Smith' and insert it into the emp_name item on the same row. Obviously you will also need to parse this string to obtain the emp_id value you will need when updating the database when the page is submitted.