Hi,

I've got a form with one textbox (name) and a combobox (type)
When the user presses "submit", a searchpage is called where I execute this 
query (on postgres db)

                        <esql:query>
                                select * from vwProducts
                                        where upper(name) like 
upper('%<xsp-request:get-parameter name="name"/>%')
                                        and typeoid = 
<xsp-request:get-parameter name="type"/>
                        </esql:query>

This works ....

Unfortunately, the combobox must be filled out.  That's not exactly what I 
want because the user may let this one empty (selecting all with a certain 
name without regard to the type)

In that case, my query should be (empty combobox)
select * from vwProducts where upper(name) like 
upper('%<xsp-request:get-parameter name="name"/>%')


Something like this works too:
                        <esql:query>
                                <xsp:logic>
                                       "select * from vwProducts where typeoid = " + 
<xsp-request:get-parameter name="type"/>
                                 </xsp:logic>
                        </esql:query>


If I try this, I get errors :  (Starts when I use an if-clause)
                        <esql:query>
                                <xsp:logic>
                                if (<xsp-request:get-parameter 
name="type"/>.equals("0"))
                                {
                                        "select * from vwProducts"
                                }
                                else
                                {       
                                        "select * from vwProducts where name like 
('%product%')"
                                } ;
                                <xsp:logic>
                        </esql:query>
I've tried several methods, I get:
Illegal start of expression on line ..... 
Method ValueOf() missing ....


Anyone can help me out ??

-- 
Kind regards,
Yves Vindevogel

Implements
Kortrijkstraat 2 bus 1  --  9700 Oudenaarde  --  Belgium
Phone/Fax: +32 (55) 45.74.73  --  Mobile: +32 (478) 80.82.91
Mail: [EMAIL PROTECTED]  --  www.implements.be

Quote: The winner never says participating is more important than winning.

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to