الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mouse Triggers Like When-mouse-leave And When-mouse-enter Are Not Implemented In Web Deployed Forms

Featured Replies

بتاريخ:

GoalSome mouse triggers like when-mouse-leave and when-mouse-enter are not implemented in web deployed forms. These triggers are functional in client server based forms. For example, these triggers can be used to change the visual attributes of text items dynamically when an user enters and exits with a mouse. How to use a PJC to get the same functionality in web based forms ?



SolutionFirst of all you have to know how to create a PJC with Oracle Jdeveloper.



You have to create a Clienttier -> Javabean and using the code next.

Write a PJC with code as shown below:

package mypackage2;
import oracle.forms.ui.VTextField;
import java.awt.Color.*;
import oracle.forms.handler.IHandler;
import java.awt.event.*;
import oracle.forms.properties.ID;
import java.awt.*;
public class mymousePJC extends VTextField
{


private IHandler m_handler;
private Color m_backgroundcolor;
private Color m_foregroundcolor;

private Color m1_backgroundcolor;
private Color m1_foregroundcolor;

private static final ID ENTER_BACKGROUND_COLOR = ID.registerProperty("ENTER_BACKGROUND_COLOR");
private static final ID ENTER_FOREGROUND_COLOR = ID.registerProperty("ENTER_FOREGROUND_COLOR");

private static final ID EXIT_BACKGROUND_COLOR = ID.registerProperty("EXIT_BACKGROUND_COLOR");
private static final ID EXIT_FOREGROUND_COLOR = ID.registerProperty("EXIT_FOREGROUND_COLOR");

public mymousePJC()
{
super();
enablechangetextcolor();
}
public void init(IHandler handler)
{
m_handler = handler;
super.init(handler);
}

public boolean setProperty(ID pid, Object value)
{
if(pid == ENTER_BACKGROUND_COLOR)
{
m_backgroundcolor= getColor((String)value);

return true;
}
else
if(pid == ENTER_FOREGROUND_COLOR)
{
m_foregroundcolor= getColor((String)value);

return true;
}

else
if(pid == EXIT_FOREGROUND_COLOR)
{
m1_foregroundcolor= getColor((String)value);

return true;
}
else
if(pid == EXIT_BACKGROUND_COLOR)
{
m1_backgroundcolor= getColor((String)value);

return true;
}

else
return super.setProperty(pid,value);
}

public void setForeground(Color p0)
{
// TODO: Override this oracle.ewt.lwAWT.LWComponent method
super.setForeground(p0);
}

public void setBackground(Color p0)
{
// TODO: Override this oracle.ewt.lwAWT.LWComponent method
super.setBackground(p0);
}


private void enablechangetextcolor()
{

addMouseListener(new changetextcolor());

}

public Color getColor(String sColor)
{
Color color = null;
if(sColor.equalsIgnoreCase("blue"))
color = Color.blue;
else if (sColor.equalsIgnoreCase("red"))
color = Color.red;
else if (sColor.equalsIgnoreCase("green"))
color = Color.green;
else if (sColor.equalsIgnoreCase("white"))
color = Color.white;
else if (sColor.equalsIgnoreCase("yellow"))
color = Color.yellow;
else if (sColor.equalsIgnoreCase("orange"))
color = Color.orange;
return color;
}


class changetextcolor extends MouseAdapter
{

public void mouseEntered(MouseEvent me)
{
setForeground(m_foregroundcolor);
setBackground(m_backgroundcolor);
}

public void mouseExited(MouseEvent me)
{
setForeground(m1_foregroundcolor);
setBackground(m1_backgroundcolor);
}
}


}

Compile the PJC and deploy it in a jar file. Place the jar file in the <oracle_home>/forms/java directory and specify the jar file in the archive_jini tag of formsweb.cfg file.

To test this PJC, create a simple form with a text item and a push button. Set the Implementation Class property of the text item to mypackage2.mymousePJC. In the when-button-pressed trigger for the push button, add the following code:

set_custom_property('<text_item>',1,'ENTER_FOREGROUND_COLOR','red');
set_custom_property('<text_item>',1,'ENTER_BACKGROUND_COLOR','blue');



set_custom_property('<text_item>',1,'EXIT_FOREGROUND_COLOR','yellow');
set_custom_property('<text_item>',1,'EXIT_BACKGROUND_COLOR','red');

بتاريخ:

هذا السؤال ضعه في منتدى الفورمز ..

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.