Home » Developer & Programmer » Forms » Problem with 2 LOV's (Windows XP)
Problem with 2 LOV's [message #340161] Mon, 11 August 2008 13:07 Go to next message
Kurtn1986
Messages: 5
Registered: August 2008
Location: Belgium, Europe
Junior Member
Hello,

I new to Oracle Forms Builder. I've got Developer suite 10G.

I've got 2 blocks: (relation is master-detail with ccode)

1. COMPANY-->Form
CCODE (NUMBER) (contains LOV_C)
CNAME (VARCHAR2)
PB_LIST_COMPANIES (button)

2. PROJECT--> Form
PROJCODE (NUMBER) (contains LOV_P)
CCODE (NUMBER)
PROJTITLE (VARCHAR2)
PB_LIST_PROJECTS (button)

And 2 LOV's

1. LOV_C
After pushing PB_LIST_COMPANIES-button a LOV(contains: Company.ccode & Company.name) appears and returns the value of company.ccode to the item CCODE in the Company-block. The query is executed. (This works well)

2. LOV_P
After pushing the PB_LIST_PROJECTS a LOV(contains: project.projcode & project.title) appears and returns the value of project.projcode to the item PROJCODE in the Project-block and then

Now this is the problem
If I run the form and want to enter a query by pressing the PB_LIST_PROJECTS-button, it just fills in the item PROJCODE of the PROJECT-block. How can I populate the whole project-block and also the company-block and replace the cursor in CCODE of company?

Thx for helping me out!
Re: Problem with 2 LOV's [message #340170 is a reply to message #340161] Mon, 11 August 2008 15:11 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
If I run the form and want to enter a query by pressing the PB_LIST_PROJECTS-button

Wrong. You enter a query mode by pressing the ENTER QUERY button (press <Ctrl + K> to see which key is mapped to this action, or use a toolbar).

Quote:
by pressing the PB_LIST_PROJECTS-button, it just fills in the item PROJCODE of the PROJECT-block

Of course; what did you expect? You've said (in the previous sentence) that
Quote:
PB_LIST_PROJECTS a LOV(contains: project.projcode & project.title) appears and returns the value of project.projcode to the item PROJCODE in the Project-block

If you want to populate other items (using the LoV), query these columns in the Record Group query and map them to corresponding form items.

Quote:
How can I populate the whole project-block

By executing a query in the "project" block (if you want to populate it by querying existing data), or enter valid values (if in insert mode).

Quote:
and also the company-block

That's not the way master-detail relationship works. You query MASTER and fetch both master and detail records. You can not query DETAILS and fetch MASTER. Or, perhaps better stated, you don't want to do that in this phase of your Forms life. I don't want to do that either.

Quote:
replace the cursor in CCODE of company

I'm afraid I don't understand that. What would that "replacing a cursor" mean?
Re: Problem with 2 LOV's [message #340320 is a reply to message #340170] Tue, 12 August 2008 05:35 Go to previous messageGo to next message
Kurtn1986
Messages: 5
Registered: August 2008
Location: Belgium, Europe
Junior Member
Yes, u'r right. But when i press on the enter-query button and then on the PB_LIST_PROJECTS-button. The form always navigates to the item CCODE in the COMPANY-block.

The problem is now: when I press enter-query, I should have the possibility to use the LOV_C by pressing the PB_LIST_COMPANIES in the COMPANY-block OR to use the LOV_P by pushing the PB_LIST_PROJECTS in the PROJECT-block.

What I meant to say with the cursor is that after the query is executed, the form has to navigate to the CCODE-item of the COMPANY-block.

Thx for helping me!
Kurt
Re: Problem with 2 LOV's [message #340335 is a reply to message #340320] Tue, 12 August 2008 06:53 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
The form always navigates to the item CCODE in the COMPANY-block.

That happens when the navigation is incorrectly set. As it is about the PB_LIST_PROJECTS push button, try to put something like this into the WHEN-BUTTON-TRIGGER body:
go_item('pb_list_projects');
list_values;


Quote:
when I press enter-query, I should have the possibility to use the LOV_C by pressing the PB_LIST_COMPANIES in the COMPANY-block OR to use the LOV_P by pushing the PB_LIST_PROJECTS in the PROJECT-block.

Wrong again. As this is the master-detail relationship, entering query mode sets focus into one of these blocks. If you are currently in the master block and press "enter query", Forms' triggers/procedures (which are not to be modified) will do their job, clear both master and detail block and wait for user's input (i.e. search criteria) and "execute query" action.

So, FIRST query master records. Once you get the result, go to the detail block, "enter query" again, enter search criteria for the detail block and "execute query". Doing so, you'll first filter master records and - within this result set - corresponding detail records.

Quote:
after the query is executed, the form has to navigate to the CCODE-item of the COMPANY-block

It will, if the query is executed in the "company" block and CCODE is the first navigable item in this block, or by modifying the KEY-EXEQRY trigger as
execute_query;
go_item('company.ccode');
Previous Topic: message popup for hoildays in forms
Next Topic: Example code or form for Horizontal/veritcal toolbar canvas?
Goto Forum:
  


Current Time: Mon Feb 10 00:32:49 CST 2025