cancel
Showing results for 
Search instead for 
Did you mean: 

View in Dialog

Former Member
0 Kudos

All,

I have a window which has a view called Main. There is a button in Main view, The moment i click the button, I wanted to open another view in dialog mode. But I dont wanted to create another Window to open a dialog.Is it possible? If yes, How can we do that? Please Help..

If its not possible, can you tell me why?

BM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Define "dialog mode".

Armin

Former Member
0 Kudos

Armin,

Thanks for your reply. Could you please explain me in detail?

Im trying open a view in dialog with below code but gettting an error:

 public void onActionOpenView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionOpenView(ServerEvent)
 
	IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI
	  .getComponentInfo()
	  .findInViews("DialogView");

	  IWDWindow window = wdComponentAPI.getWindowManager()
	  .createModalWindow( windowInfo);
	  window.setWindowPosition(300, 150);
	  window.open();

    //@@end
  }

<b>ERror:</b>

java.lang.ClassCastException 

    at com.tech.examples.welcome.WelcomeComponentView.onActionOpenView(WelcomeComponentView.java:234)
    at com.tech.examples.welcome.wdp.InternalWelcomeComponentView.wdInvokeEventHandler(InternalWelcomeComponentView.java:166)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
    at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
    ... 23 more

BM

Former Member
0 Kudos

You get the class cast exception because method findInViews() does not return an IWDWindowInfo.

See the other thread by Mathi S. There I gave sample code using findInWindows().

Armin

Former Member
0 Kudos

Hi Bharathi,

you are trying to cast an IWDViewInfo to IWDWindowinfo.

Please look at this for a correct usage.

Regards

Stefan

P.S.: Forget my answer, Armin was quicker than me.

Message was edited by:

Stefan Klensch

Former Member
0 Kudos

Thanks again..Just my question is, Is it possible to call view in Dialog mode (without creating additional window or not?

BM

Former Member
0 Kudos

Hi Stefan,

where have you been the last 3 years?

Armin

Former Member
0 Kudos

Stefan,

The thread which you refered is not having solution which im looking for..I want to call a view in Dialog mode without creating another window..

Thanks..

BM

Former Member
0 Kudos

Armin,

Yes in Mathis thread you asked to create another Window which I dont wanted to do that. Could you pls help, How to create Dialog view without creating another window..Is it possible?

BM

Former Member
0 Kudos

Hi Armin,

some day the amount of my daily work didn't allow me to contribute any longer as seriously as i always tried to do in the earlier days of SDN.

And, even worse, since Web Dynpro was and is still evolving in a tremendous speed, if you don't keep up to date with the material (since there's a lack of spare time) you're getting "off-topic" quite quickly.

But i was always there as a passive member...this might change again

Nevertheless, nice to meet you again.

Regards,

Stefan

Former Member
0 Kudos

Barathi,

i'm not quiet sure, what you mean by "calling a view in dialog mode".

A view just defines layout and behaviour of a rectangular area of the user interface. If you put a view into a window and use the code snippet mentioned earlier, you'll get a modal dialog containing the view contents.

If you don't want this, you even have to embed the view into a window. A view is not "able to live" without a window.

Please have a look at the <a href="http://help.sap.com/saphelp_nwmobile71/helpdata/en/44/7e0d1ff9a63abee10000000a155369/content.htm">SAP Help Files</a>.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

Thanks...I agree with you, View cant live without window.

Say I have window called MainWindow..It has 2 views say Mainview, DialogView.

both are embeded into MainWindow.

When I click a Button MainView, Is it possible to open the DialogView in Dialog mode?

BM

Former Member
0 Kudos

If you want to replace a view1 by a view2 inside the same window, embed both views into the window and navigate from view1 to view2.

Armkin

Former Member
0 Kudos

Armin,

Im not sure whether Im explaining properly or not.. User has to see both the Views...MainView will be in Parent and Dialog needs to be shown in Dialog mode..

Is it possible with embedding in same window? If yes how to do that..

BM

Former Member
0 Kudos

Bharathi,

please clarify, do you want to:

1. display MainView in the (let's call it) "main area" of the browser and DialogView in an own separate (modal) dialog window if the user presses a button -or-

2. display MainView in the "main area" of the browser and DialogView in an own separate (modal) dialog window <b>without</b> the user doing anything -or-

3. display MainView and DialogView in the "main area" of the browser?

Regards

Stefan

Former Member
0 Kudos

Thanks for your patience...My MainView & DialogView both are in <b>same window</b> say "Main area".

When I click on Button on Mainview I wanted to <b>open Dialogview in Dialog Mode</b>...

Here I have only one Window & 2 views..Dialogview needs to be opened as popup..

Is it possoble?

BM

Message was edited by:

Bharathi M

Former Member
0 Kudos

Bharati,

if you embed two views into one window (without using a ViewSet), only <b>one</b> view will be visible (MainView or DialogView).

Let's call the window of the main area "MainWindow".

There's no need to place DialogView into MainWindow despite you want to navigate from MainView to DialogView inside of MainWindow (like Armin stated).

The simple solution is to create a new window called "DialogWindow" and follow the steps of the code snippet in the thread posted earlier.

Of course it's possible to embed multiple views into one window, but only one view is active and visible inside of a window at a discrete time.

If i got you right, you want to place a button inside of MainView (currently visible inside of MainWindow) and as a reaction open the DialogView (in the newly created DialogWindow).

This is exactly what the code snippet already mentioned does.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

I think we have a slight misunderstanding here. When you say "window" you probably mean "browser window". But that's not the case. For a popup dialog (which is not displayed in its own browser window), you also have to create a separate Web Dynpro window. Just try it.

Armin

Answers (0)