public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* Required Field Validate on Edit PR
@ 2004-05-06  9:07 Ray Tran
  2004-05-07 15:20 ` Mel Hatzis
  0 siblings, 1 reply; 2+ messages in thread
From: Ray Tran @ 2004-05-06  9:07 UTC (permalink / raw)
  To: help-gnats

Hello,

I have the following in my State field

    on-change "State[type]==\"feedback\"" {
         require  { "Custom_Text" }
    }

How does Gnatsweb verify that the Custom_Text field is filled in when 
the PR is modified? I'm unable to get the validation to work. In other 
words, when I change the State to feedback, Gnatsweb does not check to 
see if Custom_Text is filled in before the PR is submitted. Thank-you 
for your help.

Thanks,

Ray Tran
Broadcom Corporation




_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Required Field Validate on Edit PR
  2004-05-06  9:07 Required Field Validate on Edit PR Ray Tran
@ 2004-05-07 15:20 ` Mel Hatzis
  0 siblings, 0 replies; 2+ messages in thread
From: Mel Hatzis @ 2004-05-07 15:20 UTC (permalink / raw)
  To: ray.tran; +Cc: help-gnats

Hi Ray, ....

On 05/05/2004 07:30 AM, Ray Tran submitted:
> Hello,
> 
> I have the following in my State field
> 
>    on-change "State[type]==\"feedback\"" {
>         require  { "Custom_Text" }
>    }

The above clause may be something different to what
you're expecting. The "State[type]" specifier is where
the confusion may lie, in that it does not denote the
value of the State field in the PR but something entirely
different. To help explain what State[type] refers to,
here's an excerpt from some documentation I've written:

| Fields of type enumerated-in-file consist of colon delimited
| subfields - these define the format for each line of the file
| containing the enum values. Each line of this file can be
| thought of as a record with associated attributes.
|
| The subfields define meta-data attributes of such enum fields.
| For example, the 'category' field consists of the following
| subfields:
|
|    * category (the primary key)
|    * fullname (the description
|    * person   (the primary responsible)
|    * notify   (a list of email recipients to notify)
|
| The first subfield of each value of an enumerated-in-file field
| is always the primary key for the field (it defines the set of
| valid values for the field).
|
| The subfield specifier is only valid for enumerated-in-file fields
| and is used to refer to a particular subfield value when used as a
| suffix to a field name. For example, the query expression
|
|    category[person] == "fred"
|
| will match all PR's whose value for Category is a member of the set
| of category values whose person subfield is equal to "fred".

You can get the entire contents of this documenations from:
http://professional.juniper.net/gnats/query_internals.html#O_FieldMod

To require the Custom_Text field whenever the value of State
changes to "feedback", remove the "[type]" specifier from your
on-change clause above.

> How does Gnatsweb verify that the Custom_Text field is filled in when 
> the PR is modified? I'm unable to get the validation to work. In other 
> words, when I change the State to feedback, Gnatsweb does not check to 
> see if Custom_Text is filled in before the PR is submitted. Thank-you 
> for your help.

Once you've modified the on-change clause as suggested above, attempts
to submit a PR without a value for the "Custom_Text" field will generate
an error, whenever the State field changes to "feedback"....something
along the lines of "Required field Custom_Text missing from PR".

[ Note: My answer above is making an assumption that you don't have a
   State type of "feedback"...if this is not the case, please accept my
   apologies for the incorrect assumption. ]

--
Mel Hatzis


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-07  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-06  9:07 Required Field Validate on Edit PR Ray Tran
2004-05-07 15:20 ` Mel Hatzis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).