You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Meredith <Ja...@fimat.co.uk> on 2003/06/11 17:31:40 UTC

RE: Validating search box's

Yes I do need to check (if getMember() == "")

If I use "and" instead of "or", neither works because it still expects all
fields to have a value inputted into them, it's really getting to me. I am
using JavaScript at the moment which solves the problem straight away, but
I would still REALLY like to know how it's done in an ActionForm.

HELP!

Regards

Jason Meredith



|--------+-------------------------->
|        |          "Kandi Potter"  |
|        |          <Kandi.Potter@PW|
|        |          GSC.GC.CA>      |
|        |                          |
|        |          11/06/2003 15:18|
|        |          Please respond  |
|        |          to "Struts Users|
|        |          Mailing List"   |
|        |                          |
|--------+-------------------------->
  >-----------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                       |
  |      To:     "Struts Users Mailing List" <st...@jakarta.apache.org>                                             |
  |      cc:                                                                                                              |
  |      Subject:     RE: Validating search box's                                                                         |
  >-----------------------------------------------------------------------------------------------------------------------|




..do you also have to check for (if getMember() == "") ?

-----Original Message-----
From: Sandeep Takhar [mailto:sandeep_takhar@yahoo.com]
Sent: Tuesday, June 10, 2003 3:12 PM
To: Struts Users Mailing List
Subject: Re: Validating search box's


I think you want to use && instead of ||

sandeep
--- Jason Meredith <Ja...@fimat.co.uk> wrote:
>
> I have a search facility that returns records from a
> database.
>
> There are 9 fields to search from, at least one
> field has to pass a value
> in order to return records, but it can be anyone of
> them. How would I
> create an Action Error for this scenario?
>
> I need to throw an error to alert the user that at
> least one field must be
> used?
>
> The code below obviously doesn't work :(
>
>   public ActionErrors validate(ActionMapping
> mapping,
>                       HttpServletRequest request) {
>     ActionErrors errors = new ActionErrors();
>
>     if(getMember() == null || getAt() == null ||
> getTrdId() == null ||
> getProdId() == null || getCust() == null ||
> getPrice() == null || getStrike
> () == null || getBs() == null || getTranId() ==
> null) {
>       errors.add(ActionErrors.GLOBAL_ERROR,
>            new ActionError("error.field.required"));
>     }
>     return errors;
>   }
>
> Regards
>
> Jason Meredith
>
>
>
>
>
*******************************************************************
> The e-mail and any attachments are confidential.
> They may contain
> privileged information and are intended for the
> named addressee(s)
> only. If you are not the intended recipient, please
> notify us
> immediately and do not disclose, distribute, or
> retain this e-mail
> or any part of it.
>
> Unless expressly stated, opinions in this e-mail are
> those of the
> individual sender and not of the FIMAT Group. We
> believe but do not
> warrant that this e-mail and any attachments are
> virus free.
> You must therefore take full responsibility for
> virus checking.
> The FIMAT Group reserve the right to monitor e-mail
> communications
> through its networks.
>
> Where this communication constitutes a financial
> promotion it is issued
> and approved by Fimat International Banque S.A. (UK
> Branch) and is
> only intended for persons of a kind described in
> article 19(5) of the
> Financial Services and Markets Act 2000 (Financial
> Promotion) Order
> 2001.  This information is not intended to be
> distributed to UK "Private
> Customers" (as defined by the Financial Services
> Authority).
>
> Fimat International Banque S.A. (UK Branch) whose
> registered branch
> in England is at SG House, 41 Tower Hill, London
> EC3N 4SG is authorised
> by the Commission Bancaire in France and by the UK
> Financial Services
> Authority; regulated by the Financial Services
> Authority for the conduct of
> UK Business and is entered in the Financial Services
> Authority's register
> (Register Number 183415), access to which can be
> gained via the following
> link: www.fsa.gov.uk/register/
>
> Member and a SETS Participant of the London Stock
> Exchange ("LSE").
> Where this communication is confirming an "on
> exchange" transaction
> (as defined by the LSE),the transaction is subject
> to the rules of the LSE.
> Any information, opinions, estimates and forecasts
> contained in this
> document have been arrived at or obtained from
> public sources believed
> to be reliable and in good faith which has not been
> independently
> verified and no warranty, express or implied, is
> made as to their accuracy,
> completeness or correctness.
>
> This document is not an offer to sell or a
> solicitation to acquire or dispose
> of an interest in financial instruments.
>
> If you have received this transmission in error,
> please telephone
> +44 020 7676 8999 immediately so that we can arrange
> for its return.
>
*******************************************************************
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org







*******************************************************************
The e-mail and any attachments are confidential. They may contain
privileged information and are intended for the named addressee(s)
only. If you are not the intended recipient, please notify us
immediately and do not disclose, distribute, or retain this e-mail
or any part of it.

Unless expressly stated, opinions in this e-mail are those of the
individual sender and not of the FIMAT Group. We believe but do not
warrant that this e-mail and any attachments are virus free. 
You must therefore take full responsibility for virus checking. 
The FIMAT Group reserve the right to monitor e-mail communications
through its networks. 

Where this communication constitutes a financial promotion it is issued
and approved by Fimat International Banque S.A. (UK Branch) and is 
only intended for persons of a kind described in article 19(5) of the
Financial Services and Markets Act 2000 (Financial Promotion) Order
2001.  This information is not intended to be distributed to UK "Private
Customers" (as defined by the Financial Services Authority).

Fimat International Banque S.A. (UK Branch) whose registered branch
in England is at SG House, 41 Tower Hill, London EC3N 4SG is authorised
by the Commission Bancaire in France and by the UK Financial Services
Authority; regulated by the Financial Services Authority for the conduct of
UK Business and is entered in the Financial Services Authority's register
(Register Number 183415), access to which can be gained via the following
link: www.fsa.gov.uk/register/

Member and a SETS Participant of the London Stock Exchange ("LSE").
Where this communication is confirming an "on exchange" transaction
(as defined by the LSE),the transaction is subject to the rules of the LSE.
Any information, opinions, estimates and forecasts contained in this 
document have been arrived at or obtained from public sources believed
to be reliable and in good faith which has not been independently 
verified and no warranty, express or implied, is made as to their accuracy,
completeness or correctness.  

This document is not an offer to sell or a solicitation to acquire or dispose
of an interest in financial instruments. 

If you have received this transmission in error, please telephone
+44 020 7676 8999 immediately so that we can arrange for its return.
*******************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org