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!

Cascading LOV without a table field

PericlesOct 1 2020

Hello all
I’m building a form with apex 20.1 and got stuck with an issue. The situation is this.
The form is based on a table, and it will be used to register employees for a company. In the form I’ve one field for the “company” which is a simple LOV. Next there are two other LOV fields, one for “departments”, and the other for “department subdivision's”. The “department subdivision's” table has a foreign key to the “departments” table, and the “departments” table has also a foreign key to the “companies” table.
Considering that the employees table is indexed by companies I must include the “company” field on it. Regarding at the “department” and “department subdivision's” fields, I decided to just store the “ department subdivision's” value, cause there is unique relation with the department table.
So, I created the form defining the “company” field as a simple LOV pointing to the companies table and it will be stored in the table for employees. The “department” field is a form item defined as LOV (not included into the employees table), which has as parent the “company” field. The “department subdivision's” LOV field is included in the employees table, and has as parent the “department” field. Until this point the form works as expected, and the data is shown accordingly, and saved to the employees table without any issue.
The problem arise when I need to update an employee record. After opening the form the “company” field shows the label for the department value, the department field is empty as expected because that field is not stored on the employees table, but the “department subdivision's” only shows the value stored on the table, not the label associated in the department subdivisions table.
To handle this issue I first tried to create a dynamic action at page load which retrieve the department value on the “department subdivision's” table and assign that value to the “department” field, but it didn’t worked. The “department” stay always empty. To check if something went missing, I modified the “department” as a numeric field, and the value corresponding to the department is shown as it should, so the issue has something to do with LOV and the cascading between them.
Thinking that maybe the “department subdivision's” LOV which point to the “department” as a parent is involved, I decided to set up the LOV as a function returning an SQL which only execute a query that point to the “department” table when that field is not null, but this also failed.
I thought to add a field on the employees table for the department, but I’m not sure because any change on the department subdivision will generate an inconsistency with the information stored on the employee table.
So, until now I didn’t find a solution for this issue.
Appreciate if anyone has any suggestion about how to solve this issue.

Screenshot from 2020-10-01 07-30-32.png

This post has been answered by Pericles on Oct 2 2020
Jump to Answer

Comments

NickR2600-Oracle

That is really strange.  Let me investigate.  In the meantime, I have heard of incidences where the game won't run on OpenJDK, but will run on OracleJDK.

Thanks.

Maybe it is the point.

I also installed Oracle JDK.

I will keep trying.

NickR2600-Oracle

I'm able to get the game to work on Java 10.  Is your system using the runtime environment that comes with the Oracle JDK?  I don't believe OpenJDK includes a corresponding JavaFX implementation (OpenJFX) by default, which means you'd have to install additional packages to get the game to work using OpenJDK.

Gargoyle

I'm also on 18.04, and the game doesn't run for me on openjdk 10. This is what I did:-

sudo apt install openjdk-8-jdk openjfx

sudo update-alternatives --config java

From this menu, choose Java version 8 and then you should be able to run with:-

java -jar JavaPuzzleBall.jar

e37c10de-847c-4789-b50b-9e09f1131e8a

It worked!

Great!

Thanks for the help of you all.

Lee Turner

I seem to be having the same problem running the Jar:

java -version

openjdk version "1.8.0_131"

OpenJDK Runtime Environment (Zulu 8.21.0.1-macosx) (build 1.8.0_131-b11)

OpenJDK 64-Bit Server VM (Zulu 8.21.0.1-macosx) (build 25.131-b11, mixed mode)

java -jar JavaPuzzleBall.jar

Error: Could not find or load main class javafxapplication01.JavaPuzzleBall

Any ideas ?

NickR2600-Oracle

Hi Lee,

The culprit is OpenJDK.  OpenJDK doesn't include a JavaFX counterpart by default.  One option is to install additional OpenJFX packages to make up the difference.  Or another option is to install and run the game with Oracle's JRE.

Nick

Libor Modrovský

Hi, sorry I got to this great course late.

I have problems with running the game as well. Any idea ? Thanks.

c:\userdata\!>java -version

java version "10.0.1" 2018-04-17

Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)

Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

c:\userdata\!>java -jar c:\userdata\!\JavaPuzzleBall.jar

Exception in Application start method

java.lang.reflect.InvocationTargetException

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.base/java.lang.reflect.Method.invoke(Unknown Source)

        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)

        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.base/java.lang.reflect.Method.invoke(Unknown Source)

        at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)

Caused by: java.lang.RuntimeException: Exception in Application start method

        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)

        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)

        at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.NullPointerException: Input stream must not be null

        at javafx.graphics/javafx.scene.image.Image.validateInputStream(Unknown Source)

        at javafx.graphics/javafx.scene.image.Image.<init>(Unknown Source)

        at javafxapplication01.JavaPuzzleBall.init(JavaPuzzleBall.java:49)

        at javafxapplication01.JavaPuzzleBall.start(JavaPuzzleBall.java:189)

        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)

        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)

        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)

        at java.base/java.security.AccessController.doPrivileged(Native Method)

        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)

        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)

        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)

        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)

        ... 1 more

Exception running application javafxapplication01.JavaPuzzleBall

Libor Modrovský

the above example is in Windows 10.

While ago I tried it in Virtual Box - Oracle DB Developer VM, and it works ( but it is slower ).

I would appreciate to make in run on Win10 as well, but it is not urgent.

Thank you.

Libor.

NickR2600-Oracle

That's a new one.  I'll have to see if I can reproduce it.  Is anyone else having trouble on Windows 10?

3705343

It ran fine for me.

User_60O5F

I did it using OpenJDK 12, this version has no JavaFX installed so I manually installed on the computer. The command I used was

java --module-path "C:\your\path\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib" --add-modules=javafx.controls,javafx.fxml,javafx.media --illegal-access=permit -jar JavaPuzzleBall.jar

It works great!

1 - 12

Post Details

Added on Oct 1 2020
2 comments
416 views