on 07-26-2007 5:09 AM
hi experts,
how can i negivate from one tab to another tab by click on next button in each and every tab
for example to negivate from one view to another view , code is wdThis.wdFirePlugToEducationDetails();
but by using this i am unable to negivate tab to tab
any code on this will be of great help pls.
thank you,
in advance
-
vijai
You are on the wrong track.
- Remove that static variable.
- Create a context attribute "selectedTab" of type "string".
- Bind TabStrip.selectedTab to that attribute.
In the action handlers, just change the value of attribute "selectedTab" to the ID of the tab that should be selected.
And last: Don't use a tabstrip like this.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi all,
thank you, for reply
coming to y'sdays post here is my code which i have writen in view not tabstrip element
still i am getting null pointer error
pls can anybody help me on this issue
code here:below
public static void wdDoModifyView(IPrivatePersonalDetailsView wdThis, IPrivatePersonalDetailsView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
tabs = (IWDTabStrip)view.getElement("TabStrip_AdmissionForm");
//IWDTabStrip tabs = (IWDTabStrip)view.getElement("TabStrip_AdmissionForm");
//tabs.setSelectedTab(wdContext.currentContextElement().getAttributeAsText("tabs"));
//IWDTabStrip tabelement = (IWDTabStrip)view.getElement("TabStrip_AdmissionForm");
//tabelement.setSelectedTab(wdContext.currentContextElement().getAttributeValue());
//@@end
}
public void onActionnext(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionnext(ServerEvent)
tabs.setSelectedTab("EducationalDetailsTab");
}
//@@begin others
static IWDTabStrip tabs;
//@@end
While processing the current request, an exception occured which could not be handled by the application or the framework.
If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
Root Cause
The initial exception that caused the request to fail, was:
java.lang.NullPointerException
at com.uom.ide.admis.PersonalDetailsView.onActionnext(PersonalDetailsView.java:184)
at com.uom.ide.admis.wdp.InternalPersonalDetailsView.wdInvokeEventHandler(InternalPersonalDetailsView.java:207)
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.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
... 26 more
java.lang.NullPointerException
at com.uom.ide.admis.PersonalDetailsView.onActionnext(PersonalDetailsView.java:184)
at com.uom.ide.admis.wdp.InternalPersonalDetailsView.wdInvokeEventHandler(InternalPersonalDetailsView.java:207)
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.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not use a TabStrip to visualize a sequential process. Better use a RoadMap or PhaseIndicator.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The TabStrip UI element is by design not sequential. It allows to select one of any number of views in random order. Thus it is not recommended to use it for visualizing a sequence of processing steps.
On the other side, the RoadMap and PhaseIndicator elements are specifically build to do this.
Armin
hi all,
thank you for quick reply,
Lets assume your tabs are named as Tab1, Tab2, Tab3..etc and your tabstrip is called MyTabStrip
Create a context attribute of type string , lets call it Tab.
In the wdDoModifyView, write the following code:
IWDTabStrip tabElement = (IWDTabStrip) view.getElement("MyTabStrip");
tabElement.setSelectedTab(wdContext.currentContextElement().getTab());
This should be the code for your button Action:
For Tab1 - method onActionTab1
public void onActionTab1(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionTab1(ServerEvent)
wdContext.currentContextElement().setTab("Tab1");
//@@end
}
i found above coding in one of the forum
i want to clear onething
what is this IWDTabStrip, setSelectedTab,getTab()
what i am following code is :
i have tabstrip called Tabstrip_AdmissionForm, in that tabstrip there are two tab called Personaldetailstab and
educationdetailstab
i created two view called Personaldetailview and educationdetailview to embreaded into tabstrip
i created one context attribute called selectedTab and made type as string
in the Tabstrip_AdmissionForm implementation
in wdDoModifyView i added the following code
TabAdmisView tabElement = (TabAdmisView) view.getElement("TabAdmisView");
tabElement.setSelectedTab(wdContext.currentContextElement().getTab());
and in personaldetailsview implementation
public void onActiontoeducation(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiontoeducation(ServerEvent)
wdContext.currentContextElement().setSelectedTab("educationDetailsTab");;
//@@end
}
here i am getting error with setSelectedTab in both methods wdDoModifyView,onActiontoeducation
can anybody help me on this issue pls its urgent.
thank you,
-
vijai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
To solve your issue you have to do the following step:
Step 1: Lets assume your tabs are named as Tab1, Tab2, Tab3..etc and your tabstrip is called 'MyTabStrip'
Step 2: Create a context attribute on the component controller of type string , lets call it Tab.
Step 3: Map this context attribute with all the view.
Step 4: Bind that context attribute 'Tab' with the MyTabStrip <b>SelectedTab</b> property.
Step 5: Write the following code on your view which contains MyTabStrip element,
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.currentContextElement().setTab("<b>Tab1</b>");
//@@end
}
So that by default it will display Tab1.
Step 6: Create a button in the view which is display by Tab1, lets call it 'Next' and create action for that button, lets call it 'NextAction'.
Step 7: Go to the Action method associated with 'Next' Button and write the following code to diaplay 'Tab2'
public void onActionNextAction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionNext(ServerEvent)
wdContext.currentContextElement().setTab("<b>Tab2</b>");
//@@end
}
So that whenever you click on to 'Next' button of Tab1 view it will display Tab2 view.
Step 8: Step 6 & 7 you have to repeate for Tab2 & Tab3.....
-
Hope this will help you----
Thanks & regard,
Pankaj
null
Hi Vijay,
For a TabStrip UI Element there is a property called as "SelectedTab". This
property holds the ID of the Tab, under the TabStrip, that is currently selected.
You can define a string type Context for this property, and then play around with
its value to Select the other Tabs in the Tabstrip on Click of next.
For example, in the onAction<Clicknext>, method, you can check the current
vlaue in the Context defined, and according to that, set the value of that context to
the ID of the Tab appearing Next in the TabStrip.
Hope it helps,
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
a) Let the name of tabstrip be MyTabStrip
b) Let the name of tabs be Tab1, Tab2
c) Create a context attribute of type string called TAB
c) In the method wdDoModifyView , you need to get the reference of the element "MyTabStrip"
d) Change the selectedTab attribute of this Tabstrip to Tab1 or Tab2 depending upon which button the user has clicked
User clicks Tab1
=================
When user clicks Tab1, set the value of context attribute TAB to Tab1
User clicks Tab2
=================
When user clicks Tab2, set the value of context attribute TAB to Tab2
also go through dis
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.