Value List Defined in ini file but shows something else

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

Value List Defined in ini file but shows something else

Postby transcan » Wed Jul 21, 2010 1:53 pm

When entering the valuelists in the valuelists.ini file, I have data such as 0 or 1, or N or Y mapped a field with No or Yes, and under list view, nothing appears.

When editing or creating a new record, the drop down appears but with a blank/null value as the first selection and the numeral 1 as the second but not No or Yes.

How do I figure out this dilemma.

Thanks in advance.
transcan
 
Posts: 13
Joined: Wed Jul 21, 2010 11:57 am

Re: Value List Defined in ini file but shows something else

Postby cantlep » Wed Jul 21, 2010 3:02 pm

Are there any errors in your web log files? I'm not 100% but I know the term "OK" can't be used on the left hand side of the "=" sign in valuelist.ini..perhaps there's something similar with using Y and N or 0 and 1. (This is just a guess).

Does it work if you put other things in there like
Code: Select all
NEW = New
OLD = Old
REJ = Rejected


Just to make sure everything is working as it should be? If there is a restriction with Y,N, etc then you culd just create a table in the DB with the values you want and then use this type of thing
Code: Select all
__sql__"=SELECT whatever FROM yourtable ORDER BY whatever"
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Value List Defined in ini file but shows something else

Postby shannah » Wed Jul 21, 2010 4:49 pm

0 is a "reserved word" in INI files so you can't use it as a key in valuelists defined in the INI file. The workaround is to define these sorts of valuelists in the delegate class:
Code: Select all
function valuelist__myvaluelist(){
    return array(0=>'No', 1=>'Yes');
}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Value List Defined in ini file but shows something else

Postby transcan » Thu Jul 22, 2010 7:46 am

Code: Select all
NEW = New
OLD = Old
REJ = Rejected


By instituting a new list and thus changing in MySQL that particular field from TINYINT or INT to VARCHAR, caused all value lists to cease working.

===

Code: Select all
function valuelist__myvaluelist(){
    return array(0=>'No', 1=>'Yes');
}


This caused that particular drop down list to be blank. I could not make it work.

===
Workaround:

I had to revert the field back to INT, cease using 0, used 1 and higher mapped to words other than Yes or No.

Thanks.
transcan
 
Posts: 13
Joined: Wed Jul 21, 2010 11:57 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 44 guests

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