Enhanced JavaBeans in Oracle Forms 9i 
Author Message
 Enhanced JavaBeans in Oracle Forms 9i

Hello dear NG,

I am playing around with Enhanced JavaBeans in Oracle Forms 9i, in detail I
want to make a JavaPlugin that includes a Swing-Table. The Bean has
different methods like RefreshGrid and setLine to get Data for the Grid and
to finally show it.
I register and call my JavaBeans with FBean.Register_Beand and FBean.Invoke.

I have a Problem with Invoke. When I call the RefreshGrid Function directly
in the JavaBean all is ok the Table is shown correctly but when I call
RefreshGrid in Forms using FBean.Invoke (like describes in the online help)
the javabean does nothing!! The javabean does not realize that there a call
from forms has happened.

What am I doing wrong?

Many Thanks for your Help!
Greetings from Germany,
Marc Teufel

 I think I have a bug in my test-Java-Code so here the javacode is:

package oracle.forms.pjc;
import java.awt.*;
import java.awt.event.*;
import java.awt.CardLayout;
import javax.swing.*;
import javax.swing.table.*;

public class hGrid extends JTable
{
  CardLayout cardLayout1 = new CardLayout();
  private String m_Separator= null;
  private String m_Header= null;
  private String m_Line= null;

  public String[] SPALTEN_BESCHRIFTUNG_EinzelPos = {
"Spalte1","Spalte2","Spalte3"};
 public  String[][] DATA_EinzelPos = {
  { "1", "195", "Text1"},
  { "2", "196", "Text2"},
  { "3", "195", "Text3"},
  { "4", "196", "Text4"},
  { "5", "195", "Text5"},
  { "6", "196", "Text6"},
  { "7", "195", "Text77"},
  { "8", "196", "Text8"},
  { "9", "195", "Text9"},
  { "10", "196", "Text11"}
    };

  public hGrid()
  {
    try
    {
      RefreshGrid(true);  // That is ok, but If I call this directly in
Forms and remove it from here the table will NOT be shown
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }

  }

  public void RefreshGrid(boolean bInitialize) throws Exception {

    if (bInitialize==true) {

        DefaultTableColumnModel cm = new DefaultTableColumnModel();

        JTable jTable1 = new JTable(DATA_EinzelPos,
SPALTEN_BESCHRIFTUNG_EinzelPos);
        JScrollPane scroll = new JScrollPane(jTable1);
        jTable1.setPreferredScrollableViewportSize(new Dimension(500, 70));
        this.setLayout(cardLayout1);
        this.add(scroll, "scroll");

    }

  }

Quote:
}



Mon, 21 Feb 2005 05:44:51 GMT
 Enhanced JavaBeans in Oracle Forms 9i

For all out there who have the same problems:

I solved it!

There was in fact a mistake in my Java-code, all I had
to do was to import oracle.ewt.LWAWT.* and to
extend LWComponent instead of JTable. Thats all!!!

Bye Marc



Quote:
> Hello dear NG,

> I am playing around with Enhanced JavaBeans in Oracle Forms 9i, in detail
I
> want to make a JavaPlugin that includes a Swing-Table. The Bean has
> different methods like RefreshGrid and setLine to get Data for the Grid
and
> to finally show it.
> I register and call my JavaBeans with FBean.Register_Beand and
FBean.Invoke.

> I have a Problem with Invoke. When I call the RefreshGrid Function
directly
> in the JavaBean all is ok the Table is shown correctly but when I call
> RefreshGrid in Forms using FBean.Invoke (like describes in the online
help)
> the javabean does nothing!! The javabean does not realize that there a
call
> from forms has happened.

> What am I doing wrong?

> Many Thanks for your Help!
> Greetings from Germany,
> Marc Teufel

>  I think I have a bug in my test-Java-Code so here the javacode is:

> package oracle.forms.pjc;
> import java.awt.*;
> import java.awt.event.*;
> import java.awt.CardLayout;
> import javax.swing.*;
> import javax.swing.table.*;

> public class hGrid extends JTable
> {
>   CardLayout cardLayout1 = new CardLayout();
>   private String m_Separator= null;
>   private String m_Header= null;
>   private String m_Line= null;

>   public String[] SPALTEN_BESCHRIFTUNG_EinzelPos = {
> "Spalte1","Spalte2","Spalte3"};
>  public  String[][] DATA_EinzelPos = {
>   { "1", "195", "Text1"},
>   { "2", "196", "Text2"},
>   { "3", "195", "Text3"},
>   { "4", "196", "Text4"},
>   { "5", "195", "Text5"},
>   { "6", "196", "Text6"},
>   { "7", "195", "Text77"},
>   { "8", "196", "Text8"},
>   { "9", "195", "Text9"},
>   { "10", "196", "Text11"}
>     };

>   public hGrid()
>   {
>     try
>     {
>       RefreshGrid(true);  // That is ok, but If I call this directly in
> Forms and remove it from here the table will NOT be shown
>     }
>     catch(Exception e)
>     {
>       e.printStackTrace();
>     }

>   }

>   public void RefreshGrid(boolean bInitialize) throws Exception {

>     if (bInitialize==true) {

>         DefaultTableColumnModel cm = new DefaultTableColumnModel();

>         JTable jTable1 = new JTable(DATA_EinzelPos,
> SPALTEN_BESCHRIFTUNG_EinzelPos);
>         JScrollPane scroll = new JScrollPane(jTable1);
>         jTable1.setPreferredScrollableViewportSize(new Dimension(500,
70));
>         this.setLayout(cardLayout1);
>         this.add(scroll, "scroll");

>     }

>   }

> }



Tue, 22 Feb 2005 03:28:56 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Oracle 9i Database Server and 9i Database 9i Developer Suite Forms Access Problem

2. Oracle Forms 6i Javabeans!

3. Oracle Forms JavaBean - Threedgraphics

4. iAS 9i, JSPs and JavaBeans

5. US-GA-ORACLE DEVELOPER WITH 8I+9I WITH ORACLE FORMS

6. Problem in invoking JavaBean from Oracle 9i / Forms 6i.

7. Forms on the Web and Javabeans

8. Oracle 9i forms

9. REPOST: Urgent Help Please! Oracle 9i and Forms

10. Urgent Help Please! Oracle 9i and Forms

11. Should I study Oracle 8i/9i or 9i directly/


 
Powered by phpBB® Forum Software