[Solved] Checkboxes Auto Selected (Not Wanted)

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

[Solved] Checkboxes Auto Selected (Not Wanted)

Postby cyberws » Tue Nov 17, 2009 8:06 am

Hello Group,

I have a single field that has several checkboxes to be selected (checked) if that item corresponds to the entry. The vocab is correct and it works the only problem is ALL the checkboxes are automatically selected when clicking on "New Record".

That means if a record/entry doesn't have same options 2, 4, 5 you have to uncheck those (opt-out). I don't this as this means it would be easy to not uncheck an option. It should be the other way around. You should have to check (opt-in) to the options that is required.

My database field is varchar(20) and yes that is enough as I am storing up to five options that are single letter.

Any thoughts on how to get Xataface to NOT auto check the checkboxes?

Thanks.

Jeremy
Last edited by cyberws on Tue Nov 17, 2009 11:52 am, edited 1 time in total.
cyberws
 
Posts: 19
Joined: Wed Jul 01, 2009 10:32 am

Postby shannah » Tue Nov 17, 2009 10:36 am

Hmm.. strange. I can't think of anything that would cause this off the top of my head. Can you post:

1. Xataface,PHP, MySQL, Server, OS version.
2. The valuelist definition.
3. The fields.ini field definition.
4. The MySQL table definition.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby cyberws » Tue Nov 17, 2009 11:59 am

Thanks for the feedback.

I solved this by removing the default value. I was assigning a default of "u" which meant unclassified. I did remove this when testing but it didn't change.

However when I switch my character set from latin1_swedish_ci to utf8_general_ci I noticed the checkboxes went unchecked with no default value. I then redefined a default value of "u" and boom ALL checkboxes where selected. However once again removing the default value didn't return unchecked checkboxes.

So I switch back to latin1_swedish_ci and that worked. I then redefined the character set as utf8_general_ci. Obviously Xataface isn't picking up the changes when a default value is dropped from a column.

For the record I am using Xataface 1.1.5 (I tried upgrading to 1.2.2 but go errors) on Redhat Enterprise Linux with PHP 5.2.9 running APC.
cyberws
 
Posts: 19
Joined: Wed Jul 01, 2009 10:32 am

Postby shannah » Tue Nov 17, 2009 12:17 pm

I think it is the APC that is causing the grief. Xataface detects and uses APC if it is present, to cache things like the table schema and fields.ini files. If you change the table schema in any way, you may need to refresh the apc cache. You can do this by adding

--refresh-apc=1

to your URL.

(e.g. index.php?-action=foo&table=bar&--refresh-apc=1)

You can disable its use of APC altogether by adding the following to the beginning of your index.php file:

Code: Select all
define('DATAFACE_EXTENSION_LOADED_APC',false);
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby cyberws » Tue Nov 17, 2009 12:37 pm

Yeah that is it. When I use the switch you provided I can cause the checkboxes to be all checked or unchecked by modifying the column's default value. Odd that change doesn't get reflected when other changes do.

However there you go. I hope it helps someone else out. I want APC on for sure.

Thank you!
cyberws
 
Posts: 19
Joined: Wed Jul 01, 2009 10:32 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

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