cancel
Showing results for 
Search instead for 
Did you mean: 

Custom javascript functions in mobile webdynpro for java

Former Member
0 Kudos

Hi

We are developing an application for hand scanners. But the client uses different kinds of scanners. For this purpose we have to create some custom java script functions. Can anyone share your experiences on this with us which can guide us in the right way..

The common features between all these scanners are as follows

Windown CE .net 4.2

Always Online wireless network.

Mobile Internet explorer 6.0/Ibrowse which comes along with the scanner.

Edited by: Srikanth Kancherla on Jan 5, 2009 7:13 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srikanth,

I have understood that u want to add javascript in ur application.

U can develop javascript functions in webdynpro using Suspend and Resume plugs.

In suspend plug u give the url of any jsp page in which u can develop javascript function and call the Resume plugin to let the controller back to ur webdynpro application.

Regards,

Srikanth Reddy.T

Former Member
0 Kudos

Hi Srikanth

Thanks for your input. I have executed one sample application on my local portal server. Its working pretty fine. However, when I run the same from the content Administration -> Webdynpro -> Webdynproapplication-> run in the portal it is showing the following exception.

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Suspend-Plug must no be triggered when running in portal. Use portal navigation instead to navigate to another application!

When I replaced the string localhost with <hostname> it worked fine.

Keeping all these things apart, the webdynpro page is replaced with a JSP. Then do I need to build my UI in the JSP page instead of the Webdynpro view ?

Of course, in the JSP page I can implement the java script. But, when a user scannes a barcode, an event is triggered. This is allowed only for intermac/symbol scanners using webdynpro only.

If I want to implement the same for other scanners then I need to implement my own java script code to do this task.

With the solution mentioned, we are using a JSP page where we don't have a Barcode reader UI element.

Pleaes suggest me how should we design the entire application ( not the webdynpro application alone )?

/Srikanth.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

refer this link where he is talking about java script with web dynpro,and he is talking about a rendering frame work where we can implement the java script .

and that will support with CE 7.1

http://help.sap.com/saphelp_nw70/helpdata/EN/f7/f289c67c759a41b570890c62a03519/content.htm

1. Navigate to the view where you want to insert the BarCodeReader.

2. Double-click the view or choose Edit from the context menu.

3. Insert the mobile UI element BarCodeReader.

This interface element is not visible on the user interface and activates the scanning function of the mobile device when the mobile application is called. When the mobile device reads a barcode u2013 that is, the onRead event is triggered u2013 the data is passed to the server and can be stored in the context. The event parameter must be mapped to the parameter of the action.

4. Insert a TextView element u2013 for example, ShowData.

thanks and regards

Manohar

Edited by: Gouri Manohar Gadhamsetty on Jan 6, 2009 5:46 PM

Former Member
0 Kudos

Hi Srikanth,

1)As jsp doesn't contain barcode ui element , U can use EPCF to perform the client eventings in webdynpro.

The EPCF service defines the Enterprise Portal Client Manager (EPCM) JavaScript object. With the methods of the EPCM object you can access the EPCF service functions as follows:

EPCM.[API_method_name]( [Params]* );

iViews can access the EPCM object from every portal page or IFrame. Every iView of the Portal Runtime(PRT) contains the EPCM object. As a result every embedded or isolated iView can use the EPCF service with the method:

EPCM.subscribeEvent(, eventName, eventHandler );

go through the link

http://help.sap.com/saphelp_nw04/helpdata/en/9f/6fa84016631814e10000000a1550b0/content.htm

2)The Web Dynpro Rendering Framework also contains JavaScript at the client and contains numerous enhancements that are specific to Web Dynpro

U can think in this way.

Regards,

Srikanth Reddy.T

Former Member
0 Kudos

Hi Srikanth,

Thanks for your detailed explanation. I tried to code that but the code mentioned in the help document is in java script only. We cannot write the java script code in an view of a webdynpro.. can you please suggest me how should I go ahead and write the java script code..

/Srikanth.

Former Member
0 Kudos

HI,

when you fire the suspend plug you are going to call a JSP file and in that JSP file we are going to write the client side validations if not Java script

http://www.w3schools.com/js/default.asp

regards

manohar

Edited by: Gouri Manohar Gadhamsetty on Jan 15, 2009 1:36 PM

Edited by: Gouri Manohar Gadhamsetty on Jan 15, 2009 1:40 PM

Former Member
0 Kudos

Hi Manohar,

Thanks for your input. I tried the suspend/resume plugs. But my mobile webdynpro app must have some UI controls which are in webdynpro only..

I may not be able to use JSPs for that. Hence looking for other options..

Former Member
0 Kudos

Hi Srikanth,

Check this link.This describes how to programme portal eventing.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d48eaa90-0201-0010-58a8-887fc863...

U can think about Adobe Interactive forms to write java script.

Refer the link

https://www.sdn.sap.com/irj/sdn/adobe#section27

Regards,

Srikanth

Edited by: Srikanth Thatipally on Jan 15, 2009 2:27 PM