cancel
Showing results for 
Search instead for 
Did you mean: 

helper.eventURL( , , ) in MAM CODE - What this function does ??

Former Member
0 Kudos

Hi all,

Following are few code lines from MAM code :

// this is in common.inc"

<jsp:useBean id="helper"

class="com.sap.mbs.core.web.ViewHelper" scope="request"/>

-


String allOrderURL = helper.eventURL("onOrderList", "orderListType", "ALL_ORDERS");

helper.getApplicationURL()

-


Could anyone please tell what this eventURL ,getApplicationURL methods are for ?

I couldnt find any documentation that explains it.

Regards,

Vipin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hello vipin,

i think this is just a utility class for generating a

URL for your event.

the code

> helper.eventURL("onOrderList", "orderListType", "ALL_ORDERS");

will generate a string something like

<i>MAM?event=onOrderList&orderListType=ALL_ORDERS</i>

which you can use then in forwarding requests.

im not sure though... just try it.:)

regards

jo

Answers (1)

Answers (1)

Former Member
0 Kudos

Ok Jo.

I will just try this out .

Actually, there is a "mbscore.jar" used in MAM code.

It has many packages.But, i couldnt find any documentation related to it .

Do you have any idea about any such help file or documentation ?

also one more thing

<jsp:useBean id="helper"

class="com.sap.mbs.core.web.ViewHelper" scope="request"/>

I checked in "mbscore.jar" file that com.sap.mbs.core.web.ViewHelper is a abstract class.

Then , how can we use it in a Bean ?

and if it is abstract class , there wont be any implementation of its methods , so where could i find the defination of method eventURL ?

defination i found is:

abstract public interface com.sap.mbs.core.web.viewhelper extends java.lang.Object.

I think i am missing soemthing, dnt know.

could anyone please clarify my doubts ?

regards,

Vipin.

Former Member
0 Kudos

hello vipin,

the class in the useBean directive does not necessarily

mean that it is an implementation class. it could be an

interface as well... the real implementation instance is

being set by the controller servlet into the request scope.

im sure that it has an implementation or subclass somewhere

in your library. i don't have a copy of mbscore.jar, but

if you can send it to me or post it somewhere downloadable,

i can look it over...

regards

jo

Former Member
0 Kudos

Hello Vipin.

Jo is rite.

The class is abstract but the class which is used to create the bean is the implementation class:

<b>DefaultViewHelper</b>

This is the implementation of the abstract class ViewHelper.

The ViewHelper is used to create URLs which are used to load a new page with our without submitting a form.

You can use eventURL to build an URL for a link you want to create (JO's example).

You can use submitEventURL in order to submit your form.

This method builds a call to a JavaScript method.

You can find this method in the file:

app-root/include/common.inc

function submitURL(url).

This function uses url as action for the submit.

So if you use something like this:

onClick="<%=helper.submitEventURL("onOK")%>"

all the form content is written to the context and the onOK method of the corresponding controller class is called. You can get the form content using the context in this controller method then.

When I started working with MAM I was also confused about the mbs.core Framework.

Read this maybe it helps:

Best regards,

Sascha

Message was edited by: Sascha Dingeldey