Página 1 de 1

event onaddnew with tdbnavigator

Publicado: Lun Oct 01, 2012 3:35 pm
por Roberto
I have a question:
If I use TDBNavigator and I click on Insert button how can I modify any value just AFTER the dataset enter in edit mode?
the onclickinsert just allow or noT to get in addnew, so I can't use it.
The tdataset event OnAddNew is called BEFORE too, so, where do I can set some values for fields, like below:
...
WITH OBJECT oCustomer
:City := "Manaus"
:Cep := myCEP()
...
END
????

event onaddnew with tdbnavigator

Publicado: Lun Oct 01, 2012 8:12 pm
por Roberto
In another words:
Is there a way to create an event like "OnAfterAddNew" to be fired JUST AFTER the edit mode is activated?

event onaddnew with tdbnavigator

Publicado: Mar Oct 02, 2012 8:12 pm
por ignacio
Roberto escribió el lun, 01 octubre 2012 20:12In another words:
Is there a way to create an event like "OnAfterAddNew" to be fired JUST AFTER the edit mode is activated?
Try with TDataset:OnAddNew
Regards,

event onaddnew with tdbnavigator

Publicado: Mar Oct 02, 2012 8:39 pm
por Roberto
ignacio wrote on Tue, 02 October 2012 20:12Roberto escribió el lun, 01 octubre 2012 20:12In another words:
Is there a way to create an event like "OnAfterAddNew" to be fired JUST AFTER the edit mode is activated?
Try with TDataset:OnAddNew
Regards,

Hi,
OnAddNew is fired BEFORE the TDataSet get in append mode, as I said above.

event onaddnew with tdbnavigator

Publicado: Mié Oct 03, 2012 12:58 pm
por ignacio
TBrwColumn:OnEdit()

event onaddnew with tdbnavigator

Publicado: Mié Oct 03, 2012 10:51 pm
por Roberto
ignacio wrote on Wed, 03 October 2012 12:58TBrwColumn:OnEdit()
sorry, I guess I am not making myself clear.
I just need to do some job JUST AFTER the dataset get in addnew, not only before edit a column value or something else. If I don't use the tdbnavigator and I call addnew by myself so there is no problem and I can do what I want. The problem is when I click on edit button then I have no chance to do any additional work before the use start editing the fields.

event onaddnew with tdbnavigator

Publicado: Jue Oct 04, 2012 9:41 am
por jfgimenez
Roberto,
> I just need to do some job JUST AFTER the dataset get in
> addnew, not only before edit a column value or something
> else. If I don't use the tdbnavigator and I call addnew by
> myself so there is no problem and I can do what I want. The
> problem is when I click on edit button then I have no chance
> to do any additional work before the use start editing the
> fields.
Then the simplest way is to use the event OnClickInsert from the
TDbNavigator control. F.e.:
METHOD DbNavigator1ClickInsert( oSender ) CLASS TForm1
oSender:oDataSet:AddNew()
// here you may do whatever you need
// ...
RETURN .F. // This is to avoid the dbnavigator to call addnew again
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info