cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Defult ivew True/ False at runtime

Former Member
0 Kudos

Hi,

In my application I have one window and two ivews and i want to show any one VIEW as a defult view at runtime besed on the condition. The condition value i need pass through the webdynpro url parameter.

Regards

Ali

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi R.A.

make to differnt windows, one for each view.

In this window include the view you want to see.

Create for very window one application's. That means two windows two applications.

Create for each application an IView.

Hope this helps

regards

Gunter

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ali,

You can try this:-

1>create 3 Views

2>1st one is the default one and value will true

2>create 2 outbound plugs to the 2nd and 3rd view.

3>In the doinit() of 1st View you can read the application parameter of the Iview and based on the if else logic you call the respective fire plug for the 2nd or 3rd view.

Hope this may help you.

Deepak!!!

Edited by: Deepak Arora on Jul 14, 2010 8:55 AM

Former Member
0 Kudos

Hi Deepak,

Just one question,

i tried to implement your logic but fire plug not able to call the View1 or View2, see the code below.

public void wdDoInit()

{

//@@begin wdDoInit()

// Get the Workitem Id.

String paramContent = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("FLAG");

if(paramContent.equalsIgnoreCase("Y")){

wdThis.wdFirePlugToView1();

}else{

wdThis.wdFirePlugToView2();

}

//@@end

}

but if i use the button and click then moving to view1 or view2. How did you do? plz reply

Thank you.

Ali

Former Member
0 Kudos

Hi Ali,

Try to place this code in the DoInit() of component controller.

Or

Read the application parameter in the controller do init() and pass to the default view and in the doinit() of view try to write if else logic.

Could you plz add testing messages using message manager in between the code so you can check up to what line flow control is coming.

You have to focus on the function calling life cycle(means on hook method).

Hope this may help you.

Deepak!!!

Former Member
0 Kudos

Hi Deepak,

I already tried all these way but no change in result.

But you know msg is printing correctly in if and else both, but fire is not happening.

Any more hints?

Regards

Ali

Former Member
0 Kudos

Hi Ali,

If am not wrong, when ever any event is occurring then only fireplug is working, like you have mentioned, after hit to submit button you are able to achieve the desired functionality.

Just for try (blind guess coz I am not in office, today):-

Try to put your code in the wdModify(), inside the first time if/else condition and then check.

Or

Try to use timer UI element. Set very small value for the time interval and in the event function of timer copy the code and check.

Hope this may help you.

Deepak!!!

Former Member
0 Kudos

Hi Ali,

Just a simple check. Check whether you have created a link between the Outbound and inbound fireplugs of those views. The link between the plugs might be missing.

Regards,

Ajay

Former Member
0 Kudos

Hi R.A.,

How about making use of ViewContainer UI element of the View?

1.Create a third view say 'MainView' in your window and make it a default view.

2.Add two ViewContainer UI elements in this MainView.

3.Emebed your two views in these two ViewContainer UI elements.

4..Bind the 'visible' property of these two ViewContainer UI elements to the context attributes of the type IWDVisibility.

5.Based on the value of the URL parameter, make the visibility 'visble' or 'none' for them

Regards,

Ajay

Former Member
0 Kudos

Hi,

By adding the parameters to the URl you can access the view accordingly.

Pls find below thread for more info:

Regards,

Lavanya.G

Former Member
0 Kudos

Hi Lavanya.G,

Once read the parameter value then how to set Default View to True/false?

What is the code i need to write in onPlugDefault() method? i think we can't assign context element to iview default properties directly.

Thank you

Ali