checkbox group

A place for users and developers of the Xataface to discuss and receive support.

checkbox group

Postby Jean » Fri May 23, 2008 4:54 am

Hello Steve,
I don't understand I have in my fields.ini
Code: Select all
[type_computers]
group = machines
widget:label = Ordinateurs
widget:type = checkbox
vocabulary = ordinateurs


and in my valuelists.ini :

Code: Select all
[ordinateurs]
__sql__ = "SELECT ID, name from glpi_type_computers ORDER BY name"


But, although I have several items in my table, I have only one checkbox beside the label "ordinateurs".
I tried all kinds of tests without success.
Would you have a hunch about this ? My version is the 0.7.1
Thank you
Best regards
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby shannah » Fri May 23, 2008 7:07 am

What data type is the column type_computers? In order to do a group of checkboxes, it needs to be a varchar or text (not a numeric type).

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Jean » Fri May 23, 2008 7:52 am

Thank you very much Steve, they are numeric.
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby shannah » Fri May 23, 2008 8:39 am

Just to clarify. The valuelist can have numeric values. Just that the field that is edited with a checkbox group cannot be numeric. This is because if multiple values are selected, Xataface will store all of the values in the field separated by line breaks. This only works for varchar and text fields.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Jean » Mon May 26, 2008 5:31 am

Thank you Steve for your precisions. I think my problem comes from something else because I changed my pair ID/name in my query into name/name and add
Code: Select all
widget:separator ="
"
in the fields.ini without any change. I still have only on checkbox near my label.
Code: Select all
group = machines
widget:label = Ordinateurs
widget:type = checkbox
vocabulary = ordinateur
widget:separator="
"

and in my valuelists.ini
Code: Select all
__sql__ = "SELECT name, name from glpi_type_computers ORDER BY name"

I tried too
Code: Select all
SRV= Serveur
PC = PC de Bureau
ST = Station de Travail
PL = Platine
PORT = Portable
PKT= Pocket PC

without any change.
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby shannah » Mon May 26, 2008 8:59 am

Hi Jean,

It isn't the valuelist you need to be looking at here. It is the type_computers column. What is the data type for this field? Is it a varchar, an int, or something else?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Jean » Mon May 26, 2008 11:33 pm

Sorry Steve, I feel stupid :wink:
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 34 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved