PDA

View Full Version : vdfGrid with auto pass to next column and next row



Jorge M
12-Dec-2007, 11:24 AM
Hi all,

I have a form with a vdfGrid, the vdfGrid have 3 columns I wish make 2
things, the first is capture the value of the second column and if the
actual record "say" that the length of the answer is one character
automatically pass to the third column, the second thing is when enter to
the third column if the actual record "say" that the row accept only one
answer automatically send it a TAB key for pass to the next row.

Its possible make this? or I have dream

thanks in advance


Jorge

Jorge M
12-Dec-2007, 11:36 AM
Sorry forget mention that the vdfGrid contains records for recive answers
its not posible create new records, and each row can have different
"configuration" for recive one or two answer and each answer (column) can be
accept one o more characters

"Jorge M" <pandosos@hotmail.com> escribió en el mensaje
news:FKBzutNPIHA.304@dacmail.dataaccess.com...
> Hi all,
>
> I have a form with a vdfGrid, the vdfGrid have 3 columns I wish make 2
> things, the first is capture the value of the second column and if the
> actual record "say" that the length of the answer is one character
> automatically pass to the third column, the second thing is when enter to
> the third column if the actual record "say" that the row accept only one
> answer automatically send it a TAB key for pass to the next row.
>
> Its possible make this? or I have dream
>
> thanks in advance
>
>
> Jorge
>

Harm Wibier
13-Dec-2007, 04:36 AM
Hello Jorge,

This sounds pretty possible to me. Unfortunately implementing this kind of
functionallity requires some more knowledge of JavaScript and the AJAX
Library API.

The fields in the editrow of a grid can be accessed through the VdfForm.
Then I think you would want to add an event listener that performs you're
check when field is focussed or a key is pressed. Event handling in the AJAX
Library is done using a little sublayer that straightens out the browser
differences. You can us the addGenericListener method of the VdfField to
attach events.

I've made an example that fills the price of a order line with the unit
price on focus if it hasn't changed. You can add it to the order.asp of the
Order Entry Example. I think this example has all the techniques you would
need to create youre functionallity.

//
// Attaches the custom listener to the focus event of the price field.
//
function initForm(){
var oVdfForm = getVdfControl("orderhead_form");

oVdfForm.getField("orderdtl__price").addGenericListener("focus",
onPriceFocus);
}

//
// Handles the focus event of the pricefield and fills it with the unit
// price if no changes have been made to it yet.
//
function onPriceFocus(){
var oVdfForm, oPriceField;

oVdfForm = getVdfControl("orderhead_form");
oPriceField = oVdfForm.getField("orderdtl__price");

if(!oPriceField.getChangedState()){
oPriceField.setValue(oVdfForm.getField("invt__unit_price").getValue());
}
}

I hope that you can work out you're problems using this example.

--
Regards,


Harm Wibier
Data Access Europe B.V.
http://www.dataaccess.nl/


"Jorge M" <pandosos@hotmail.com> wrote in message
news:WWcvw0NPIHA.4272@dacmail.dataaccess.com...
> Sorry forget mention that the vdfGrid contains records for recive answers
> its not posible create new records, and each row can have different
> "configuration" for recive one or two answer and each answer (column) can
> be accept one o more characters
>
> "Jorge M" <pandosos@hotmail.com> escribió en el mensaje
> news:FKBzutNPIHA.304@dacmail.dataaccess.com...
>> Hi all,
>>
>> I have a form with a vdfGrid, the vdfGrid have 3 columns I wish make 2
>> things, the first is capture the value of the second column and if the
>> actual record "say" that the length of the answer is one character
>> automatically pass to the third column, the second thing is when enter to
>> the third column if the actual record "say" that the row accept only one
>> answer automatically send it a TAB key for pass to the next row.
>>
>> Its possible make this? or I have dream
>>
>> thanks in advance
>>
>>
>> Jorge
>>
>
>

Jorge M
13-Dec-2007, 03:27 PM
Thanks Harm, I will try to do something with this (I hope can resolve my
needs)

Jorge

"Harm Wibier" <harm.wibier@dataaccess.nl> escribió en el mensaje
news:LSZhduWPIHA.4272@dacmail.dataaccess.com...
> Hello Jorge,
>
> This sounds pretty possible to me. Unfortunately implementing this kind of
> functionallity requires some more knowledge of JavaScript and the AJAX
> Library API.
>
> The fields in the editrow of a grid can be accessed through the VdfForm.
> Then I think you would want to add an event listener that performs you're
> check when field is focussed or a key is pressed. Event handling in the
> AJAX Library is done using a little sublayer that straightens out the
> browser differences. You can us the addGenericListener method of the
> VdfField to attach events.
>
> I've made an example that fills the price of a order line with the unit
> price on focus if it hasn't changed. You can add it to the order.asp of
> the Order Entry Example. I think this example has all the techniques you
> would need to create youre functionallity.
>
> //
> // Attaches the custom listener to the focus event of the price field.
> //
> function initForm(){
> var oVdfForm = getVdfControl("orderhead_form");
>
> oVdfForm.getField("orderdtl__price").addGenericListener("focus",
> onPriceFocus);
> }
>
> //
> // Handles the focus event of the pricefield and fills it with the
> unit
> // price if no changes have been made to it yet.
> //
> function onPriceFocus(){
> var oVdfForm, oPriceField;
>
> oVdfForm = getVdfControl("orderhead_form");
> oPriceField = oVdfForm.getField("orderdtl__price");
>
> if(!oPriceField.getChangedState()){
>
> oPriceField.setValue(oVdfForm.getField("invt__unit_price").getValue());
> }
> }
>
> I hope that you can work out you're problems using this example.
>
> --
> Regards,
>
>
> Harm Wibier
> Data Access Europe B.V.
> http://www.dataaccess.nl/
>
>
> "Jorge M" <pandosos@hotmail.com> wrote in message
> news:WWcvw0NPIHA.4272@dacmail.dataaccess.com...
>> Sorry forget mention that the vdfGrid contains records for recive answers
>> its not posible create new records, and each row can have different
>> "configuration" for recive one or two answer and each answer (column) can
>> be accept one o more characters
>>
>> "Jorge M" <pandosos@hotmail.com> escribió en el mensaje
>> news:FKBzutNPIHA.304@dacmail.dataaccess.com...
>>> Hi all,
>>>
>>> I have a form with a vdfGrid, the vdfGrid have 3 columns I wish make 2
>>> things, the first is capture the value of the second column and if the
>>> actual record "say" that the length of the answer is one character
>>> automatically pass to the third column, the second thing is when enter
>>> to the third column if the actual record "say" that the row accept only
>>> one answer automatically send it a TAB key for pass to the next row.
>>>
>>> Its possible make this? or I have dream
>>>
>>> thanks in advance
>>>
>>>
>>> Jorge
>>>
>>
>>
>
>
>