|
I'm new with dbforms. So far
everything looked fine to me, I created nested form for entering invoices
with documentheader table as parent and invoicelines as child.
Browsing records is OK, but when I press navNew button it goes to empty form
which is OK and when I press insertButton form goes to first record in
documentheader, so I have to press navLast button to insert lines in child form.
Is there a way to go directly to newly inserted record
after insert ? I tried with localWebEvent=�navLast� - no
result.
dbforms-config.xml .... <table name="documentheader" defaultVisibleFields="id" > <field name="id" fieldType="int" size="11" isKey="true" autoInc="true"/> <field name="title" fieldType="varchar" size="64"/> <field name="date" fieldType="date" size="10"/> <field name="internalCode" fieldType="varchar" size="32"/> <field name="comment" fieldType="varchar" size="255"/> <field name="companyId" fieldType="int" size="11"/> <foreign-key foreignTable="company" name="company" displayType="select" visibleFields="name" > <reference local="companyId" foreign="id"/> </foreign-key> <!-- add "granted-privileges" element for security constraints --> </table> <table name="invoicelines" defaultVisibleFields="id" > <field name="id" fieldType="int" size="11" isKey="true" autoInc="true"/> <field name="documentHeaderId" fieldType="int" size="11" isKey="true" /> <field name="productId" fieldType="int" size="11"/> <field name="ammount" fieldType="float" size="12"/> <field name="price" fieldType="float" size="12"/> <foreign-key foreignTable="documentheader" name="header" visibleFields="id" > <reference local="documentHeaderId" foreign="id"/> </foreign-key> <foreign-key foreignTable="product" name="product" displayType="select" visibleFields="name" > <reference local="productId" foreign="id"/> </foreign-key> <!-- add "granted-privileges" element for security constraints --> </table> ..... form: invoice.jsp <db:dbform multipart="false"
autoUpdate="false" localWebEvent="navLast" followUp="/invoice.jsp" maxRows="1"
tableName="documentheader"
> .... fileds for documentheader ..... <db:dbform
tableName="invoiceentries" maxRows="*" parentField="id"
childField="documentHeaderId" followUp="/invoice.jsp" autoUpdate="false"
> .... fileds fo insert new invoice line .... </db:footer> </db:dbform>
........ </db:header> ..... invoice lines ......
<db:footer> regards Branimir |
