Hi, thanks for your help. I just ran the testAuthorBooksSubForm.jsp from the bookstore application by deploying the latest "war" file and I obtain the following. It is different from your results (the ordering is not as expected). Are we both using the same version ?
dbForm tag in the src: <db:dbform autoUpdate="false" followUp="/tests/testAuthorBooksSubForm.jsp" maxRows="*" tableName="BOOK" parentField="AUTHOR_ID" childField="AUTHOR_ID" orderBy="ISBN" > The executed select statement: [org.dbforms.config.Table.getSelectQuery(Table.java:1751)]-::getSelectQuery - [SELECT BOOK_ID, ISBN, AUTHOR_ID, TITLE FROM BOOK WHERE ( ( ( AUTHOR_ID = ? ) ) ) ORDER BY BOOK_ID,AUTHOR_ID] regards, Jitu On Mon, 2004-08-16 at 16:22, Henner Kollmann wrote: > Just tested this with bookstore/test/testBOOKSList.jsp: > > <db:dbform > multipart="false" > autoUpdate="false" > followUp="/tests/testBOOKSList.jsp" > maxRows="*" > tableName="BOOK" > orderBy="ISBN DESC" > > > > [SELECT BOOK_ID, ISBN, AUTHOR_ID, TITLE FROM BOOK ORDER BY ISBN DESC] > > So in bookstore example it works as you expected. > > > Also subforms are working: > > <db:dbform > autoUpdate="false" > followUp="/tests/testAuthorBooksSubForm.jsp" > maxRows="*" > tableName="BOOK" > parentField="AUTHOR_ID" > childField="AUTHOR_ID" > > orderBy="ISBN DESC" > > > [SELECT BOOK_ID, ISBN, AUTHOR_ID, TITLE FROM BOOK WHERE ( ( ( AUTHOR_ID = ? ) > ) ) ORDER BY ISBN DESC] > > Regards, > Henner > > > > -----UrsprC<ngliche Nachricht----- > > Von: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Im > > Auftrag von jitu > > Gesendet: Montag, 16. August 2004 16:45 > > An: [EMAIL PROTECTED] > > Betreff: [dbforms] Re: orderBy in dbform tag bug > > > > > > Hi, > > > > Sorry for the confusion. I was referring to the problem > > reported by Dziugas Baltrunas on 2004-08-03. > > > > Nevertheless here is an example, > > > > database details: > > > > create table ledger > > ( > > ledg_code char(2) not null, > > userid char(8) not null, > > accid char(16) not null, > > tt char(8) not null, > > jn_type char(4) not null, > > batch_ref char(16), > > ap_yy char(4) not null, > > ap_pp char(2) not null, > > td date not null, > > vd date not null, > > tt_ref char(16), > > due_date date, > > jn integer not null, > > jn_ln smallint not null, > > srcjn integer not null, > > srcjn_ln smallint not null, > > c_code char(8) not null, > > other_amt decimal(16,2), > > conv_rate decimal(10,6) not null, > > ledg_amt decimal(16,2) not null, > > > > ................. > > ............... > > ); > > > > > > create unique index ixuledger on ledger (jn,jn_ln); > > create index ixledger on ledger (ledg_code, accid, > > jn,jn_ln); > > create index ............... > > > > > > dbForms-config entry: > > > > <table name="ledger"> > > <field name="ledg_code" fieldType="char" size="2" isKey="true"/> > > <field name="userid" fieldType="char" size="8"/> > > <field name="accid" fieldType="char" size="16" isKey="true"/> > > <field name="tt" fieldType="char" size="8"/> > > <field name="jn_type" fieldType="char" size="4"/> > > <field name="batch_ref" fieldType="char" size="16"/> > > <field name="ap_yy" fieldType="char" size="4" sortable="true"/> > > <field name="ap_pp" fieldType="char" size="2" sortable="true"/> > > <field name="td" fieldType="date" size="4" sortable="true"/> > > <field name="vd" fieldType="date" size="4"/> > > <field name="tt_ref" fieldType="char" size="16"/> > > <field name="due_date" fieldType="date" size="4"/> > > <field name="jn" fieldType="int4" size="4" isKey="true"/> > > <field name="jn_ln" fieldType="int2" size="2" isKey="true"/> > > <field name="srcjn" fieldType="int4" size="4"/> > > <field name="srcjn_ln" fieldType="int2" size="2"/> > > <field name="c_code" fieldType="char" size="8"/> > > <field name="other_amt" fieldType="numeric" size="16"/> > > <field name="conv_rate" fieldType="numeric" size="10"/> > > <field name="ledg_amt" fieldType="numeric" size="16"/> > > > > ..................... > > .................... > > </table> > > > > > > dbform Tag. > > > > <db:dbform multipart="false" autoUpdate="false" > > followUp="/accEnq.jsp" maxRows="*" tableName="ledger" > > parentField="accid" childField="accid" > > dbConnectionName="chormit" sqlFilter=" ap_yy = (select > > current_ap_yy from compid) " orderBy="td"> > > > > This is what dbForms uses: > > 13770138 [http8084-Processor22] INFO > > org.dbforms.config.Table - ::getSelectQuery - [SELECT > > ledg_code, userid, accid, tt, jn_type, batch_ref, ap_yy, > > ap_pp, td, vd, tt_ref, due_date, jn, jn_ln, srcjn, srcjn_ln, > > c_code, other_amt, conv_rate, ledg_amt,...... FROM ledger > > WHERE ( ap_yy = (select current_ap_yy from compid) ) AND > > ( ( ( accid = ? ) ) ) ORDER BY ledg_code,accid,jn,jn_ln] > > > > > > Comments: > > > > What I required was sorting by "td". Using the same table > > definitions, I should be able to order and filter differently > > in different "jsp"s. > > > > > > regards, > > Jitu > > On Mon, 2004-08-16 at 12:45, jitu wrote: > > > I have encountered the same problem with sorting. The > > orderBy clause > > > in the dbForm tag is superseded by the "order by" clause that is > > > worked out dynamically at run time. This (overriding) uses the keys > > > specified in the dbconfig. The key fields are appended by doing a > > > search from the beginning of the table definition. This > > obviously does > > > not result in actual ordering defined at database level for > > the table > > > concerned either. > > > > > > It would be useful if the Dbform specifications can override the > > > dbconfig definitions. > > > > > > Is there a solution ? > > > > > > regards, > > > Jitu > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by Shop4tech.com-Lowest price on > > Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic > > DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free > > Shipping and Free Gift. > > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > > _______________________________________________ > > DbForms Mailing List > > > > http://www.wap-force.net/dbforms > > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > DbForms Mailing List > > http://www.wap-force.net/dbforms > ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ DbForms Mailing List http://www.wap-force.net/dbforms