cancel
Showing results for 
Search instead for 
Did you mean: 

closing OVS window - using code.

Karthikrcn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

i have a requirement to display a window with say 5 rows. each row has a check box and a label.

This window has to be opened , similar to an OVS window ie. from an field.

And i have to allow multiple selection of the check boxes in the window.

My doubt

1. I dont think this is achievable by OVS. Is it true ?

2. What i thought is - create an OVS window and as the field opens the OVS window , I will close that

programmatically and open a new pop-up( that i can develop with the above mentioned features).

For 2, could any one please let me know, how do i close OVS window programmatically.

Ayyapparaj, please

I searched the existing discussion threads, but couldnt find any thing similar to this.

Thanks ,

Karthik

Edited by: Karthik Ramachandran on Aug 22, 2008 1:24 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member194668
Active Participant
0 Kudos

Hi Karthik,

Not Ayyapparaj

Yes you are right that desired functionality (selecting multiple rows) is not possible via OVS.

On the event of check box, try to open your own window. Why to open the standard OVS and close it?

We had similar requirement, we opened a new window with custom view in it. The only problem is to close it. The user has to close it on an event.

1. Create a context atribute of type type com.sap.tc.webdynpro.services.session.api.IWDWindow in the parent view

2. Create a new window and emebed a new view

3. On the event in parent view

	IWDWindowInfo winInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("<ur popup window id>");
	IWDWindow win = wdComponentAPI.getWindowManager().createModalWindow(winInfo);
	win.setWindowPosition(600,100);
	win.setWindowSize(400,300);
	win.setTitle("<ur title>");
	win.show();
	wdContext.currentContextElement().set<window instance variable>(win);

4. In the component controller, create a new event closePopup

5. In the component controller, create a new method which invokes the above event

wdThis.wdFireEventClosePopup();

6. In the parent view, create a new event handler and subscribe to the above component controller event.

	IWDWindow win = wdContext.currentContextElement().<window instance variable>();
	win.destroyInstance();

7. In the popup view create an action on an event (say on click of a button to close)

wdThis.wdGet<component controller>().fireClosePopup();

Hope this helps.

-Aarthi

Karthikrcn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aarthi,

Thank you for your prompt reply.

The reason I spoke about OVS popup is - the look and feel.

The custom pop-up i want to show wouldnt open on checking a check box, but just like an OVS window would be opened.(on click of the image/icon - at the end of the input field) Thats why I was saying about closing the OVS.

Because when a normal inputfield is customized for an OVS window, then

- the image appears (at the end of the field, on click of which OVS window would open)

- on click, any way the OVS window would be opened.

Keeping the UI intact, I want to somehow close the OVS window and show my Pop-up.

And this pop-up would contain, checkboxes for the user to select with a label for each of the check box.

And if I could find a way to close the OVS window, then your explanation and code for handling the pop-up would help a lot. ( special Thanks for this ! )

Could you please help me here, on how to close this OVS window ?

Thanks !

Karthik

Former Member
0 Kudos

Hi,

If you want to pop your custom screen create a button with the image similar to the ovs one and place that near to your input field.

Regards

Ayyapparaj

Karthikrcn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ayyapparaj,

Yes, I tried that image in a button and the problem is alignment of the image with the text field.

And image alone doesnt have a onclick event.

I spent one whole day for the alignment and couldnt achieve it.

And then, i started thinking crooked

And one more, do you genuinely believe that it is possible to get the alignment fine ?

If yes, i can try again. But, is there any way to append onclick event to the image ?

Thanks !

Karthik.

former_member194668
Active Participant
0 Kudos

Hi Karthik,

Dont think that I'm diverting you from OVS.

I'm talking of a solution with out a OVS.

You can open the custom window, ontoggle event of checkbox.

And for the image like OVS, what we did is faked it. Just place the OVS image next to an input field. You can get the exact image in the WAS installation directory. End user will not find a difference between standard OVS and this one.

I'm not able to understand you for the need of OVS.

-Aarthi

Former Member
0 Kudos

Hi,

Just tried to make sure that the alignment is perfect

Created a Transparent Containter

Set the following properties

layout GridLayout

colCount 2

stretchedHorizontally false

stretchedVertically false

Added a Input field and a button with imageSource ~sapicons/s_b_aboa.gif

It was rendering fine...

Regards

Ayyapparaj

former_member194668
Active Participant
0 Kudos

Karhtik,

We had linkToAction instead of a button with image.

You can try that.

But only thing is image goes up just by 1 pixel up. For us it was ok. So I didn't bother that much.

You can work on the image in a image editor and move it down by one pixel length below and keep a whitespace above (or transparent). You can definetly achieve this in Adobe photoshop.

-Aarthi

Karthikrcn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aarthi, Hi Ayyapparaj,

Thank you for your input.

Will try to do so and will let you know.( on monday, weekend calling )

Thank you !

Karthik.

Karthikrcn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi All,

I tried with the icon ~sapicons/s_b_aboa.gif but it seems different from the OVS pop-up icon.

and then i created a new icon similar to that.

First tried with button , but the image filled only part of the button and UI wasnt good.

Created a link-to-action and used this image.

Thank you for your input.

Karthik.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

My doubt

1. I dont think this is achievable by OVS. Is it true ?

Ideally when ovs is connected to an Inputfield it works with single row selected from the result...

applyResult method in your Notification listener is the method which can help you to do any enhancements to acheive your scenario.

Regards

Ayyapparaj

Karthikrcn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ayyapparaj,

Thanks for the reply.

Yes , that could be done in the "applyREsult" method.

But the problem is before that.

I request you to have a look at my reply to Aarthi, where i explained (or tried to ? ) where i am stuck.

Thanks!

Karthik.