My Oracle Support Banner

Jdapi Changes Name Of A Forms MenuItem When Setting The Label (Doc ID 2932361.1)

Last updated on AUGUST 10, 2023

Applies to:

Oracle Forms - Version 12.2.1.4.0 and later
Oracle Forms for OCI - Version 12.2.1.4.0 and later
Information in this document applies to any platform.

Symptoms

Environment
----------------------
Forms 12.2.1.4
Windows 64-bit 2019

Problem
------------------
Jdapi changes name of a MenuItem when setting the label

The name of the MenuItem changed to "Label" after calling item.setLabel("LABEL").

Test Case:

Step 1: create a java class
import oracle.forms.jdapi.FormModule;
import oracle.forms.jdapi.Menu;
import oracle.forms.jdapi.MenuItem;
public class PopupMenuTest {
  public static void main(String[] args) {
  final FormModule module = new FormModule("TEST");
  final Menu menu = new Menu(module, "MENU");
  final MenuItem item = new MenuItem(menu, "ITEM_NAME");
  if (!item.getName().equals("ITEM_NAME"))
  throw new IllegalStateException("Error name mismatch: " + item.getName());
  item.setLabel("LABEL");
  if (!item.getName().equals("ITEM_NAME"))
  throw new IllegalStateException("Error name mismatch: " + item.getName());
  }
}

Step 2: Compile the java code

Step 3 Then run and receive the following message:


Exception in thread "main" java.lang.IllegalStateException: Error name mismatch: LABEL
at de.siv.core.forms.PopupMenuTest.main(PopupMenuTest.java:15)

 

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.