Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Not In Query on select List

NewApexCoderOct 25 2013 — edited Oct 25 2013

Apex 4.2

Two Tables

SITES

  Site_id (pk)

  Site_name

  Date

ACTIVATION

   Activation_id (pk)

   Activation_date

   Deactivation_date

   Site_id (fk)

* I have a report based on the ACTIVATION table. Upon clicking an edit link on any row of the report, it takes you to a form to edit the information. The form allows you to edit the Site_id. The Site_id is represented as a select list with the following LOV query:

SELECT SITE_NAME, SITE_ID

FROM SITES

* This select list gives me all of the site_names, however, I want to filter this select list by only showing those sites that are not in the report. All of the site names are as follows:

Maryland

Los Angeles

Natchez

Bakersfield

Austin

The report has rows:

Activation ID     Site Name              Activation Date     Deactivation Date

  1                         Natchez                    3/11/2013         

  2                         Los Angeles               5/27/2020

I would like for the list to only display the ones that are not in the report, i.e. Austin, Bakersfield, Maryland.

I have tried to write a NOT IN query. When I click an edit link from the report to navigate to the form, the select list shows the list of entries that I desire, however, the row that I clicked shows the id of the Site Name instead of the actual name. I'm not sure where my error is. I hope all this makes sense. Thanks for your help in advance. Oh, and my query that I wrote is as follows:

SELECT SITE_NAME, SITE_ID

FROM SITES

WHERE SITE_ID NOT IN (SELECT SITE_ID

FROM ACTIVATION

WHERE this = that)

This post has been answered by Erick Diaz on Oct 25 2013
Jump to Answer

Comments

843807
I don't know the exact cause of the problem, but as a -not so nice but it works- solution, I propose to add the following line right before the first c.repaint() call:
c.add(new JLabel());
843807
This may sound silly but are you using a layout manager? If not, why not? Setting positions is difficult and keeping the controls in the right place will be difficult. When you use a layout manager, you can programmatically "lock" the labels. Using BorderLayouts and GridBagLayouts are terrific. Check out this link, it helped me a lot.

http://developer.java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html

Just remember that you should decide how you want the labels to behave (should they resize and move or be fixed) and pick the layout that matches that behavior. Create a JPanel, set that layout and then add the JLabels...
843807
I added a null layout manager and everything stuck. One line of code. Ha ha that article on layout managers was good thanks.
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 22 2013
Added on Oct 25 2013
4 comments
378 views