Re: [gnome-db] input values in SQL view
- From: Vivien Malerba STNA 7FD M204 <vivien malerba aviation-civile gouv fr>
- To: Rodrigo Moya <rodrigo gnome-db org>, Fernando Martins <fmartins hetnet nl>
- Cc: GNOME-DB mailing list <gnome-db-list gnome org>
- Subject: Re: [gnome-db] input values in SQL view
- Date: 21 Jan 2003 09:09:33 +0100
Rodrigo wrote:
> > >
> >
> > Yes, good idea. This way we also could use the plugins from mergeant
> > which explain how to enter data depending on the data type (so no
more
> > worry about the 'value' instead of simply value).
> >
> yes, sounds good. I'll do it that way. Is there a widget(s) already
for
> that?
I propose the following syntax:
[:field_name type="type_name" descr="the description" default="the
default value"]
where type is mandatory and the other attributes not. Note: it is IMHO
better to user [] instead of <> because we will have some confusions
with the XML's <> when we store the 'enhanced' SQL query in an XML file.
The existing widget for this is the DataEntry widget which can be
obtained following these steps:
-> use server_access_get_type_from_name() to get a ServerDataType object
from the type name given by the user. You get the ServerAccess object
from the ConfManager object.The ServerDataType is the object which
represents the data type in mergeant.
-> use server_access_get_handler_from_type() to get a DataHandler object
from the ServerDataType. This DataHandler is an object which handles the
plugins.
-> use data_entry_new() to get the widget you put in the form
When you want to read the value of this widget, use
data_entry_get_gdavalue() which will return a GdaValue you'll have to
free after usage.
See the header files for more info.
The problem you'll face is the default value. If you want to update the
value in the widget, you have to use the data_handler_widget_update()
function which will update the widget, and this function only accepts a
GdaValue as parameter, not a string.
What I need to do is rationalise a bit the DataEntry's API to enable
setting a default value from a string or from a GdaValue.
It's on my TODO list. While it's not done, I propose that you simply
don't care about the "default" attribute.
How does it sound?
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]