Have had a look at your jsp. Thanks. NO it's clearer.

Behaviour is by design. Your "query select distinct BOOK_ID,TITLE from BOOK
where TITLE like '%Galaxy%'" is based on books title only. They will
retrieve every record with Galaxy. You must include something like "AND
AUTHOR_ID = <author_id selected in main combo>.

No the trick is to know the name of the searchfield in the main form. Have a
look in the documentation, Chapter 15.3:
The  searchFieldNames_tableName collection will do this task.

Hope that helps,
Henner


> 
> Hi all (and Henner).
> 
> Here I have an example based on bookstore where the behaviour 
> of dbSearchCombo is strange. I have 2 forms the master and 
> the detail form. In the inner form I put a dbSearchCombo that 
> make a query on BOOK table "where title like '%galaxy%'.
> 
> When master-dbform is positioned on "Adam Douglas" everything 
> is fine. When the master-dbfform is positioned on "Umberto 
> Eco", the second dbSearchCombo retrieves records of books 
> "Hijacking through the Galaxy 1"... but this books aren't 
> binded with Umberto Eco.
> 
> I'm using 1.1.4pr1 (till the next 15/21 days... then I will 
> upgrade to 1.1.4pr2) To upload (I'havent ever used 
> interceptors... have I only to copy the .jar and .tld files 
> in WEB.INF???).
> 
> 
> This is the test file:
> --------------------------------------------------------------
> --------------------------------------------------------------
> ---------------------
> 
> 
> <html>
>       <%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
>       <head>
>          <db:base />
>          <target="_top">
>       </head>
>    <body>
>    
>       <db:dbform autoUpdate="false" 
>                  
> followUp="/tests/testAuthorBooksSubForm_DbSearchCombo.jsp" 
>                  maxRows="1" 
>                  tableName="AUTHOR"
>       >
>                  <input type="hidden" name="customEvent" 
> value="re_0_0"/>
>                <db:header>
>                <h1 align="center">Edit Authors</h1>
> 
>             <table class="fixed" align="center">
>                <db:errors/>
>          </db:header>
>          <db:body>
>        <db:searchCombo
>              fieldName="AUTHOR_ID"
>              style="width:225px"
>              customEntry=",,true"
>              onChange="this.form.submit();"
>            >
>              <db:queryData
>                  name="AUTHOR_ID"
>                  query="select distinct AUTHOR_ID, NAME from AUTHOR " 
>              />
>            </db:searchCombo>
>  
> 
> 
> 
>                <tr class="even">
>                      <td style="width:300px">ID</td>
>                                <td 
> style="width:100px"><db:label fieldName="AUTHOR_ID"/>&nbsp;</td>
>                </tr>
>                <tr class="odd">
>                     <td style="width:300px">NAME</td>
>                     <td style="width:300px"><db:textField 
> size="25" fieldName="NAME"/></td>
>                </tr>
>                <tr class="even">
>                     <td>ORGANISATION</td>
>                     <td><db:textField size="25" 
> fieldName="ORGANISATION"/>
>                     </td>
>                </tr>
>             <tr class="button">
>                <td colspan="2" style="text-align:center">
>                  <db:updateButton style="width:100" caption="Save"/>
>                  <db:deleteButton style="width:100" caption="Delete"/>
>                  <db:insertButton style="width:100" 
> caption="Insert" showAlways="false" />
>                </td>
>             </tr>
>             <tr class="button">
>                <td colspan="2" style="text-align:center">
>                  <db:navFirstButton style="width:100" 
> caption="<< First"/>
>                  <db:navPrevButton  style="width:100" 
> caption="<  Previous"/>
>                  <db:navNextButton  style="width:100" 
> caption=">  Next"/>
>                  <db:navLastButton  style="width:100" 
> caption=">> Last"/>
>                  <db:navNewButton   style="width:100" 
> caption="New"  showAlwaysInFooter="false"/>
>                  <db:navCopyButton  style="width:100" 
> caption="Copy" showAlwaysInFooter="false"/>
>                  &nbsp;
>                </td>
>             </tr>
>                   <tr>
>                               <td colspan="2" 
> style="text-align:center">
>                                       <h2>sub form</h2>
>                               </td>
>                       </tr>
>                   <tr><td colspan="2" style="text-align:center">
>                           <db:dbform 
>                               autoUpdate="false" 
>                               
> followUp="/tests/testAuthorBooksSubForm_DbSearchCombo.jsp"   
>                               maxRows="*" 
>                               tableName="BOOK_QUERY"
>                               parentField="AUTHOR_ID"
>                               childField="AUTHOR_ID"          
>               
>                               orderBy="ISBN" 
>                           >
>                        <db:header>                    
>                                       <table>
>                                       <tr>
>                                               <td colspan="4">
>                                                       Subform 
> dbsearch combo
>                                                       <db:searchCombo
>                                                              
> fieldName="BOOK_ID"
>                                                              
> style="width:225px"
>                                                              
> customEntry=",,true"
>                                                              
> onChange="this.form.submit();"
>                                                            >
>                                                              
> <db:queryData
>                                                               
>    name="BOOK_ID"
>                                                               
>    query="select distinct BOOK_ID,TITLE from BOOK where TITLE 
> like '%Galaxy%'" 
>                                                              />
>                                                            
</db:searchCombo>
>                                               </td>
>                                       </tr>
>                                </db:header>
>                        <db:body allowNew="true">
>                  <tr>
>                         <td><db:label fieldName="BOOK_ID"/>&nbsp;</td>
>                     <td><db:textField fieldName="ISBN"/>&nbsp;</td>
>                         <td><db:textField fieldName="TITLE" /> </td>
>                         <td>
>                                                        
<db:updateButton style="width:100" > caption="Save"/>
>                                                        
<db:deleteButton style="width:100" > caption="Delete"/>
>                                                        
<db:insertButton style="width:100" > caption="Insert" showAlways="false" />
>                                         </td>
>                      </tr>                                    
>                                       
>                                </db:body>
>                        <db:footer>
>                                         <tr class="button">
>                                               <td colspan="4" 
> style="text-align:center">
>                                                       
> <db:navFirstButton style="width:100" caption="<< First"/>
>                                                       
> <db:navPrevButton  style="width:100" caption="<  Previous"/>
>                                                       
> <db:navNextButton  style="width:100" caption=">  Next"/>
>                                                       
> <db:navLastButton  style="width:100" caption=">> Last"/>
>                                                       
> <db:navNewButton   style="width:100" caption="New"/>
>                                       <db:navCopyButton  
> style="width:100" caption="Copy"/>
>                                                       &nbsp;
>                                               </td>
>                                         </tr>
>                                       <table>
>                        </db:footer>
>                               </db:dbform>    
>                       </td></tr>
>          </db:body>
>          <db:footer>
>                <tr class="button">
>                <td colspan="2">
>                          main form form filter:&nbsp;         
>                                       
>                <db:filter>
>                       <db:filterCondition label="author name like">
>                               NAME LIKE '%?%'
>                               <db:filterValue/>
>                       </db:filterCondition>
>                       <db:filterCondition label="ID >= V1 AND 
> ID <= V2">
>                               AUTHOR_ID >= ? AND AUTHOR_ID <= ?
>                               <db:filterValue label="V1" 
> type="numeric"/>
>                               <db:filterValue label="V2" 
> type="numeric"/>
>                       </db:filterCondition>
>                       <db:filterCondition label="author is">
>                               NAME = '?'
>                               <db:filterValue type="select">
>                                       <db:queryData name="q1" 
> query="select distinct name as n1, name as n2 from author 
> where AUTHOR_ID < 100 order by name"/>
>                               </db:filterValue>
>                       </db:filterCondition>
>                       <db:filterCondition label="author who 
> write more than N books">
>                               (SELECT COUNT(*) FROM BOOK 
> WHERE BOOK.AUTHOR_ID = AUTHOR.AUTHOR_ID) > ?
>                               <db:filterValue type="select" 
> customEntry="10,10,true">
>                                       <db:staticData name="p1">
>                                               
> <db:staticDataItem key="1" value="0"/>
>                                               
> <db:staticDataItem key="1" value="1"/>
>                                               
> <db:staticDataItem key="2" value="2"/>
>                                               
> <db:staticDataItem key="3" value="3"/>
>                                               
> <db:staticDataItem key="4" value="4"/>
>                                       </db:staticData>
>                               </db:filterValue>
>                       </db:filterCondition>
>                       <db:filterCondition label="now is after date">
>                               CURRENT_DATE > ?
>                               <db:filterValue type="date" 
> useJsCalendar="true" />
>                       </db:filterCondition>
>                       <db:filterCondition label="now is after 
> timestamp">
>                               CURRENT_TIMESTAMP > ?
>                               <db:filterValue type="timestamp" />
>                       </db:filterCondition>
>                       <db:filterCondition label="filter 
> without user input">
>                               AUTHOR_ID > 1
>                       </db:filterCondition>
>                </db:filter>
>                  </td>
>                </tr>
>            </table>
>          </db:footer>
>       </db:dbform>
>    </body>
> </html>
> 
> --------------------------------------------------------------
> --------------------------------------------------------------
> ---------------------
> 
> Many thankx
> Ivan
> 
> 
> 
> 
> *********** REPLY SEPARATOR  ***********
> 
> On 30/11/2003 at 21.27 Henner Kollmann wrote:
> 
> >Hi Ivan,
> >
> >dbSearchCombo just builds the whole bunch of select fields for you. 
> >It's the same like generating filter fields manually.
> >So this seems to be a problem of filtering in current version.
> >
> >Please could you make an example based on the bookstore 
> example to help 
> >to find the problem? Or do a little bit debugging in the 
> filter code to 
> >find the bug?
> >
> >Thanks you very much,
> >
> >Henner
> >
> >
> >> -----Urspr�ngliche Nachricht-----
> >> Von: [EMAIL PROTECTED]
> >> [mailto:[EMAIL PROTECTED] Im 
> >> Auftrag von Ivan Codarin
> >> Gesendet: Sonntag, 30. November 2003 21:14
> >> An: [EMAIL PROTECTED]
> >> Betreff: [dbforms] DbSerachCombo
> >> 
> >> 
> >> Dear All,
> >> I discovered that dbSerachCombo is very useful! I'm using
> >> dbforms 1.1.4pr1. But now I have a problem in this kind of 
> situation:
> >> 
> >> I have a "master dbform" based on "table1" (named
> >> masterForm). In this dbform I use a dbSearchCombo to restrict 
> >> the records to one search field.
> >> 
> >> Than I have another nested dbform based on "table2" (named
> >> detailForm) and there are 2 ParentdFields<->ChildFields bindings.
> >> 
> >> In the detailForm I have another dbSearchCombo.
> >> 
> >> My big problem is this: when I use the detailForm
> >> dbSearchCombo I loose the bindings with the masterForm and in 
> >> the detailForm I see records that aren't binded to the masterForm.
> >> 
> >> So I need something like a "hierarchical" dbSearcCombo whith
> >> the first I have to restrict the recordset of the "table1" to 
> >> one type of elements.
> >> 
> >> Then with the second dbSearchCombo (in the detailForm) I have
> >> to restrict the records of the nested form to a subset of the 
> >> records of the "masterForm". This isn't working for me.
> >> 
> >> Many Thanks
> >> Ivan
> >> 
> >> 
> >> 
> >> 
> >> 
> >> -------------------------------------------------------
> >> This SF.net email is sponsored by: SF.net Giveback Program.
> >> Does SourceForge.net help you be more productive?  Does it 
> >> help you create better code?  SHARE THE LOVE, and help us 
> >> help YOU!  Click Here: http://sourceforge.net/donate/ 
> >> _______________________________________________
> >> DbForms Mailing List
> >> 
> >http://www.wap-force.net/dbforms
> >
> >
> >
> >-------------------------------------------------------
> >This SF.net email is sponsored by: SF.net Giveback Program. Does 
> >SourceForge.net help you be more productive?  Does it help 
> you create 
> >better code?  SHARE THE LOVE, and help us help YOU!  Click Here: 
> >http://sourceforge.net/donate/ 
> >_______________________________________________
> >DbForms Mailing List
> >
> >http://www.wap-force.net/dbforms
> 
> 
> 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to