cancel
Showing results for 
Search instead for 
Did you mean: 

Tab UI element

Former Member
0 Kudos

Hi Expets,

Can we avoid server hitting when navigating between tabs.

I mean we have two tabs, tab1 and tab2. When the user clicks on tab1, it displays some data. Now when the user navigates to tab2, performs some operation and wants to navigate to tab1. So when the user clicks on tab1, there will be hit to the server. But I don't want to hit the server again and wants to display the previous data without hitting server. Is this possible in Webdynpro or with any feature in CE 7.2

I request to give your suggestions in acheiving this functionality.

Regards

V. Suresh Kumar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Suresh,

If you have assiged the onSelect event to the tab you cannot stop the eventing.

But, you can definately reduce the response time by not calling the DC everytime you select the Tab.

For this you can set a flag in the onSelect event when called first time, and then based on the flag you can can call the DC.

Hope it helps!

Warm Regards,

Upendra Agrawal

Former Member
0 Kudos

Do you have an action assigned to the TabStrip`s onSelect event?

Former Member
0 Kudos

Hi Segmentation Fault

Yes, I am calling another DC for onSelect event.

To be more precise, the tab UI elemet is in one dc. when I click on tab1 I am calling another dc say dcfortab1. Similarly when I click on tab2 I am calling another dc say dcfortab2. So when I come back from tab2 to tab1, I am calling dcfortab1 which is hitting the server. So can we do this without hitting the server because the tab1 will be static and doesn't require any modifications in it.

Can we acheive this with any feature in CE 7.2

Regards

V. Suresh Kumar

Former Member
0 Kudos

Hi Suresh,

while navigating between tab you can check if the previous tab name is tab2 don't call the service for tab 1, by putting a simple condition i think by this way you can avoid the unnecessary round trip. if you need the code please let us know. I'll provide it in next response.

Reagards

Jeetendra

Former Member
0 Kudos

Hi Jeetendra,

Could you please send the code?

Former Member
0 Kudos

Hi Suresh,

Create an event which will be called at onselect of the tab.Create a parameter called oldTabName once now do the parameter mapping with the tabStrip UI element with that event and pass the tabName as the parameter for event. Now in the event you can check this tab name and perform the action required. To give you a brief summery following is the code piece.


public void onActionSelectTab(
			com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent,
			java.lang.String oldTabName) {
		// @@begin onActionSelectTab(ServerEvent)
		if (oldTabName.equals("tab1")) {
			// call the DC2 for tab 2
		}// else do nothing because the old tab is tab 2 and in tab1 data is
			// already present so no need to call the DC1 for tab1 Again
		// @@end
	}

Regards

Jeetendra

Former Member
0 Kudos

Hi,

Thanks all.

Can we use asynchronous views in this scenario without writing logic?

Regards

V. Suresh Kumar

Former Member
0 Kudos

Hi Suresh,

I doubt that asynchronous view will be very useful in such case because it provides the asynchronous functionality to the elements inside the single view i mean elements inside the asynch view but for two different view in your case two different tabs which contains two different views it won't be much helpful that is my opinion. Please do explore the possibilities and workaround for your case if available.

Regards

Jeetendra