Client side event between Java iView and BSP application
Hi,
I am developing a BSP iView which listen to event raised by standard SAP HR TeamViewer iView. The TeamViewer iView raise a event when user click on the employee list.
EPCM.raiseEvent { "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged", concatenatedKey);
My BSP is subscribing to the event and perform the myreceiveEvent function.
EPCM.subscribeEvent
( "urn:com.sap.pct.hcm.orgmanagement:CurrentObject", "objectChanged", myreceiveEvent );
However, my BSP returns an error message saying that EPCM is undefined. I know that I have to included the java script file. I checked with my basis team guy and they said there is not any js file in ICF. Can someone let me know which file I need to include in my BSP code and where is the file locate?
Thanks,
Eric
Hi Eric,
> the ICF where the BSP is stored
> is in the Oracle database
Eric... the place where the JS fragment - within the BSP - appears, is retrieved by some http request. The script=epcfproxy.js forces the browser to send a http request just to the same relative location the original page came from. Doesn't matter if something is within a database...
> Do you know how to locate the
> epcfproxy.js file in the WAS?
I think:
> and the epcfproxy.js file is in the zip file
> that you suggested
you have found it?! Put it to any place on the BSP server you can access, if you can't set it with relative url, use "/some/.../dir/epcfproxy.js" as location.
> If I am only EPCM but not EPCMPROXY,
> do I need to include the epcfproxy.js in my code?
Have a look at epcfproxy.js. It's no magic at all, you have to call top or parent (just look) and do some minor things. For sure, you can live without the proxy file, you have just to put the neede scripts explicitely on your page, that's not that fine, but it works.
Hope it helps
Detlev
Similar Messages
-
Eventing between team viewer and BSP application
Hi Everyone,
Basically, I have a standard BSP application (HCM_LEARNING) on ECC5.0. I need to make it communicate with MSS team viewer.
HCm_learning is a big BSP application from SAP which enables self booking for course, training history data, courses attended, can view courses offered, prebooking, participation history, qualifications achieved, qualifications missing etc. It is a master piece BSP from SAP. It brings the data from the backend system through pernr.
in portal, a manager should see the qualifications of an employee and book courses for him if he misses particular qualifications. hcm_learning is a self booking application; if it communicates with team viewer: that is great. manager can pick a person (name) from team viewer and from there he can take of all the activities 'hcm_learning' does for an employee.
I have spend lot of time watching all the blogs, threads.. searching for this scenario. can not get right information.
is this scenario possible.
could any body tell me where i should look at for documentation. could you give me suggestions on this.
THanks!
SiribabuHi Siribabu,
Did you ever find an answer to this?
Thanks
Jane -
Using events between EP iView and WD iViews
Hello all,
I'm sending an event from EP iView to WD iView.
it is working fine except i can't pass a parameter between them.
Does anyone know how to pass the parameter?
Thanks, Adi.Hi,
> Is this documented
More or less, see http://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/epcf_toolbox/com/sapportals/portal/prt/service/epcftoolbox/package-summary.html
> he can try "parameter1" instead of "dataObject"
> ...
> it basically a EPCF event
That's what I wanted to say, also this script generator cannot generate other JS calls than the JS-API provides. That's why I advise to check the generated code, to get an idea how these "registered parameters" work (if they do).
Hope it helps
Detlev
PS: If it doesn't help, just let the toolbox go and create the JS by yourself. If you really want more than one parameter, encapsualte them into one string like "myfirsparam=123;mysecondparam=456". -
Socket communication failure between Java applet and C++ application
I have a java applet that connects to a C++ application via Java's ServerSocket and Socket objects. THe C++ application is using the Winsock 2 API. The applet and application are running on an NT workstation (SP 6) and using IE (5.5) For a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close. Upon performing a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket. The Java applet can still receive messages from the C++ app but C++ cannot receive responses from the Java side. Java throws no exceptions and an explicit check of the socket shows no errors. Again, what puzzles me is that it works for simple C++ applications. Are there any known conflicts between Java and C++ in this regard?
I have inlcuded the basic java code segments below.
/ run Method.
* This method is called by the Thread.start() method. This
* method is required for the implementation of the Runnable interface
* This method sets up the server side socket communication and
* contiuously loops looking for requests from a external
* socket.
* @author Chris Duke
public void run(){
// create socket connections
boolean success = false;
try {
cServerSocket = new ServerSocket(cPortID);
System.out.println("Waiting for client to connect...");
cClientSocket = cServerSocket.accept();
System.out.println("Client connected");
// Create a stream to read from the client
cInStream = new BufferedReader(new InputStreamReader(
cClientSocket.getInputStream()));
// Create a stream to write to the client
cOutStream = new PrintWriter(
cClientSocket.getOutputStream(), true);
success = true;
}catch (IOException e) {
System.out.println("CommSocket:Run - Socket Exception(1) " + e);
success = false;
// if the socket was successfully created, keep the thread running
while (success){
try{
// check socket to see if it is still available for reading
if (cInStream != null && cInStream.ready()){
// check for an incoming message
String message = ReceiveMessage();
// Send message to listeners
Event(message);
if (cInStream == null){
success = false;
System.out.println("CommSocket:Run - shutdown");
}catch (IOException e){
System.out.println("CommSocket:Run - Socket not ready exception");
break;
// SendMessage method -
* Sends a text message to a connected listener through port specified by portID
* @author Chris Duke
* @param String message - This will be the message sent out through the server
* socket's port specified by portID.
public void SendMessage(String message){
cOutStream.println(message);
if (cOutStream.checkError() == true)
System.out.println("SendMessage : Flush = Error");
else{
System.out.println("SendMessage : Flush - No Error");
}a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close.
This quite strongly implicates the extra code in the C++ App. The firstly thing I would try would be telnet. Try connecting to both versions of the C++ Application and manually reproducing a proper exchange.
a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket.
A correct implementation of recv should return the number of bytes received, or -1 for an error. A zero return indicates no bytes received not a socket closed/error. This sounds like FUD to me.
Are there any known conflicts between Java and C++ in this regard?
I can see no obvious faults, though the code is incomplete, I don't think it's an sockets implementation issue, at either end, it sounds more likely to be a protocol/handshaking bug in the C++ App. -
Using Server Side Cookies between pages of a BSP application
Hi,
I have Page1 which will retrieve some data into a internal table. Once user performs an action I want to set a server side cookie in Page1 and then retrieve that cookie with data in Page2 of the same BSP and display it?
Is this possible using set/get server cookies?
Thanks
KiranHi Kiran,
Yes, you can.
Basically, you set a server-side cookie in the event OnInputProcessing of Page 1 (or the MVC equivalent) :
cl_bsp_server_side_cookie=>set_server_cookie(
exporting
name = 'TEST'
application_namespace = 'NONE'
username = 'NONE'
session_id = 'NONE'
data_value = <your_data_here>
data_name = 'NONE'
expiry_time_rek = 3600 ).
And, you retrieve this information in the OnInitialization event of Page 2 :
cl_bsp_server_side_cookie=>get_server_cookie(
exporting
name = 'TEST'
application_namespace = 'NONE'
username = 'NONE'
session_id = 'NONE'
data_name = 'NONE'
IMPORTING
expiry_date = w_date
expiry_time = w_time
CHANGING
data_value = <your_data_here> ).
Best regards,
Guillaume -
Problem with Interaction between SAP GUI and BSP Applications
Hi Folks,
I am new to BSP and am trying to create a program to created a BSP within the SAP GUI. This is my program, I have tried to find as to what error have I made but I am not able to find out.
I can only find a button post document in the output, but I am not able to trigger any event. Please let me know as to what is the error.REPORT zbsp_iact_gui.
SET SCREEN 100.
* CLASS cl_my_html_yiewer DEFINITION
CLASS cl_my_html_viewer DEFINITION INHERITING FROM cl_gui_html_viewer.
PUBLIC SECTION.
METHODS: constructor IMPORTING parent TYPE REF TO cl_gui_container.
METHODS: on_sapevent FOR EVENT sapevent OF cl_gui_html_viewer IMPORTING action postdata.
ENDCLASS. "cl_my_html_viewer DEFINITION
* CLASS cl_my_html_viewer IMPLEMENTATION
CLASS cl_my_html_viewer IMPLEMENTATION.
METHOD constructor.
super->constructor( parent = parent ).
DATA: event_tab TYPE cntl_simple_events,
event TYPE cntl_simple_event.
event-eventid = me->m_id_sapevent.
event-appl_event = 'X'.
APPEND event TO event_tab.
call method html_control->set_registered_events
exporting
events = event_tab.
SET HANDLER me->on_sapevent FOR me.
ENDMETHOD. "constructor
METHOD on_sapevent.
BREAK-POINT.
IF action CS 'COUNTER'.
DATA: counter TYPE string.
READ TABLE postdata INDEX 1 INTO counter.
SPLIT counter AT '=' INTO counter counter.
MESSAGE counter TYPE 'I'.
ENDIF .
ENDMETHOD. "on_sapevent
ENDCLASS. "cl_my_html_viewer IMPLEMENTATION
DATA: html_viewer TYPE REF TO cl_my_html_viewer,
html_container TYPE REF TO cl_gui_custom_container,
fcode LIKE sy-ucomm.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'TESTHTM1'.
IF html_viewer IS INITIAL.
CREATE OBJECT html_container
EXPORTING
container_name = 'HTML'.
CREATE OBJECT html_viewer
EXPORTING
parent = html_container.
DATA: url TYPE string, urlc(2048) TYPE c.
cl_bsp_runtime=>construct_bsp_url(
EXPORTING in_application = 'ZBSP_IACT_GUI'
in_page = 'Start.htm'
IMPORTING out_abs_url = url ).
urlc = url. " type conversion STRING to C
CONCATENATE urlc '?SAP-CLIENT=650' INTO urlc.
html_viewer->show_url( url = urlc ).
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE fcode.
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Edited by: Nonconformist Pagal on May 12, 2009 1:42 PM
Edited for formatting by: Durairaj Athavan Raja on May 14, 2009 9:50 AM -
Portal Eventing between Web DynPro Java iView and non-Web DynPro iView
Dear Experts,
I have 1 Web DynPro Java iView and 1 non-Web DynPro (using JSPDynPage and JSP) iView, both attached to a page. When Web DynPro Java iView fire a portal raise event, the portal iView did not execute the javascript function tied to the event subscribed.
Here is the code snippet which reside in the Web DynPro Java iView that is used to fire the event
String param = "test";
WPortalEventing.fire("urn:com.company.Test1", "TestEvent", param);
This the code snippet that is in the jsp page
function notifyTest(param)
// Code to print param value here
EPCM.subscribeEvent("urn:com.company.Test1", "TestEvent", notifyTest);
Note:
1. When Web DynPro Java iView fire the portal event the entire page is refreshed, including the non-WDP iView.
2. When EPCM is replaced with window.top.EPCM, the page is refreshed, it is totally hanged with progress bar.
Can anyone help to solve this problem?hi
Please write the below code snippet in ur jsp for notifyTestjavascriptfunction
function notifyTest( eventObj ) {
eventParameter=eventObj.dataObject;
// code to print the parameter "eventParameter"
Thanks
Harsimran -
Portal eventing between Java WD iview to ABAP WD iview?
HI Experts ,
I have requirement on which,
The manager can select an employee from the EE Search iView (Object and Data Provider). All other iViews react on the selection and display data of the selected employee. Technically the personnel number is transferred from the search iView to the other iViews on the portal page, also to the related activity iView. This mechanism is called Eventing. The applications, started via the related activity iView, are launched with the personnel number as parameter. With other words the application, e.g. Manage Objects on Loan, can be directly started for the employee selected from the EE Search iView.
The Employee Information page is based on WD Java whereas the Objects on Loan application described in this specification is based on WD ABAP...........Due to different technologies used how to do the Pernr number transfer between these iviews?
If anybody have done this let me know the steps
Thanks in Advance,
DharaniHi Dharani,
You can use portal events to enable iViews running on the same page to communicate with each other. You just have to find out which event is fired by the WD Java iView and then you will have to register and handle the event in your WD ABAP application : http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/7d6f4151dc5758e10000000a1550b0/frameset.htm
You can use HttpFox (firefox plug-in) to find the details of the fired event (name, namespace...) by looking at the eventQueue parameter in the HTTP POST request.
Regards,
Pierre
Edited by: Pierre DOMINIQUE on Jul 9, 2009 11:16 AM -
Client side event for h:outputText... and other JSF component
Hello friends...
I need client side (to use Java script ) event for change in <h:outputText /> or <h:inputText...>.
I want to open a popup window when there is a change in there. I donot want to use onblur() for this. Is there any thing for achiev it.
Thanks.
Regard
Roshan Lal ( I don't know why there is "DOG" display in LIST )
:-)Hi Jacek,
Unfortunately I think you may be stuck extending Renderer. Another possibility is creating your component via a template, which will be available in JSF 2.0. However, as JSF 2.0 won't be out for a while... you can use JSFTemplating in the meantime:
http://java.sun.com/developer/technicalArticles/J2EE/jsf_templating/
http://www.theserverside.com/tt/articles/article.tss?l=JSFTemplateComponent
Good luck!
Ken Paulsen
https://jsftemplating.dev.java.net -
Eventing between multiple IViews
I have multiple Dynpage IViews on one page. I raise and receive events between the IViews. I can alert the databag or eventObject values. The problem is when I try and write to the IView that has subxcribed to the event.
ending IView:
/****** store initial client data ******/
EPCM.storeClientData( 'urn:myOwnNameSpace', 'myData', '15' );
EPCM.storeClientData( 'urn:myOwnNameSpace', 'myData2', '10' )
/******* set the user name based off of the selected index for Request For *******/
function setRequest(){
var funcName = htmlb_formid+"_getHtmlbElementId";
func = window[funcName];
var ddl = eval(func("Request"));
var selectedIndex = ddl.getIndex();
var name = ddl.getValue(selectedIndex);
EPCM.raiseEvent( 'urn:myOwnNameSpace', 'myRequestFor', name );
Receiving IView:
[code]function myRequestHandler( eventObject ) {
var passedData = eventObject.dataObject;
var temp=EPCM.loadClientData('urn:myOwnNameSpace', 'myData');
var funcName = htmlb_formid+"_getHtmlbElementId";
func = window[funcName];
var myTime = eval(func("myTime"));
myTime.setValue(passedData);
EPCM.subscribeEvent( 'urn:myOwnNameSpace', 'myRequestFor', myRequestHandler);code]
The alert has the data passed but the values are not written back to the JAVA htmlb objects.
I did the same thing using JSP DYnpages and it works. I would prefer nto to use the JSP page. Do I have an optionthe problem is not missing the document element value. I have it. I can alert it to the browser. The problem is forcing the value back to the JAVA HTMLB form element within the class.
The problem is closed. I have gone the JSP route which is working.
Message was edited by: Tom Mosseau -
Hi,
I have 2 seperate iviews, iView1 and iView2. I would like to make a call to the backend database using JCO and pass the ResultSet to iView2. In iView2 format the data and display in a tableview.
Is it possible to pass a Resultset using Clientside Eventing from iView1 to iView2.
To achieve this would it be best to use Client Side Eventing or Session Beans.
Any advice would be appreciated.
Thank you
NACHi NAC,
I already answered your question in two iviews calling each other on a single page?
If it isn't clear, please ask precise what you didn't understand...
Best regards
Detlev -
Hello,
I have been working on some EPCF client side eventing examples. I found the example by Dr. Ron Hendrickx at the following URL.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/iview client side eventing with the epcf toolbox service
So, I imported the .par to Eclipse, I then changed the code so that the sender is a tree holding URL's and the receiver displays them in an IsolatedHtmlContainer and got it working fine.
My problem is this, when I start a new project in Eclipse and copy/paste the code, properties files, the .classpath and .project files (everything) the IClientEventReceiver isReceived() event is never triggered. The doProcessBeforeOutput() method in the receiver is called but the event is not triggered. Seriously, we have copy/pasted everything exactly, the .par file created is identical in structure to Dr. Hendrick's and yet if I create a new project and make all the files it doesn't work. Only when I work with the .par imported from Dr. Hendrickx's work will the example work. We're thinking maybe some environment variable somewhere is causing this but we've copied the .classpath file, everything is exactly the same but the event will not be received in a project we create ourselves.
Really, any help with this will be well appreciated.
David.Pumped isolation method is sort of a combination of embedded and URL isolated. The portal server is used to fetch the content from the website/application. When the data is ready, it is "pumped" into the browser using an IFRAME tag and an XML based data stream. This give you the ability to cache the data on the portal server, but get the flexibility of isolated iViews.
However, we will plan to drop this functionality in the future and "pumped" iviews will automatically be treated as "URL isolated" iviews. -
Tab Strip Selection - Client Side Eventing
Hello All,
I have one tab strip with 5 tab strip item. Inside 1st tab strip I have one htmlb button and I want to trigger 2nd tab strip item while I am clicking the 1st tab strip buttonu2019s client side event.
Is it Possible?
I need Sample Code!
Note: JspDynPage Client Side Event of Htmlb Button.Hi,
Mainly tab strip utilized for random selection.
So i Closed this Thread.
Thank You,
Devasarathy Pandi. -
How to get client side validation for double range and double field in stru
Hi,
I have achieved client side validation by using <html:javascript formName=""/>
All fields shows client side validation but double field and double range field is not shows client side validation but shows server side validation.
I am using Liferay jboss server.
Please tell me a way to achieve client side validation for double field and double range.
Thanks & Regards,
Brijesh BaserI see in the query component there is a QueryListener and a QueryOperationListener. Have you tried letting Jdeveloper create methods for these in some backing bean, and putting in some debug code to see when these methods run? I would think one of them could very well be used to validate the input, somehow; if the input were bad you could just raise an exception and pass your error message, I bet.
If not...
I am pretty sure that there is an appendix in the Fusion Developer's Guide for Forms developers turned to Java...you might look at what it says for post query. I know in the 10.1.3.0 equivalent documentation, they gave reference to a method in the ViewObject which fired for each record after a query was run. You could definitely intercept this query return from there. In fact doing something like this may be something like what Frank N. was intending when he mentioned ViewObjects "validation". Not sure though. I am still learning what new features there are in 11g adf/bc.
Good luck. -
Difference between Java class and JavaBean?
What is the difference between a Java class and a JavaBean?
A class has variables which hold state.
A class has methods which can do things (like change state).
And if I understand a JavaBean it is rather like a BIG class...
i.e.
A JavaBean has variables which hold state.
A JavaBean has methods which can do things (like change state).
So, what's the difference between the two?
And in case it helps...What is the crossover point between the two? Is there a minimalist type JavaBean which is the same as a class? What is the difference between Java beans and Enterprise Java Beans?
Thanks.Introspection, as I understand it is a bunch of
methods which allows me to ask what a class can do
etc. right? So, if I implement a bunch of
introspection methods for my class then my class
becomes a JavaBean?Introspection allows a builder tool to discover a Bean's properties, methods, and events, either by:
Following design patterns when naming Bean features which the Introspector class examines for these design patterns to discover Bean features.
By explicitly providing the information with a related Bean Information class (which implements the BeanInfo interface).
I understand now they are completely different.
Thanks. Very clear.
I do not understand how they are completely different.
In fact I don't have a clue what the differences are
other than to quote what you have written. In your
own words, what is the difference? This is the "New
to Java Technology" forum ;-) and I'm new to these
things.In that case ejbs are way too advanced for you, so don't worry about it.
Maybe you are looking for
-
Outlook 2007 not updating from ical feed
I have removed and re-added the iCal feed multiple times. When I click on a link to the feed it downloads and can open in outlook 2007 (SP3 MSO) but this does not automatically update I have run; 1) Scanpst, 2) The original Install CD Office repair t
-
Creation of multiple Records in reciever as per multiple segments in IDOC
Hi Sap All. i have got a requirement in an IDOC to Webservice where the node in the reciever webservice should be repeated as many times as sender segment in the IDOC repeats. here the problem is the sender IDOC-Segment has got occurance as 0..999 bu
-
I use MS Excel 2007. I want to keep the column fixed whenever I refresh data in pivot tables. I tried even coding it with a macro: Columns("B:F").Select Columns("B:F").EntireColumn.AutoFit And, in another time I tried columnwidth value to
-
Can't get CHM to run off a network drive
Hello. I'm running RoboHelp 6 build 099 on Windows 2000 with service pack 4 installed. My HTML Help file runs great from my hard drive, but I can't get it to do much from a network drive. It displays an "Action canceled" message upon opening, and the
-
I have a cursor that I created myself - Erase.cur and I am trying to write some code that will change the cursor to this on the click of a button. I have tried this code: Cursor eraseCursor = new Cursor("images/Earse.cur") ; setCursor(eraseCursor) ;