Reading Forms Key Mappings from java bean - how ?
I want to be able to invoke key trigger code in a Forms 10g run-time from a java bean (extends BeanWrapper) either by:
a) using inherited method calls passing the KeyEvent retrieved from my listener, or
b) dispatching a custom event from the bean with a parameter value which identifies the key trigger to process (not the key code & modifier string).
On a), I've not been able to identify any method in the BeanWrapper hierarchy tree that might help me do this, and samples like (http://forms.pjc.bean.over-blog.com/categorie-465294.html) seem to imply that no such method exists.
In terms of b), the oracle.forms.engine.KeyMapTable class seems to be what I want (seems to translate the KeyEvent into a FormAction/string using server settings), but getting a hold of this object through (oracle.forms.engine.Main)getHandler().getApplet() doesn't seem possible.
How are others invoking eg: key-crerec from a Forms 10g bean component in a way which is sensitive to server key mappings ?
Thanks in advance for your help.
I have no experience with KeyEvents in Forms, but if the KeyMapTable class really is the solution, can't you just instantiate one yourself.
Looking at the constructor it only needs a single argument, the oracle.forms.engine.Runform class. You should be able to get a handle on it with:
IHandler hander = getHandler();
if (handler instanceof UICommon) {
UICommon u = (UICommon)handler;
// u.getDispatcher() should get oracle.forms.engine.Runform
}Not sure if it will work, but you can give it a try.
I love pushing the PJC and Oracle Forms applet to its limits. Not really sure if Oracle intended the PJC framework to do stuff like this, but it sure would have helped if they have JavaDoc about the oracle.forms.* classes
Similar Messages
-
How to Read a CAB File from JAVA?
Hi,
Anyone knows how to read a CAB File from java. I need to read a property file of txt file that is packaged in CAB file & then based on that, I have to do processing. Is there anyway to do it.
I had tried using java.util.zip.ZipFile Class, but it does work for JAR, but not for CAB.
siva.Perhaps there's something in the Cabinet SDK that will help:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp -
Creating DAO layer from java beans(setter and getter methods)
Can anybody explain me how to create an adapter layer (DAO layer) from java beans with no connection and transaction code inside DAO layer?
Sure, have another layer do the transaction work.
Your DAO would make us of this layer. -
Creating XML file from Java Bean
Hi
Are there any standard methods in Java 1.5 to create XML file from java bean,
i can use JAXB or castor to do so,
But i would like to know if there is any thing in java core classes,
I have seen XMLEncoder, but this is not what i want.
Any ideas
AshishMarshall JavaBean to an XML document with JAXB or XMLBeans.
-
Problem while calling servlet from java bean
I am trying to call a servlet from java bean in cep.
My java bean:
package com.bea.wlevs.example.algotrading;
import com.bea.wlevs.ede.api.StreamSink;
import com.bea.wlevs.example.algotrading.event.MarketEvent;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class MarketEventBean implements StreamSink {
String s=null;
public void onInsertEvent(Object event) {
if (event instanceof MarketEvent) {
MarketEvent marketEvent = (MarketEvent) event;
try {
JAXBContext cxt = JAXBContext.newInstance(MarketEvent.class);
Unmarshaller unmarsh = cxt.createUnmarshaller();
StringReader strReader = new StringReader(marketEvent.getString_1());
MarketEvent obj = (MarketEvent) unmarsh.unmarshal(strReader);
s=obj.getSymbol();
System.out.println("data: " + s);
} catch(Exception e) {
e.printStackTrace();
try {
System.out.println("test1");
URL url = new URL("http://172.18.21.94:7001/AppServletrecv-Model-context-root/ReceiveServlet");
URLConnection conn = url.openConnection();
System.out.println("test2");
conn.setDoOutput(true);
System.out.println("test3");
BufferedWriter out =
new BufferedWriter( new OutputStreamWriter( conn.getOutputStream() ) );
out.write("symbol="+s);
System.out.println("test4");
out.flush();
System.out.println("test5");
out.close();
System.out.println("test6");
BufferedReader in =
new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
System.out.println("test7");
String response;
while ( (response = in.readLine()) != null ) {
System.out.println( response );
in.close();
catch ( MalformedURLException ex ) {
// a real program would need to handle this exception
catch ( IOException ex ) {
// a real program would need to handle this exception
My servlet code:
package model;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ReceiveServlet extends HttpServlet {
private final static String _SYMBOL = "symbol";
public void doPost(HttpServletRequest request, HttpServletResponse response) {
* Get the value of form parameter
// private final static String USERNAME = "username";
String symbol = request.getParameter( _SYMBOL );
* Set the content type(MIME Type) of the response.
response.setContentType("text/html");
* Write the HTML to the response
try {
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title> A very simple servlet example</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello " + symbol +"</h1>");
out.println("</body>");
out.println("</html>");
out.close();
} catch (IOException e) {
Web.xml:
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
<servlet>
<servlet-name>ReceiveServlet</servlet-name>
<servlet-class>model.ReceiveServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ReceiveServlet</servlet-name>
<url-pattern>/ReceiveServlet</url-pattern>
</servlet-mapping>
</web-app>
My servlet is running in weblogic server.
But when I am running this program in weblogic server side there is no log.
Edited by: 856272 on Jun 23, 2011 6:43 AMI would run both sides in a debugger and see what code is getting invoked
-
We have a requirement to print the w2 forms for employees using java application, how can i implement this. Please give some suggestion.
Anyone any ideas to help please?
-
Plz any 1 can explain what read form and control from do in alv
plz any 1 can explain what read form and control from do in alv
Hi,
<b>READ_FORM</b> is used to get the form related data like WINDOWS, PAGE WINDOWS, etc
<b>CONTROL_FORM</b>
SAPscript control commands can be carried out with CONTROL_FORM. The
command should be specified without the paragraph format '/:' in the
parameter COMMAND.
EX..
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'PROTECT'
EXCEPTIONS
UNOPENED = 01
UNSTARTED = 02.
Thanks,
Naren -
Need some help how to generate xml from java bean.
Hi,
Can some one help me how to generate the xml format output from a java bean.
The bean contains around 15 to 20 attribute values.
Thanks in Advance.
sarayuYou can use XMLEncoder with custom persistence delegates if needed:
http://java.sun.com/products/jfc/tsc/articles/persistence4/ -
Can we Return values from Java Bean to Form
Hi All,
I have a Bean area defined on a Form. The Bean Area consists of a Text field which gets populated by path of a file selected using Browse button.
Can I return this path as a parameter from the Java Bean to the form? Is there any function for this?
Regards,
Prathima.If you designed your bean to offer the ability to exact info/data from it, then yes you can get a value from the bean into the form (pl/sql) - using Get_Custom_Property
Refer to the following which is a good example of how to build a bean. Specifically look at page 12 where is shows how to use Get_Custom_Property.
This is NOT an Oracle supported or provided document or web site, but it is a very good example.
http://forms.pjc.bean.over-blog.com/ext/http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf -
How to Create adf table from java bean
Hi,
How to Create adf table from java class (Not from ADF BC).
Thanks
Satya@vlsn -- you have to follow what shay said.
Do the following in Model layer ::
create a table property java class with your columns setters and getters like :
*public class gridProps {*
private int sno;
private String orderNum;
*public void setSno(int sno) {*
this.sno = sno;
*public int getSno() {*
return sno;
*public void setOrderNum(String orderNum) {*
this.orderNum = orderNum;
*public String getOrderNum() {*
return orderNum;
Create another table java class which will populate the values to your column values and return the collection :
*public class gridPopulate {*
private List<gridProps> gridValues ;
*public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
*if (valuesToSet == null) {*
return gridValues;
gridValues = new ArrayList<gridProps>();
if(btnValue.equals("completeBtn"))
return gridValues;
for(ArrayList<String> tempArr:valuesToSet)
gridProps gp = new gridProps();
gp.setSno(Integer.valueOf(tempArr.get(0)));
gp.setOrderNum(tempArr.get(1));
return gridValues;
Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
Thanks.(My jdev version 11.1.1.5.0) -
How to read the Key value from the Message using the text value.. Urgent
I need to read the Key valuefrom the message pool using the text value for the Key.. Is it possible.. Please help me with sample code..
Thanks and Regards
AvijitAvijit,
I got your requirement. I really dont know the scenario your working on but its possible to do it. There is no direct way to do so, but complexity is in getting to know the Keys dynamically from interface.
Here you go..
try
Class msgClass = IMessageTestWDApps.class;
//Replace IMessageTestWDApps with IMessage<Your WD Component name>
Field keys[] = msgClass.getFields();
IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();
if(keys != null)
String key = "";
for(int index=0;index<keys.length;index++)
key = keys[index].getName();
wdComponentAPI.getMessageManager().reportSuccess("Key= "+key);
if(textAccessor.getText(key).equals("My message text"))
//your logic.
catch(Exception cnfe)
wdComponentAPI.getMessageManager().reportException("Exe "+cnfe.getMessage(),false);
Regards
Abhilash
Message was edited by:
Abhilash Gampa -
Dynamically set ViewObject where clause dynamically from Java bean
I have a requirement to display all of the records from a table when the JSP is first brought up, so my View Object looks like this:
"select emp_name from emp"
Then the users wants to ability to pass paramters to that View Object to refine the list so from by Java class I tried to do this:
ViewObject vo = cpd.findViewObject("EmpViewObject");
vo.setWhereClause("empName = :1");
vo.setWhereClauseParam(1,varEmpName);
vo.executeQuery();
But I am getting JBO errors and I'm not sure what I'm doing wrong. Can anyone offer a hint as to how I can do this?this is exactly how the code is done -
1. emp_name in the View Object
2. emp_name in the where clause
The two are identical. I have tried many variations of this - any time I set the where clause from my bean I get an error.
When I take the SQL stmnt and run it in TOAD it returns expected rows when I run it in the SQL worksheet in JDev it gives an invalid Identifier - but if I hard code the where clause in the View Object it returns the same results as TOAD. -
Monitoring windows services from JavaI Know how to
I know how to start and stop services in java, but how can I see if a process is already stared or is starting?
ThxYou'll need to make a call to a suitable Windows program using Runtime or ProcessBuilder methods, or use JNI (Java Native Interface.) From Wikipedia:
(JNI) is a programming framework that allows Java code running in the Java virtual machine (JVM)
to call and be called[1] by native applications (programs specific to a hardware and operating system
platform) and libraries written in other languages, such as C, C++ and assembly. -
Create a web service from java bean and map exceptions to SOAP faults
Hi,
We have to expose our Session stateless EJB3 as web services. I've tried to use annotations and jdev wizard "java bean to web service" and it works fine.
Our problem now is that our methods can throw a business exception that contains a list of error message strings to be presented on the client.
I did not find any way to use annotations to make it build a wsdl with soap fault mapped to our exception class. Neither I could to make the wizard to create wsdl with faults.
As we are exposing already designed and implemented classes as web services, I think the bottom-top (java->wsdl) approach is better that top->botton (wsdl->java). Therefore, I'm looking for a possibility to generate the web services from the java beans and have the exception be mapped to a soap fault message.
We are using jdev 10.1.3.1 and OAS 10.1.3.1., is there a way to map exceptions to soap faults using bottom->top approach?
thank youA couple of links that may be of help:
http://www.netbeans.org/servlets/ReadMsg?listName=nbj2ee&msgNo=1218
My last question concerning web services:
I have already written a session bean and I'd like to add some methods
as a web service to it, how do I do that?
Or I can only create another bean for a webservice and cannot modify the
original one?You might create web service with existing sources and select you bean. New web services with appropriate lookup method will be generated.
All web service method, that will be exposed in web service, you
should add itself (Pop-up menu Web Service -> Add operation)
http://usersguide.netbeans.org/files/documents/40/73/Chapter9-WebServices.pdf -
Not able to access CD file system from java (or how to)
I am trying to access CDROM from java
program that is running from my HD. I am
accessing as d:\data\ (d: = my cd rom drive)
I am using windows 2000 and jdk1.4. I am getting
java.io.IOException - Access denies.. any pointers please..
- RaviHi friends,
i want to develop an online exam application.
but i am not having any idea how to access CDROM databse from java programe????
Any help ???
Thanks in advance
Navik Pathak
Maybe you are looking for
-
Evaluate function not working in obiee 11.1.1.7
Hi all, I have completed In-place upgrade from obiee 11.1.1.5 to 11.1.1.7. After this I am getting an error while running reports,which is created by using evaluate function. [nQSError: 43113] Message returned from OBIS. EVALUATE_SUPPORT_LEVEL inside
-
What RAM should i get for my iMac?
I'm well overdue new RAM in my iMac as i run Pro tools and Logic with 1GB of RAM and its now come to the point i can hardley do anything with out ''system overload''! however i'm not sure what one i need? does it matter which make it is ? This is my
-
I am trying to cancel my subscription to Acrobat Pro Subscription (One Year Plan)
Please help! I have been attempting to cancel my Acrobat Pro monthly subscription and followed the steps but the window that says "reasons for cancelling" does not pop-up. I am using a PC and based in Auckland, New Zealand
-
Hello, Anyone know how to set the DLN iView to have everything in the tree expanded by default (as opposed to closed). I opened up the par file to make changes using the tag library but I couldn't see any sap delivered code in it. Can any one guide m
-
Can anyone explain these "no sender" emails?