Re: [gnome-db] gda_parameter_set_not_null()



Hi!

Sorry for bothering you with this again but I still had not look to make
this working. I followed your instructions to obtain the DataModelIter
from GnomeDbRawForm but set_not_null() on the parameters still seems to
have absolutely no effect. Libgnomedb seems to set some parameters to
not_null by default and those get a "*" but I have failed so far to set
it manually. Maybe I am also totally wrong here...

Example code is still:
http://svn.gnome.org/viewcvs/gnomemm/libgnomedbmm/trunk/examples/form/mandatory/examplewindow.cc?rev=970&view=markup

Thanks and regards,
Johannes


Vivien Malerba schrieb:
> On 2/10/07, Johannes Schmid <johannes schmid gmx de> wrote:
>> Hi!
>>
>> I guess I still did not get correctly how gda_parameter_set_not_null()
>> should work. I have written a (C++) example to show a form with four
>> fields and set one to be mandatory. Anyway, there are two fields that
>> have a mandatory star but not the one I set to mandatory.
>>
>> Maybe you can have a look. The method names are exactly the same as in C
>> but I also can recode this in C if it makes it easier for you to find
>> the problem.
>>
>> Example:
>> http://svn.gnome.org/viewcvs/gnomemm/libgnomedbmm/trunk/examples/form/mandatory/examplewindow.cc?rev=970&view=markup
>>
>>
> 
> I believe the problem comes from the fact that you create a new
> GdaDataModelIter object (Glib::RefPtr<Gnome::Gda::DataModelIter> iter
> = m_model->create_iter();) instead of using the one from the form
> itself.
> 
> The GnomeDbForm widget wraps a GnomeDbRawForm (which is in fact a
> GnomeDbBasicForm and some code to sync. the displayed values with a
> data model) and a toolbar, and for the GnomeDbBasicForm, it creates a
> new GdaDataModelIter from the data model to display values from. That
> iterator is used by the GnomeDbBasicForm to display starts for non
> null values  and to modify the values.
> 
> Now if you create you own iterator, the form does not know about it,
> and does not use it. You should first create your form, then obtain
> the GnomeDbRaw form
>> from it, then get a pointer to the GdaDataModelIter ised by the form
> using gnome_db_data_widget_get_current_data(raw).
> 
> Cheers,
> 
> Vivien
> 

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]