on 05-04-2007 5:57 AM
Hello All,
Im using the following code to retreive data from the repository
for (int ij = 0; ij < fieldCount; ij++)
{
for (int j=0; j < rs.GetRecordCount(); j++)
{
Value value2 = rs.GetValueAt(ij, code[j]);
if (value2.IsNull())
{
value2 = value2.Set(" ");
}
wdComponentAPI.getMessageManager().reportSuccess("value2.GetStringValue())" + value2.GetStringValue());
}
I have all the record values in the "value2" <b>now i want to put them in a web dynpro table element, but for that I want to seperate the values in "value2" record wise. so that i can bind the records to the table dynamically.</b> how can i achieve it?
Please advise/help
Regards
Suresh
Hi Suresh,
What I would do in this case,
for (int ij = 0; ij < fieldCount; ij++)
{
<b>// Create Table Element over here</b>
for (int j=0; j < rs.GetRecordCount(); j++)
{
<b>// Set the individual column value for the created table element.</b>
Value value2 = rs.GetValueAt(ij, code[j]);
if (value2.IsNull())
{
value2 = value2.Set(" ");
}
wdComponentAPI.getMessageManager().reportSuccess("value2.GetStringValue())" + value2.GetStringValue());
}
One more thing, your 1st loop should be of Record Loop and the Inner one should be of Field Loop. Which I think you are doing wrong in your program. Your outer loop is Field Loop and inner loop is Record Loop.
Hope this helps.
Regards,
Mausam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks, i could resolve that error myself
Regards
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mausam,
Thanks for the quick response, iam stuck with this for almost 3 days i changed it as per your suggestion
for (int ij=0; ij < recordCount; ij++)
{
IPrivateLogin.ITableValuesElement
TableEle=wdContext.createTableValuesElement();
wdContext.nodeTableValues().addElement(TableEle);
for (int j = 0; j <= fieldCount; j++)
{
value2 = rs.GetValueAt(ij, code[j]);
if (value2.IsNull())
{
value2 = value2.Set("NA");
}
TableEle.setVaAllRecords(value2.GetStringValue());
}
}
(recordCount, fieldCount are having correct values)
But now im gettin the below error
The initial exception that caused the request to fail, was:
java.lang.ClassCastException
java.lang.ClassCastException
at a2i.core.Value.GetStringValue(Unknown Source)
at com.sap.training.Login.getRecords(Login.java:434)
at com.sap.training.Login.onActiononselect(Login.java:500)
at com.sap.training.wdp.InternalLogin.wdInvokeEventHandler(InternalLogin.java:236)
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:330)
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:740)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:693)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:252)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:154)
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.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.