Can someone tell me how to insert a value into <db:textField >
that is created in DB.
I have a transactions ID, that is unique and is generated
in oracle DB as sequence.
Hello,
I have the same problem.
Using an interceptor like the BookstoreInsertDataInterceptor I'm receiving the next error:
Error:
* Field GEN_ID should be calculated by RDBMS, remove it from the form
In my form (in the jsp) I have this line: <db:textField fieldName="GEN_ID" hidden="true"></db:textField>
and the interceptor is very simple:
public int preInsert(HttpServletRequest request, Table table, FieldValues fieldValues,DbFormsConfig config, Connection con) throws ValidationException {
long id = 8;
setValue(table, fieldValues, "GEN_ID", String.valueOf(id));
return GRANT_OPERATION;
}
(8 is the nextval of the sequence)
What I'm doing wrong?
Thanks in advance,
Sonia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I believe that if you are using something like an Oracle sequence generator to generate your primary key then you should not have your field "GEN_ID" set as autoInc="true" in your dbforms-config.xml file. This is only for use if you are using an auto-id field such as is available in MS SQLServer or MySQL.
Your interceptor code looks fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Can someone tell me how to insert a value into <db:textField >
that is created in DB.
I have a transactions ID, that is unique and is generated
in oracle DB as sequence.
<db:textField size="1" overrideValue=TXN_ID.nextval hidden="true" fieldName="TXN_ID"/>
above does not work
thank you in advance
You need an interceptor to do this.
Please ask your questions in the mailing list so that more people can help you!
Thanks
Henner
Can you please point me where and how to do that,
i can see lists only in read-only mode?
Have a look at the documentation and the bookstore example.
See the BookstoreInsertDataInterceptor class for an example.
Henner
Hello,
I have the same problem.
Using an interceptor like the BookstoreInsertDataInterceptor I'm receiving the next error:
Error:
* Field GEN_ID should be calculated by RDBMS, remove it from the form
In my form (in the jsp) I have this line: <db:textField fieldName="GEN_ID" hidden="true"></db:textField>
and the interceptor is very simple:
public int preInsert(HttpServletRequest request, Table table, FieldValues fieldValues,DbFormsConfig config, Connection con) throws ValidationException {
long id = 8;
setValue(table, fieldValues, "GEN_ID", String.valueOf(id));
return GRANT_OPERATION;
}
(8 is the nextval of the sequence)
What I'm doing wrong?
Thanks in advance,
Sonia
I believe that if you are using something like an Oracle sequence generator to generate your primary key then you should not have your field "GEN_ID" set as autoInc="true" in your dbforms-config.xml file. This is only for use if you are using an auto-id field such as is available in MS SQLServer or MySQL.
Your interceptor code looks fine.