Display data in graphical components
[1/3] from: brasilv::tin::it at: 29-Dec-2005 14:50
Hi List,
I need to display data in fields and text-lists picked from a mysql
database.
I realized little functions to do this (they work properly), anyway, when I
use them in the layout I can't see nothing displayed. Why?
These are my functions:
modello: func [ targa ] [
dbport: open mysql://root:12345678-localhost/autodispa
insert dbport [ "select marcamodello from auto where targa = ?"
targa ]
mod: copy dbport
close dbport
return mod
]
interventi: func [ targa ] [
dbport: open mysql://root:12345678-localhost/autodispa
insert dbport [ "select * from intervento where targaauto = ?"
targa ]
interv: copy dbport
close dbport
return interv
]
and if I write:
field modello[targa/text]
or even this
text-list interventi[targa/text]
nothing is displayed
Please help me, I can't understand what's wrong with my code. Thank you,
Silvia
[2/3] from: volker::nitsch::gmail::com at: 29-Dec-2005 17:54
On 12/29/05, Silvia Brandimarte <brasilv-tin.it> wrote:
> Hi List,
> I need to display data in fields and text-lists picked from a mysql
<<quoted lines omitted: 13>>
> dbport: open mysql://root:12345678-localhost/autodispa
> insert dbport [ "select * from intervento where targaauto ==
?"
> targa ]
> interv: copy dbport
<<quoted lines omitted: 7>>
> nothing is displayed
> Please help me, I can't understand what's wrong with my code. Thank you,
can you try
field probe modello[targa/text]
to test what "mondello [targa/text]" returns?
And probe a bit in 'modello for [targa/text] ?
A thought: this code is executed when the layout is created. Maybe
targa/text is then empty? When the user enters a value there is no
refresh?
text-list: its
text-list data ["1" "2" "3"]
> Silvia
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
-Volker
Any problem in computer science can be solved with another layer of
indirection. But that usually will create another problem.
David
Wheeler
[3/3] from: luca::truffarelli::it at: 29-Dec-2005 17:17
Two things...
- Don't put the square brackets
Because that way you pass a block! instead of a string!.
(I think you expect a string)
- if the funcs don't return a string convert them.
Because if them return a number layout use them to size the field
instead of fill it with.
So
view layout [
field to-string modello targa/text
field to-string interventi targa/text
]
If the functions already return a string! just remove the 'to-string word.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted