#1 2017-06-23 16:01:54

newtarget
Member
Registered: 2017-04-30

Grid editor error The value is not set for the parameter number 3.

I created a grid editor report and it displays records and I can also insert new records from it. However, when I edit an existing record and then click on Save, throws an exception.   A second issue i have is that it does nothing when I try to delete an existing record.   I have tried this with more than one table.

Am I missing something or doing something wrong?

Here is the script:

import net.datenwerke.rs.grideditor.service.grideditor.definition.db.*

def definition = GLOBALS.getRsService(DbGridEditorDefinition.class)

def adapter = definition.getAdapter()

adapter.setTableName("record_status")
adapter.setPrimaryKey('id')
adapter.addColumns('name', 'code')

return definition;



here is the complete error stack:

java.lang.IllegalStateException: java.lang.IllegalStateException: com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter number 3.<br>    at net.datenwerke.rs.grideditor.service.grideditor.definition.db.DbGridEditorDefinition.commitChanges(DbGridEditorDefinition.java:130)<br>    at net.datenwerke.rs.grideditor.server.grideditor.GridEditorRpcServiceImpl.commitChanges(GridEditorRpcServiceImpl.java:116)<br>    at net.datenwerke.rsenterprise.license.service.EnterpriseCheckInterceptor.invoke(EnterpriseCheckInterceptor.java:35)<br>    at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66)<br>    at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109)<br>    at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)<br>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>    at java.lang.reflect.Method.invoke(Method.java:498)<br>    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:587)<br>    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)<br>    at net.datenwerke.rsenterprise.license.service.EnterpriseCheckInterceptor.invoke(EnterpriseCheckInterceptor.java:35)<br>    at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109)<br>    at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)<br>    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)<br>    at net.datenwerke.rsenterprise.license.service.EnterpriseCheckInterceptor.invoke(EnterpriseCheckInterceptor.java:35)<br>    at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109)<br>    at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)<br>    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)<br>    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)<br>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)<br>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)<br>    at net.datenwerke.rsenterprise.license.service.EnterpriseCheckInterceptor.invoke(EnterpriseCheckInterceptor.java:35)<br>    at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:109)<br>    at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)<br>    at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)<br>    at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)<br>    at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)<br>    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)<br>    at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:89)<br>    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)<br>    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)<br>    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)<br>    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)<br>    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)<br>    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)<br>    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)<br>    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)<br>    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)<br>    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)<br>    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)<br>    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)<br>    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)<br>    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)<br>    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)<br>    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)<br>    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)<br>    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)<br>    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)<br>    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)<br>    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)<br>    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)<br>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)<br>    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)<br>    at java.lang.Thread.run(Thread.java:745)<br>Caused by: java.lang.IllegalStateException: com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter number 3.<br>    at net.datenwerke.rs.grideditor.service.grideditor.definition.db.DbGridEditorDefinitionAdapterImpl.commitChanges(DbGridEditorDefinitionAdapterImpl.java:125)<br>    at net.datenwerke.rs.grideditor.service.grideditor.definition.db.DbGridEditorDefinition.commitChanges(DbGridEditorDefinition.java:127)<br>    ... 55 more<br>Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter number 3.<br>    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:191)<br>    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildParamTypeDefinitions(SQLServerPreparedStatement.java:259)<br>    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildPreparedStrings(SQLServerPreparedStatement.java:218)<br>    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doPrepExec(SQLServerPreparedStatement.java:634)<br>    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:422)<br>    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:372)<br>    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)<br>    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)<br>    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)<br>    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)<br>    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:315)<br>    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:1449)<br>    at net.datenwerke.rs.grideditor.service.grideditor.definition.db.DbGridEditorDefinitionAdapterImpl.flushUpdates(DbGridEditorDefinitionAdapterImpl.java:245)<br>    at net.datenwerke.rs.grideditor.service.grideditor.definition.db.DbGridEditorDefinitionAdapterImpl.commitChanges(DbGridEditorDefinitionAdapterImpl.java:119)<br>    ... 56 more<br>

Offline

#2 2017-06-27 07:59:40

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Grid editor error The value is not set for the parameter number 3.

Hi newtarget,

you have to include the ID column in the column list. If not, reportserver cannot know what column to edit/delete.

So:

import net.datenwerke.rs.grideditor.service.grideditor.definition.db.*
def definition = GLOBALS.getRsService(DbGridEditorDefinition.class)
def adapter = definition.getAdapter()
adapter.setTableName("record_status")
adapter.setPrimaryKey('id')
adapter.addColumns('id', 'name', 'code')
return definition;

you may want to make the id column not-editable. Example:

import net.datenwerke.rs.grideditor.service.grideditor.definition.db.*

def adapter = gridHelper.initDbGridEditor()

adapter.configure(report,"t_settings")
    .setPk('f_id')
    .columns()
        .add('f_id')
            .setEditable(false)
        .add('f_key')
    .done()

return adapter;

Best regards,
Eduardo

Offline

Board footer

Powered by FluxBB