PDA

View Full Version : vdfRequired doesn't work?



Bob Worsley
27-May-2007, 01:41 PM
I've been using vdfRequired which works fine in everything except a calendar
lookup, and maybe other lookups?

<td class="Label">Invoice Date:</td>
<td> <input type="text" size="12" maxlength="10" title="Invoice Date"
name="invoice__inv_date" value="" />
<input class="CalendarButton" type="button" value=" "
onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');" title="Allowed -
Today to 30 days ago." tabindex="-1" vdfRequired="false" />
</td>

Tabbing across a date lookup field as such lands the cursor in the calendar
button, so if you then click in the field like a user would (right or
wrong...) and then attempt to tab out, you will get the required error even
if vdfRequired is set to false as above.

Unless I'm missing something...

And along a similar line, in VdfValidator.prototype.validateFieldClient in
vdfValidor.js, bRequired defaults to true. Wouldn't it make more sense to
default it to false? If true I need to set every form to false where if
false all I need to do is set the few I want required rather than almost all
of them. Unless I can set the parent to false...

Bob

Edwin van der Velden
29-May-2007, 02:24 AM
The vdfRequired should be set on the input field not the calendar button,
like:

<input type="text" size="12" maxlength="10" title="Invoice Date"
name="orderhea__order_Date" value="" vdfRequired="true" />
<input class="CalendarButton" type="button" value=" "
onclick="show_VdfJPopCalendar(this, 'orderhea__order_Date');"
title="Allowed -
Today to 30 days ago." tabindex="-1" vdfRequired="true" />

What I don't understand is the defaulting to required you mention, it is
true that bRequired is set to true in the functio you mention, but it''s not
used as such to check if the field is required. the actual check starts
with:

if(bRequired && oVdfForm.getVdfFieldAttribute(oField, "bRequired")){

where oVdfForm.getVdfFieldAttribute(oField, "bRequired") is false if the
vdfRequired attribute is not set, I've never seen it check for required
value without setting vdfRequired to true and have not been agble to
reproduce it as such. Maybe it's a different type of check, checks that
might happen are find required, value type checks (like date).

-Edwin


"Bob Worsley" <bworsley@comcast.net> wrote in message
news:AUREE6IoHHA.1668@dacmail.dataaccess.com...
> I've been using vdfRequired which works fine in everything except a
> calendar
> lookup, and maybe other lookups?
>
> <td class="Label">Invoice Date:</td>
> <td> <input type="text" size="12" maxlength="10" title="Invoice
> Date"
> name="invoice__inv_date" value="" />
> <input class="CalendarButton" type="button" value=" "
> onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
> title="Allowed -
> Today to 30 days ago." tabindex="-1" vdfRequired="false" />
> </td>
>
> Tabbing across a date lookup field as such lands the cursor in the
> calendar
> button, so if you then click in the field like a user would (right or
> wrong...) and then attempt to tab out, you will get the required error
> even
> if vdfRequired is set to false as above.
>
> Unless I'm missing something...
>
> And along a similar line, in VdfValidator.prototype.validateFieldClient in
> vdfValidor.js, bRequired defaults to true. Wouldn't it make more sense to
> default it to false? If true I need to set every form to false where if
> false all I need to do is set the few I want required rather than almost
> all
> of them. Unless I can set the parent to false...
>
> Bob
>
>
>

Bob Worsley
29-May-2007, 06:14 PM
I do have the vdfRequired on the input, it's at the end. I guess I had it
on the lookup too, but that was in desparation.

In vdfValidator.js we have the following line:

var bResult = true, bRequired = true;

which to me indicates the default for the property is true. I had to set
vdfRequired=false in several input lines to stop them from requiring entry.
Bob


"Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in message
news:axDp2JcoHHA.312@dacmail.dataaccess.com...
> The vdfRequired should be set on the input field not the calendar button,
> like:
>
> <input type="text" size="12" maxlength="10" title="Invoice Date"
> name="orderhea__order_Date" value="" vdfRequired="true" />
> <input class="CalendarButton" type="button" value=" "
> onclick="show_VdfJPopCalendar(this, 'orderhea__order_Date');"
> title="Allowed -
> Today to 30 days ago." tabindex="-1" vdfRequired="true" />
>
> What I don't understand is the defaulting to required you mention, it is
> true that bRequired is set to true in the functio you mention, but it''s
not
> used as such to check if the field is required. the actual check starts
> with:
>
> if(bRequired && oVdfForm.getVdfFieldAttribute(oField, "bRequired")){
>
> where oVdfForm.getVdfFieldAttribute(oField, "bRequired") is false if the
> vdfRequired attribute is not set, I've never seen it check for required
> value without setting vdfRequired to true and have not been agble to
> reproduce it as such. Maybe it's a different type of check, checks that
> might happen are find required, value type checks (like date).
>
> -Edwin
>
>
> "Bob Worsley" <bworsley@comcast.net> wrote in message
> news:AUREE6IoHHA.1668@dacmail.dataaccess.com...
> > I've been using vdfRequired which works fine in everything except a
> > calendar
> > lookup, and maybe other lookups?
> >
> > <td class="Label">Invoice Date:</td>
> > <td> <input type="text" size="12" maxlength="10" title="Invoice
> > Date"
> > name="invoice__inv_date" value="" />
> > <input class="CalendarButton" type="button" value=" "
> > onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
> > title="Allowed -
> > Today to 30 days ago." tabindex="-1" vdfRequired="false" />
> > </td>
> >
> > Tabbing across a date lookup field as such lands the cursor in the
> > calendar
> > button, so if you then click in the field like a user would (right or
> > wrong...) and then attempt to tab out, you will get the required error
> > even
> > if vdfRequired is set to false as above.
> >
> > Unless I'm missing something...
> >
> > And along a similar line, in VdfValidator.prototype.validateFieldClient
in
> > vdfValidor.js, bRequired defaults to true. Wouldn't it make more sense
to
> > default it to false? If true I need to set every form to false where if
> > false all I need to do is set the few I want required rather than almost
> > all
> > of them. Unless I can set the parent to false...
> >
> > Bob
> >
> >
> >
>
>
>

Edwin van der Velden
30-May-2007, 02:20 AM
As far as I can tell the bRequired is set to true, then some checks (like
checking if a find is required for that field) takes place and it keeps on
doing checks while bRequired is true. If all those checks result in
bRequired still being true and if the vdfRequired attribute is set to true,
only the will it check if a value is in the field. So basically bRequired
should just be the results of the preliminary checks and not have anything
to do with the vdfRequried attribute, which is fetched as
oVdfForm.getVdfFieldAttribute(oField, "bRequired"), maybe the name of the
variable is just a bit confusing.

Also I'm not saying thisw means it works perfectly in all case, it's just
how I read the function. I will give it some tries on differnt types of
inputs and see if I see anything odd happening.

-Edwin


"Bob Worsley" <bworsley@comcast.net> wrote in message
news:92qH7bkoHHA.580@dacmail.dataaccess.com...
>I do have the vdfRequired on the input, it's at the end. I guess I had it
> on the lookup too, but that was in desparation.
>
> In vdfValidator.js we have the following line:
>
> var bResult = true, bRequired = true;
>
> which to me indicates the default for the property is true. I had to set
> vdfRequired=false in several input lines to stop them from requiring
> entry.
> Bob
>
>
> "Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in
> message
> news:axDp2JcoHHA.312@dacmail.dataaccess.com...
>> The vdfRequired should be set on the input field not the calendar button,
>> like:
>>
>> <input type="text" size="12" maxlength="10" title="Invoice Date"
>> name="orderhea__order_Date" value="" vdfRequired="true" />
>> <input class="CalendarButton" type="button" value=" "
>> onclick="show_VdfJPopCalendar(this, 'orderhea__order_Date');"
>> title="Allowed -
>> Today to 30 days ago." tabindex="-1" vdfRequired="true" />
>>
>> What I don't understand is the defaulting to required you mention, it is
>> true that bRequired is set to true in the functio you mention, but it''s
> not
>> used as such to check if the field is required. the actual check starts
>> with:
>>
>> if(bRequired && oVdfForm.getVdfFieldAttribute(oField, "bRequired")){
>>
>> where oVdfForm.getVdfFieldAttribute(oField, "bRequired") is false if the
>> vdfRequired attribute is not set, I've never seen it check for required
>> value without setting vdfRequired to true and have not been agble to
>> reproduce it as such. Maybe it's a different type of check, checks that
>> might happen are find required, value type checks (like date).
>>
>> -Edwin
>>
>>
>> "Bob Worsley" <bworsley@comcast.net> wrote in message
>> news:AUREE6IoHHA.1668@dacmail.dataaccess.com...
>> > I've been using vdfRequired which works fine in everything except a
>> > calendar
>> > lookup, and maybe other lookups?
>> >
>> > <td class="Label">Invoice Date:</td>
>> > <td> <input type="text" size="12" maxlength="10" title="Invoice
>> > Date"
>> > name="invoice__inv_date" value="" />
>> > <input class="CalendarButton" type="button" value=" "
>> > onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
>> > title="Allowed -
>> > Today to 30 days ago." tabindex="-1" vdfRequired="false" />
>> > </td>
>> >
>> > Tabbing across a date lookup field as such lands the cursor in the
>> > calendar
>> > button, so if you then click in the field like a user would (right or
>> > wrong...) and then attempt to tab out, you will get the required error
>> > even
>> > if vdfRequired is set to false as above.
>> >
>> > Unless I'm missing something...
>> >
>> > And along a similar line, in VdfValidator.prototype.validateFieldClient
> in
>> > vdfValidor.js, bRequired defaults to true. Wouldn't it make more sense
> to
>> > default it to false? If true I need to set every form to false where
>> > if
>> > false all I need to do is set the few I want required rather than
>> > almost
>> > all
>> > of them. Unless I can set the parent to false...
>> >
>> > Bob
>> >
>> >
>> >
>>
>>
>>
>
>
>

Edwin van der Velden
30-May-2007, 04:48 AM
It seems sometimes oVdfForm.getVdfFieldAttribute(oField, "bRequired")
results true when the attribute doesn't exist, I've changed this to check it
as
oVdfForm.getVdfFieldAttribute(oField, "bRequired") == "true" which should
work better. If the field itself is set to required it will still give a "an
entry is required... " error but this come from the server-side and not
client-side check.

-Edwin


"Bob Worsley" <bworsley@comcast.net> wrote in message
news:92qH7bkoHHA.580@dacmail.dataaccess.com...
>I do have the vdfRequired on the input, it's at the end. I guess I had it
> on the lookup too, but that was in desparation.
>
> In vdfValidator.js we have the following line:
>
> var bResult = true, bRequired = true;
>
> which to me indicates the default for the property is true. I had to set
> vdfRequired=false in several input lines to stop them from requiring
> entry.
> Bob
>
>
> "Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in
> message
> news:axDp2JcoHHA.312@dacmail.dataaccess.com...
>> The vdfRequired should be set on the input field not the calendar button,
>> like:
>>
>> <input type="text" size="12" maxlength="10" title="Invoice Date"
>> name="orderhea__order_Date" value="" vdfRequired="true" />
>> <input class="CalendarButton" type="button" value=" "
>> onclick="show_VdfJPopCalendar(this, 'orderhea__order_Date');"
>> title="Allowed -
>> Today to 30 days ago." tabindex="-1" vdfRequired="true" />
>>
>> What I don't understand is the defaulting to required you mention, it is
>> true that bRequired is set to true in the functio you mention, but it''s
> not
>> used as such to check if the field is required. the actual check starts
>> with:
>>
>> if(bRequired && oVdfForm.getVdfFieldAttribute(oField, "bRequired")){
>>
>> where oVdfForm.getVdfFieldAttribute(oField, "bRequired") is false if the
>> vdfRequired attribute is not set, I've never seen it check for required
>> value without setting vdfRequired to true and have not been agble to
>> reproduce it as such. Maybe it's a different type of check, checks that
>> might happen are find required, value type checks (like date).
>>
>> -Edwin
>>
>>
>> "Bob Worsley" <bworsley@comcast.net> wrote in message
>> news:AUREE6IoHHA.1668@dacmail.dataaccess.com...
>> > I've been using vdfRequired which works fine in everything except a
>> > calendar
>> > lookup, and maybe other lookups?
>> >
>> > <td class="Label">Invoice Date:</td>
>> > <td> <input type="text" size="12" maxlength="10" title="Invoice
>> > Date"
>> > name="invoice__inv_date" value="" />
>> > <input class="CalendarButton" type="button" value=" "
>> > onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
>> > title="Allowed -
>> > Today to 30 days ago." tabindex="-1" vdfRequired="false" />
>> > </td>
>> >
>> > Tabbing across a date lookup field as such lands the cursor in the
>> > calendar
>> > button, so if you then click in the field like a user would (right or
>> > wrong...) and then attempt to tab out, you will get the required error
>> > even
>> > if vdfRequired is set to false as above.
>> >
>> > Unless I'm missing something...
>> >
>> > And along a similar line, in VdfValidator.prototype.validateFieldClient
> in
>> > vdfValidor.js, bRequired defaults to true. Wouldn't it make more sense
> to
>> > default it to false? If true I need to set every form to false where
>> > if
>> > false all I need to do is set the few I want required rather than
>> > almost
>> > all
>> > of them. Unless I can set the parent to false...
>> >
>> > Bob
>> >
>> >
>> >
>>
>>
>>
>
>
>

Bob Worsley
30-May-2007, 07:08 PM
I made your change here and that seems to remove the need for me to have
vdfRequired=false all over the place. Except for a lookup date field as I
mentioned before. I still get an alert (see attached) when I attempt to tab
across the blank date field. Another Ajax program I've written doesn't
give the required error with the dates, go figure. I'll see what I can come
up with for a reason.
Bob

Edwin van der Velden
31-May-2007, 02:46 AM
Possibly you have the inv_date field set to DD_REQUIRED in your DD and it
fails server side validation.

-Edwin


"Bob Worsley" <bworsley@comcast.net> wrote in message
news:2HqIxexoHHA.2832@dacmail.dataaccess.com...
>I made your change here and that seems to remove the need for me to have
> vdfRequired=false all over the place. Except for a lookup date field as I
> mentioned before. I still get an alert (see attached) when I attempt to
> tab
> across the blank date field. Another Ajax program I've written doesn't
> give the required error with the dates, go figure. I'll see what I can
> come
> up with for a reason.
> Bob
>
>
>

Bob Worsley
31-May-2007, 11:50 AM
Hmmmm... I made an assumption that there wasn't a DD_Required in the DD,
but I was wrong, there is. That answers that question, but brings up
another. I've eliminated everything from that input having to do with
"data" -- no DDValue stuff, no Class=Data either, simply an input line. How
is it that it's connecting to the DD? Is Ajax making that assumption? I
don't want a database connection for this, I simply want a date lookup on an
HTML field. Am I missing something?
Bob

<td class="Label">Invoice Date:</td>
<td> <input type="text" size="12" maxlength="10"
title="Invoice Date" name="invoice__inv_date" value="" />
<input class="CalendarButton" type="button"
value=" " onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
title="Allowed - Today to 30 days ago." tabindex="-1" />
</td>
<td class="Error" id="Parthdr__Invoice__error"></td>

"Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in message
news:5RYTUf1oHHA.1324@dacmail.dataaccess.com...
> Possibly you have the inv_date field set to DD_REQUIRED in your DD and it
> fails server side validation.
>
> -Edwin
>
>
> "Bob Worsley" <bworsley@comcast.net> wrote in message
> news:2HqIxexoHHA.2832@dacmail.dataaccess.com...
> >I made your change here and that seems to remove the need for me to have
> > vdfRequired=false all over the place. Except for a lookup date field as
I
> > mentioned before. I still get an alert (see attached) when I attempt to
> > tab
> > across the blank date field. Another Ajax program I've written doesn't
> > give the required error with the dates, go figure. I'll see what I can
> > come
> > up with for a reason.
> > Bob
> >
> >
> >
>
>
>

Edwin van der Velden
1-Jun-2007, 02:45 AM
The library scans all the input fields inside the form and adds all fields
that have "__" in it, connecting it with the DD.
You can rename the field to something without "__" in it, "invoice_inv_date"
as nae should already do the trick, then it won't be recognized by the
library anymore, when it remains in the form it should still send the value
of the field with any ajax requests as user data so you could use it server
side. A bad thing about it however is that the calendar popup won't work as
called now, the show_vdfJPopCalendar function checks if the field exists as
DD connected. So to get the calendar working you need to skip this function
and call show_JPopCalendar, this however requires some different parameters.
You should call it like:

<input type="text" value="" name="orderhea_order_date"
id="orderhea_order_date" title="Date on which the order was placed"
size="10" class="date_data" vdfdateseparator="/" imaxlength="10"
maxlength="10" vdfdatemask="dd/mm/yyyy"/>
<input class="CalendarButton" type="button" value=" "
onclick="show_JPopCalendar(this,
document.getElementById('orderhea_order_date'),bro wser.dom.getVdfAttribute(document.getElementById(' orderhea_order_date'),'sDateMask','dd/mm/yy'));"
title="Pick a date" tabindex="-1" />

I'm not sure exactly what you're trying to do, but hope this helps you on
the way.

-Edwin


"Bob Worsley" <bworsley@comcast.net> wrote in message
news:PG5SLO6oHHA.2832@dacmail.dataaccess.com...
> Hmmmm... I made an assumption that there wasn't a DD_Required in the DD,
> but I was wrong, there is. That answers that question, but brings up
> another. I've eliminated everything from that input having to do with
> "data" -- no DDValue stuff, no Class=Data either, simply an input line.
> How
> is it that it's connecting to the DD? Is Ajax making that assumption? I
> don't want a database connection for this, I simply want a date lookup on
> an
> HTML field. Am I missing something?
> Bob
>
> <td class="Label">Invoice Date:</td>
> <td> <input type="text" size="12" maxlength="10"
> title="Invoice Date" name="invoice__inv_date" value="" />
> <input class="CalendarButton" type="button"
> value=" " onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
> title="Allowed - Today to 30 days ago." tabindex="-1" />
> </td>
> <td class="Error"
> id="Parthdr__Invoice__error"></td>
>
> "Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in
> message
> news:5RYTUf1oHHA.1324@dacmail.dataaccess.com...
>> Possibly you have the inv_date field set to DD_REQUIRED in your DD and it
>> fails server side validation.
>>
>> -Edwin
>>
>>
>> "Bob Worsley" <bworsley@comcast.net> wrote in message
>> news:2HqIxexoHHA.2832@dacmail.dataaccess.com...
>> >I made your change here and that seems to remove the need for me to have
>> > vdfRequired=false all over the place. Except for a lookup date field
>> > as
> I
>> > mentioned before. I still get an alert (see attached) when I attempt
>> > to
>> > tab
>> > across the blank date field. Another Ajax program I've written
>> > doesn't
>> > give the required error with the dates, go figure. I'll see what I can
>> > come
>> > up with for a reason.
>> > Bob
>> >
>> >
>> >
>>
>>
>>
>
>
>

Bob Worsley
1-Jun-2007, 06:14 AM
What I'm trying to do is maintain compatibility with an old process because
the Windows version is still in use. One record that's present in the
header isn't created until everything is processed, so I don't want those
fields data related. That includes this date.
Bob

"Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in message
news:QeqhGDCpHHA.580@dacmail.dataaccess.com...
> The library scans all the input fields inside the form and adds all fields
> that have "__" in it, connecting it with the DD.
> You can rename the field to something without "__" in it,
"invoice_inv_date"
> as nae should already do the trick, then it won't be recognized by the
> library anymore, when it remains in the form it should still send the
value
> of the field with any ajax requests as user data so you could use it
server
> side. A bad thing about it however is that the calendar popup won't work
as
> called now, the show_vdfJPopCalendar function checks if the field exists
as
> DD connected. So to get the calendar working you need to skip this
function
> and call show_JPopCalendar, this however requires some different
parameters.
> You should call it like:
>
> <input type="text" value="" name="orderhea_order_date"
> id="orderhea_order_date" title="Date on which the order was placed"
> size="10" class="date_data" vdfdateseparator="/" imaxlength="10"
> maxlength="10" vdfdatemask="dd/mm/yyyy"/>
> <input class="CalendarButton" type="button" value=" "
> onclick="show_JPopCalendar(this,
>
document.getElementById('orderhea_order_date'),bro wser.dom.getVdfAttribute(d
ocument.getElementById('orderhea_order_date'),'sDa teMask','dd/mm/yy'));"
> title="Pick a date" tabindex="-1" />
>
> I'm not sure exactly what you're trying to do, but hope this helps you on
> the way.
>
> -Edwin
>
>
> "Bob Worsley" <bworsley@comcast.net> wrote in message
> news:PG5SLO6oHHA.2832@dacmail.dataaccess.com...
> > Hmmmm... I made an assumption that there wasn't a DD_Required in the
DD,
> > but I was wrong, there is. That answers that question, but brings up
> > another. I've eliminated everything from that input having to do with
> > "data" -- no DDValue stuff, no Class=Data either, simply an input line.
> > How
> > is it that it's connecting to the DD? Is Ajax making that assumption?
I
> > don't want a database connection for this, I simply want a date lookup
on
> > an
> > HTML field. Am I missing something?
> > Bob
> >
> > <td class="Label">Invoice Date:</td>
> > <td> <input type="text" size="12" maxlength="10"
> > title="Invoice Date" name="invoice__inv_date" value="" />
> > <input class="CalendarButton" type="button"
> > value=" " onclick="show_VdfJPopCalendar(this, 'invoice__inv_date');"
> > title="Allowed - Today to 30 days ago." tabindex="-1" />
> > </td>
> > <td class="Error"
> > id="Parthdr__Invoice__error"></td>
> >
> > "Edwin van der Velden" <edwin.van.der.velden@dataaccess.nl> wrote in
> > message
> > news:5RYTUf1oHHA.1324@dacmail.dataaccess.com...
> >> Possibly you have the inv_date field set to DD_REQUIRED in your DD and
it
> >> fails server side validation.
> >>
> >> -Edwin
> >>
> >>
> >> "Bob Worsley" <bworsley@comcast.net> wrote in message
> >> news:2HqIxexoHHA.2832@dacmail.dataaccess.com...
> >> >I made your change here and that seems to remove the need for me to
have
> >> > vdfRequired=false all over the place. Except for a lookup date field
> >> > as
> > I
> >> > mentioned before. I still get an alert (see attached) when I attempt
> >> > to
> >> > tab
> >> > across the blank date field. Another Ajax program I've written
> >> > doesn't
> >> > give the required error with the dates, go figure. I'll see what I
can
> >> > come
> >> > up with for a reason.
> >> > Bob
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >
> >
> >
>
>