Jchem Examples

User 4c0abb5ef9

28-08-2007 14:07:02

Is there an example somewhere in between the jsp simple_db_search and the db_search?





I would like to add a few extra search boxes to the simple search such as Name and Formula search. If I use the db_search example and tick the box "with all user defined fields" then all the fields in my database appear.





However, I don't want all the fields to be displayed and they all have the field option values of <, <=, =, >=, > .


Surely text fields such as name should contain options such as 'contains' , 'starts with' etc.


i.e. <option value="=">equals


<option value="contains">contains


<option value="pre">starts with


<option value="post">ends with





For a numeric field can you also add the search option between two number


i.e. <option value="between">between (xxx yyy)


This would be useful for such fields as bp or mp.








If I add (to the index.jsp file) something like:-


<tr><td align="right"><font face="helvetica" size="1">Formula </td>


<td align="right"><select name='formula'>


<option value='<'>&lt;</option>


<option value='<='>&lt;=</option>


<option value='=' selected>=</option>


<option value='>='>&gt;=</option>


<option value='>'>&gt;</option>


</select></td>


<td><input type='text' name='value1' size='15'>


<input type='hidden' name='field1' value='CD_FORMULA'>


<input type='hidden' name='type1' value='12'>


</td> </tr>





How do I:-


i) Make them searchable


ii) Display the results in the search.jsp screen

ChemAxon e274e1bada

28-08-2007 15:12:48

We have that two examples for db search only, but they are examples, they are to help you creating your own web based db search application. Feel free to use the code, conflate jsp pages.





We haven't got a formula search API at the moment. We plan to implement this, but it has low priority - based on feedback from our last user group meeting.


You can create complex formula searches with SQL LIKE clause against the CD_FORMULA column.





Edvard