cancel
Showing results for 
Search instead for 
Did you mean: 

Call BSP htm page in Pop up from component view and send back values

Former Member
0 Kudos

Hi,

Please help me with the below requirement.

I have an htm page (page with flow logic) in my component that is calling some web service to fetch some data .

I need to call this htm page from a view on click of a button call it 'Fuzzy Search'. Button is added to the view in .htm page.

I am able to call that htm page (page with flow logic) using 'onclientclick' attribute of button using javascript.


<crmic:button design  = "STANDARD"
                      id      = "FUZZY"
               onClientClick = "var lhurl = '../Z_WW_CRM_IC/fuzzysearch.htm'; window.open(lhurl, 'Search');"
                          text    = " Fuzzy Search " />

But from the pop up, there would be some values returned from web service call in form of internal table (array), which I need to send back to my calling page for setting of collection wrapper of result view.

For this, possible solutions could be

1. calling HTM page in pop up from EH_ONFUZZY using onclick, but how do I return values from HTM pop up to my calling page

2. using 'onclientclick' javascript and return values using opener.window(return values), but then how do i set the collection wrapper as these values I would receive in .htm page of the component view

P.S. Button is coded in component view htm page, please reply considering that.

Waiting for guidance.

Regards,

Rohit Khetarpal

Edited by: Rohit Khetarpal on Mar 17, 2010 2:57 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Avoided this all pop-up thing itself, converted to tableview on same screen and populated using web service call.

Thanks all for the support.

S_K_P
Advisor
Advisor
0 Kudos

Hi Rohit,

As suggested by others, using component usage and custom controller is the best way to share the data between the components. if you can't do that way, here is an alternative which will work Irrespective of technology and UI,

Using Function group and Function module:

1. Create a new function group (FG)

2. in top include of FG define the internal table/structure/variable which is similar to output of your webservice or whatever data you want pass it back to main component.

3. Create function module, something like ZCRFM_SET_DATA, import parameters will be those values you want to pass.

Logic: assign imported values to your global variables declared in top include.

4. Create function module, like, ZCRFM_GET_DATA, export parameter would be those values you want them in main component.

Logic: assign global variables (declared in top include) to exported parameter.

5. Call FM ZCRFM_SET_DATA after webservice method call passing data you got as output from webservice and close the html page.

6. now FG holds the data for you until current session is valid.

7. use FM , ZCRFM_GET_DATA where ever you want in main component to read the data.

8. based on your requirement clear the global variables using one more FM ZCRFM_CLEAR_DATA.

Former Member
0 Kudos

I think the question here is how to call a page with flow logic from a MVC based view in a pop up.

Rohit, sorry mate I have asked around, I think the best way to do is convert your page with flow logic to a MVC based view.

Warm Regards,

Anuj Nagpal.

Former Member
0 Kudos

Hi,

Prasad, thanks for the guidance, i will have to do that if everything else fails, but definitely I hadn't considered that option, thanks for pointing out

Anuj, exactly!! how do i do that! ......n if u can tell....if converting it to MVC is the only way...how do i do that..just creat any controller class and give it in attributes?

Thanks for your help, i just hope i can achieve it quickly today.

Regards,

Rohit

Former Member
0 Kudos

Sorry if I was not clear....

Create a new view and call your webservice in that view. Then you can easily call the view in a pop up.

Warm Regards,

Anuj Nagpal.

Former Member
0 Kudos

Anuj,

I am able to call both page with flow logic and view(created new) in pop up, but I am stuck at reading the values(internal table) in the pop up back to the calling search view, where I need to pass those values in the query object to set result collection.

Thanks,

Rohit

Former Member
0 Kudos

That is good news...

Refer to my first reply you have to define a custom controller with a node which will contain teh result. Pass this controller (Pass by refrence) as a page attribute and then when you get the result set them in t eh collection of page attribute (custom controller). When you come back to your main view you can access teh custom controller.

I hope thsi helps.

AnujN

Former Member
0 Kudos

HI Anuj.

Sorry for coming back late on this, was stuck with some other issues.

Can you give an idea on how do i pass Custom Controller as parameter when calling view in pop up?? I am calling pop using javascript on onclientclick method by passing controller .do class.

I create the new view and new context node and bound it to custom controller, but when it calls the pop up, it goes to Create<contextnode> method and gives exception on Owner->get_custom_controller line, as view manager and view are not initialized when we call view in pop up using java script.

Then i tried access custom controller by storing it in static ref variable, and then setting the collection from on_request method of pop-up, it does not give any exception but result page does not get populated with the result.

Any idea on how to solve it??

Thanks again for your valuable inputs.

Rohit

Former Member
0 Kudos

Hello

I also have simmiler requirment to 'Call BSP page with flow login in Component view .htm page.

Need to pass data bi-directional.

Can you please through some light on this.

Thanks and Regards,

Mazhar

prasenjit_sharma
Active Contributor
0 Kudos

Hi,

Why don't you use a view instead of a page with flow logic? Life would be lot easier if you do that.

Regards

Prasenjit

Former Member
0 Kudos

Thanks for prompt replies.

Prasenjit: View and page with flow logic are already developed and working, I can not completely modify them.

Anuj: Both page with flow logic and view are part of same component. I understand the generic approach, but i need to know how i return multiple values from javascript pop up (that i call using onclientclick of button as in the sample code above), and then set the result collection.

or if instead of that can I call that page with flow logic(fuzzy.htm) in pop up from EH_ONHandler, along with returning the result back on eh_on....

Either way, if i could get the result back from htm page (coming in the on_request method of fuzzy.htm page with flow logic) to my calling htm page, I can set the collection somehow.

Please suggest.

Thanks and Regards,

Rohit Khetarpal

Edited by: Rohit Khetarpal on Mar 17, 2010 3:51 PM

Edited by: Rohit Khetarpal on Mar 17, 2010 3:52 PM

Former Member
0 Kudos

Hi Rohit,

I think calling your page from EH_ON... method will definatley be much easier than onClient..... thing. As per my knowledge it is not very easy (if not impossible) to pass data from javascript to bsp part of your application. What I am understanding is you are trying to call a web service in your bsp page (pop up). if yes how are you calling web service?

Warm regards,

Anuj Nagpal.

Former Member
0 Kudos

Hi,

Thanks for replying again.

calling web service is just calling class method of it from the event handler, from javascript if we do .submit, it goes to event handler. generation of web service can be done in se80.

About calling from EH_ONHANDLER, I was thinking on the same lines, but I still haven't got how do I call .htm page pop up from my component view and send values back!!!! that is where I am stuck and need HELP!

Thanks,

Rohit

Former Member
0 Kudos

Look at class CL_CRM_UIU_ADDR_DUPLICATE method CALL_DUPLICATE_POPUP

This is a very good example on calling pop ups.

Data can still be passed using a common custom controller.

Warm Regards,

Anuj Nagpal

P.S. You may have to create a new usage for your page in runtime repository.

Edited by: Anuj Nagpal on Mar 17, 2010 4:08 PM

Former Member
0 Kudos

Thanks for your reply.

I know how to create usage and interface for views, but how to go about with calling page with flow logic?

Former Member
0 Kudos

Hi Rohit,

I do not know how to do it, I am looking up how can we do that, but just a thought is it really necessary to have a pop up can't you navigate to this view in the main window and get back when once selected.

Warm Regards,

Anuj Nagpal

Former Member
0 Kudos

This might help

more

Edited by: Anuj Nagpal on Mar 17, 2010 4:45 PM

Former Member
0 Kudos

I wish i could change client requirements

may be I can even try that, but finding solution for that first, then suggesting, whole cycle may take more time than original requirement, so i better not think on those lines for now.

Former Member
0 Kudos

I have sent you few threads from other forums in SDN. Look at them they are talking about calling using java script and returning multiplr values there some good thoughts and might click with you. Mean while I keep looking... But I think it is again one of those not possibel to do.

Warm regards,

AnujN

Former Member
0 Kudos

Thanks, I will also keep looking and trying.

Hopefully I can reach to the solution by tomorrow, as I was pretty confident of before I actually started trying. Hope more experts would pour in their views.

Regards,

Rohit

prasenjit_sharma
Active Contributor
0 Kudos

Hi,

If you are using custom controller as the page attribute of your page, then you have an option to set the values to the custom controller. For this you'd have to enhance the Events of the page with flow logic. You might want to look at the events 'onInputProcessing' of the page and set the value to the CuCo attribute, later on you can access the custom controller in your view.

Regards

Prasenjit

Former Member
0 Kudos

Hi Rohit,

I have not done this before but if I had to do I'll take following approach.

Create a customer controller containing maybe two context nodes, one for search criteria and other for Results.

Create a page attribute of "type ref to" as customer controller class, and pass by reference.

Pass this CuCo to your page as a page attribute.

Read the context (from page attribute) for search parameters do your querry and set the result back into respective context node.

Not sure it will work but I will start from here. I think it will make a diffrence if both view and bsp page are part of same component. You can consider enhancing if it is a standard component.

Warm Regards,

Anuj Nagpal

Edited by: Anuj Nagpal on Mar 17, 2010 3:40 PM

Edited by: Anuj Nagpal on Mar 17, 2010 3:41 PM