Página 1 de 1

DbComBox, DbRadioMenu, DataSet

Publicado: Mié Feb 05, 2025 4:14 pm
por Hurricane
Hi Team

To simplify a part of the development (extremely important), please:
  1. a small adjustment in DBComboBox (bound), start empty (index=0) when in addNew mode, like other nDataTypes.
  2. is it possible to implement the onLoaded event for DataSet? to be triggered after we call :edit() or :addNew().
    After these methods are called, we cannot make adjustments to controls, etc. from within the Form coding (only from the outside)
  3. is it possible to implement aItemsBound for DBRadioMenu?
-----
Can I send all the code to your email?
  1. I made the adjustment (DBComboBox).
  2. I made a simple adaptation (DataSet/dbfDataSet). I added DATA bLoaded, etc...
  3. I made the implementation (partial/DBRadioMenu). It only works when adding/changing, but when browsing records the control is not updated.
Practical use:

Código: Seleccionar todo

METHOD FormInitialize( oSender ) CLASS TFrmCliente

   ::oRSMain:bLoaded:={|o|::ModeAppend(o)} // Initializing here (while there is no event)
   ::oRMTipoPessoa:aItemsBound:={'J', 'F'}
   ::oFpPrincipal:Select()
   RETURN Nil

METHOD ModeAppend(oDs) CLASS TFrmCliente
   
   if oDs:lOnAppend
      ::oRMTipoPessoa:nIndex:=1 // 1-JURIDICA, 2-FISICA
      ::oRMTipoPessoa:OnChange()

   else //if oDs:lOnEdit
      ::oRMTipoPessoa:Disable() 
      ::oRMTipoPessoa:OnChange()

   endif

   RETURN NIL

Re: DbComBox, DbRadioMenu, DataSet

Publicado: Jue Feb 06, 2025 11:44 am
por ignacio
Dear Sir,

We encourage to overload Classes for this purpose. It's really simple. If you need some advice, just let us know.

Regards,

Re: DbComBox, DbRadioMenu, DataSet

Publicado: Jue Feb 06, 2025 6:21 pm
por Hurricane
Hi,
But is it possible to fix the DbComboBox (bound)? It starts incorrectly in inclusion mode and if the field is empty.
This is simple to fix and extremely important for all users (that's why I posted it). I made the fix and it works great.

How do I implement aItemsBound in aDbRadioMenu and have it updated during navigation? (I tried).

Usage example:
::oRmTipo:aItemsBound:={'J', 'F'}
::oRmTipo:aItems:={'Jurídica', 'Física'}

I attached a simple project
ignacio escribió: Jue Feb 06, 2025 11:44 am We encourage to overload Classes for this purpose. It's really simple. If you need some advice, just let us know.
Regards

Re: DbComBox, DbRadioMenu, DataSet

Publicado: Vie Feb 07, 2025 9:52 am
por ignacio
a small adjustment in DBComboBox (bound), start empty (index=0) when in addNew mode, like other nDataTypes.
This can brake actual code, sorry.
is it possible to implement the onLoaded event for DataSet? to be triggered after we call :edit() or :addNew().
OK. It will be called OnRecordLoad()
is it possible to implement aItemsBound for DBRadioMenu?
Yes, but I do not think is necessary. I do not like the idea of having aItemsBound for every ordinal dataset value.

Regards,

Re: DbComBox, DbRadioMenu, DataSet

Publicado: Vie Feb 07, 2025 2:10 pm
por Hurricane
ignacio escribió: Vie Feb 07, 2025 9:52 am This can brake actual code, sorry.
Easy:

Código: Seleccionar todo

if ::nDataType = dtBOUNDEMPTY .and. ...
-------
ignacio escribió: Vie Feb 07, 2025 9:52 am OK. It will be called OnRecordLoad()
excellent. Thank you.
-------
aItemsBound for DBRadioMenu - How can I implement this to use in my application?
including making the control refresh on record navigation, according to ::aItemsBound
I attached a small project.

Regards,