[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUe] GNUe forms questions
From: |
Julio Cesar Gazquez |
Subject: |
Re: [GNUe] GNUe forms questions |
Date: |
Thu, 7 Aug 2003 00:39:42 -0300 |
User-agent: |
KMail/1.5.1 |
El Vie 01 Ago 2003 10:06, Ulf Mehlig escribió:
> Hello GNUe-experts,
>
> I started to play around with GNUe forms 0.5, and I have a few
> questions:
>
> * does somebody have an example form that lets one choose the
> value of a data base table's foreign key (referencing another
> table) from a listbox?
There are no listboxes, just combos. You must set the fk_ attributes in the
field , then set the style in the entry to "dropdown".
<datasource name="ds_farmacias" connection="meba" table="farmacias"
order_by="nombrefantasia" />
<logic>
<block name="blk_factfarm" datasource="ds_factfarm">
<field name="fldCuit" field="cuit" fk_source="ds_farmacias"
fk_key="cuit" fk_description="nombrefantasia" />
...
</block>
</logic>
<layout xmlns:Char="GNUe:Layout:Char" Char:height="18" Char:width="60">
<page name="Page1">
...
<entry name="entCuit" Char:width="25" Char:x="17" Char:y="1"
block="blk_factfarm" field="fldCuit" style="dropdown" />
> If the foreign key would be a number id,
> would it also be possible to list e.g. a text description of the
> item referenced by the number (given in the reference table) in
> that listbox (thus hiding the number from the user)? Of course,
> all this listbox stuff would only make sense if the foreign key
> values were not too numerous ...
> * has somebody thought about an entry field that reacts to
> keyboard input like a "readline"-enhanced command line by
> completing partly-typed words from a list? Would be even more
> useful than the listbox for the foreign key issue described
> above ;-)
Interesting, indeed. You can do it using a trigger, I guess.
> * I read in a mailing list contribution by Jason Cater from Oct 18
> 2002 that it is possible to make "subforms" with something
> called "<import-form>". Where can I find an example form using
> this technique?
I guess that is not working yet. Anyway, developers didn't post anything here
since almost a month ago, I'm still waiting for answers for my own doubts.
> * I tried to change the behaviour of date fields to accept
> something like "dd.mm.yyyy" by manipulating the respective parts
> of gnue.conf, but my form still didn't accept that format --
> what is my error here?
No idea, but AFAIK mask support is not finished. You can try it via
attributes, maybe that works.
> * I was not successful in writing a kind of input error correction
> trigger that clears the wrong entry and then (this is what did
> not work) jumps back to the beginning of the respective entry
> field. Could anybody kindly give me an example?
This trigger does a search in table "personas" (people) looking by its number,
and set the name, or clears the name if it doesn't exists. I hope this helps,
it clears the field as you want, but it doesn't changes the focus.
<block name="blk_persona" datasource="dts_persona" >
<trigger name="buscarnombre" type="NAMED"><![CDATA[
if blk_persona.nrodoc <> "":
nrodoc=int(str(blk_persona.nrodoc))
rs = dts_personas.createResultSet({"nrodoc":nrodoc})
if rs.firstRecord():
blk_persona.nombre="%s, %s" % (rs.current.getField("Apellido") ,
rs.curr
ent.getField("Nombres") )
else:
blk_persona.nombre=""
showMessage("No se encuentra")
]]></trigger>
<field name="nrodoc">
<trigger src="buscarnombre" type="POST-CHANGE"/>
</field>
<field name="nombre" />
> * is there a recommended technique for doing forms with
> multi-lingual labels and messages? I read in a list message that
> there is an i18n team ...
No idea... I feel actually there is very little development, very few people
working at this time.
> * a last, a probably not totally GNUe-specific question: I thought
> about making a separate python package for some functions I
> would use in several triggers. How do I include a package like
> this in the MS-Windows version of GNUe forms? (with Linux, I
> just started the form tool with "PYTHONPATH=./mystuff.py
> gnue-forms myform.gfd", but it didn't work on Windows that
> easily.) Is there a better technique to include such packages?
PAPO's people has a file with miscellaneous functions for daily use, but I
didn't remember how they used it.
--
Saludos
Julio César Gázquez