cancel
Showing results for 
Search instead for 
Did you mean: 

how to capture events from a jsp in a dynpage without using HTMLB

govardan_raj
Contributor
0 Kudos

hi experts,

i have a requirement , where im using jsp dynpage component and here as per sap standards we are using htmbl tags , by which an event raised is captured in the corresponding dynpage java file , is there any other way of raising an event in the jsp and capturing them in dynpage java file without using htmbl .

Regards

Govardan Raj

Accepted Solutions (1)

Accepted Solutions (1)

former_member246153
Active Contributor
0 Kudos

Hi Govardan,

You can achieve this by firing a Ajax call from JSP to your corresponding dynpage compnoent and you can pass parameter also.

Regards,

Srinivasan V

govardan_raj
Contributor
0 Kudos

hi srinivasan

i dont want to call entire dynpage again, i have a button in jsp page ,and using Onclick property ill make ajax call to the dynpage component ...

but i want an option where i need to call only a particular method in the dynpagecompoenent,

like on click of a button in jsp page, i want to execute a validation(Event e) {} method in dynpage comonent , can we do this using ajax ?

Regards

Govardan Raj

former_member246153
Active Contributor
0 Kudos

Hi Govardhan,

If you are looking for a work around, then the work around would be the Ajax call to the Component and inside the doInit method of you component you can write the redirect code based on you ajax call where you can the call the validation method. But if you are looking to hit exactly the method inside the JyspynPage component then i dont think it will be possible.

Regards,

Srinivasan V

rohit_singhal
Active Contributor
0 Kudos

Hi Govardhan,

You can try the following alternatives in your JSP:

1. Separate Abstract Portal Component which only has the required validation method:

var url = "/irj/servlet/prt/portal/prtroot/<application name>.<abstractportalcomponent name>";

url = url + "?sessionid="+ Math.random() +"&<argument 1>="+<value>;

  $.ajax({

  url: url,

  data: value,

  success: function(a,b,c){

  alert("Value passed from server: " + a);

  }

  });

In the above example, you can create a separate abstract portal component in your application which only has the validation method that you want to call.

2. Client Side eventing:

You can create a custom event on your jsp on button click and then subscribe it in any javascript which has to be pre-loaded on the Portal. The script can then be used for validation. For more details you can refer to the following: Client-Side Eventing - Portal - SAP Library

Do let me know in case you need any further details.

Best Regards,

Rohit Singhal

dror_last
Active Participant
0 Kudos

Hi Govardan,

You can look at the following document:

Though it describes how to use SAP UI5 within you portal component it suggest in section 4 how to implement a dynamic ajax mechanism with your component.

Best Regards,

Dror.

Answers (0)