Hi Bill,

If I understood correctly, the first access to that page should not display records.
You could use a dinamic filter / whereClause with an "impossible" condition, like "1 != 1" (works with Oracle and Postgresql).
So, if the user enter to that page, it will be used the default filter. If the user fills the search form, the filter will be built using the input conditions.


Regards,
Luca


Bill Tribley ha scritto:

I have a working page inspired by the examples that has

search area
search results display area

on the same page.

It works very well, except that the first time the page loads, before any search has been performed, every record from the table is displayed up to the maxRows limit. While it works, it is sloppy and not what the user expected. I also do not really want to limit the number of rows.

I have thought of these possible fixes:

1. Use a dynamic whereClause tag where "lastname LIKE "+[search text box value]+"%"
2. Suppress the body on the first pass. Can't figure out a way to do this.
3. Conditionally display the body only if something has been entered into the search text box. Can't see how to do this easily.


To do #1 I must have access to the current value of the form variables. How can you get this for ordinary html form controls and for dbforms controls?


Relevant Code

      <db:errors/>
      <db:dbform
                multipart="false"
                autoUpdate="false"
                maxRows="50"
                tableName="eperson"
                orderBy="f_key,firstname"
            >

--stuff omitted

Search input box containing the fragment of lastname to search
<td>
<input type="text" name="<%=searchFieldNames_eperson.get("lastname") %>" size="17" />
</td>


-- stuff omitted

            <db:body>
               <tr bgcolor="#<%= (i++%2==0) ? "FFFFCC" : "FFFF99" %>">
                  <td>
                     <db:associatedRadio name="r_personkey" />
                  </td>
                  <td>
                     <db:label fieldName="firstname" />
                  </td>
                  <td>
                     <db:label fieldName="lastname" />
                  </td>
               </tr>
            </db:body>


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ DbForms Mailing List

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






------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ DbForms Mailing List

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

Reply via email to