DIsplaying boolean values as yes/no

62 views
Skip to first unread message

Ashley Stewart

unread,
Sep 24, 2016, 6:50:11 PM9/24/16
to Xataface
I have some boolean values which are meant to indicate yes/no and I have a checkbox widget which is working correctly at inserting the values. However when I view a table and see all the fields displayed, the column with the boolean value shows as 0 or 1. How do I change this so it displays as yes/no depending on the boolean value?

Thanks.

Steve Hannah

unread,
Sep 28, 2016, 11:01:43 AM9/28/16
to xata...@googlegroups.com
I have been planning on making this more automatic for some time, but right now you need ot create a valuelist with 0=No, 1=Yes and use that on field via the vocabulary directive.

Another annoyance is that "0" is a reserved key in INI files so you need to implement this valuelist in PHP.

e.g.
function valuelist__yesno() {
    return array(0=>'No', 1=>'Yes');
}

Steve

On Sat, Sep 24, 2016 at 3:50 PM, Ashley Stewart <ashleywill...@gmail.com> wrote:
I have some boolean values which are meant to indicate yes/no and I have a checkbox widget which is working correctly at inserting the values. However when I view a table and see all the fields displayed, the column with the boolean value shows as 0 or 1. How do I change this so it displays as yes/no depending on the boolean value?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/aad18cd5-3ee9-4769-a320-336e5524dff3%40googlegroups.com.



--
Steve Hannah
Web Lite Solutions Corp.

Tom Wible

unread,
Jul 25, 2018, 6:31:28 PM7/25/18
to Xataface
hi, steve, just had a need for this, & it works as advertized when i put the valuelist__ in table.php.

but as booleans can be in several tables, i tried it in my utils.php @ root level...no go:-\ is ther e a secrit incantatin?-)
Reply all
Reply to author
Forward
0 new messages