Index
2012-04-14 21:17 – Cheryl : [dabo-users] help with checkbox in dgrid
2012-04-15 18:44 – Ed Leafe : Re: [dabo-users] help with checkbox in dgrid
2012-04-16 09:04 – Ed Leafe : Re: [dabo-users] help with checkbox in dgrid
2012-04-16 17:13 – Cheryl : Re: [dabo-users] help with checkbox in dgrid
2012-04-16 20:16 – John Fabiani : Re: [dabo-users] help with checkbox in dgrid
2012-04-16 20:54 – Simon Giraudo : Re: [dabo-users] help with checkbox in dgrid
2012-04-16 22:04 – Cheryl : Re: [dabo-users] help with checkbox in dgrid
2012-04-16 22:11 – Cheryl : Re: [dabo-users] help with checkbox in dgrid
2012-04-17 07:55 – John Fabiani : Re: [dabo-users] help with checkbox in dgrid
2012-04-17 13:04 – Paul McNett : Re: [dabo-users] help with checkbox in dgrid
Back to top
[dabo-users] help with checkbox in dgrid

Author: Cheryl

Posted: 2012-04-14 21:17:18   Link

Does someone have an example of how to change a bizObject created with the class

designer to show how to make a boolean field show up as a checkbox?

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/loom.20120415T041507-500@post.gmane.org

©2012 Cheryl
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Ed Leafe

Posted: 2012-04-15 18:44:42   Link

On Apr 14, 2012, at 9:17 PM, Cheryl wrote:

> Does someone have an example of how to change a bizObject created with the class

> designer to show how to make a boolean field show up as a checkbox?

You don't change the bizobj; the grid is in the UI layer, not the business logic layer. In the afterInit() of the column of the grid containing the boolean value, add the lines:

self.customRenderer = self.boolRendererClass

-- Ed Leafe

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/34F90A5F-0B18-4AD2-9704-F8827825B8C6@leafe.com

©2012 Ed Leafe
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Ed Leafe

Posted: 2012-04-16 09:04:32   Link

On Apr 15, 2012, at 6:44 PM, Ed Leafe wrote:

>> Does someone have an example of how to change a bizObject created with the class

>> designer to show how to make a boolean field show up as a checkbox?

>

> You don't change the bizobj; the grid is in the UI layer, not the business logic layer.

Actually, I want to take that back. If you define the DataStructure for your bizobj's data, the grid should be able to use that information to set up the appropriate renderer automatically.

-- Ed Leafe

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/2855B152-415C-418E-86B4-C61F91768162@leafe.com

©2012 Ed Leafe
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Cheryl

Posted: 2012-04-16 17:13:14   Link

Cheryl <cheryl@...> writes:

I tried adding the following to the dGrid afterInit method.

def afterInit(self):

col = dabo.ui.dColumn(self, Name="key_field", Order=10,

DataField="key_field",DataType="integer", Width=60,

Caption="Key?", Sortable=False,Searchable=False, Editable=True)

self.addColumn(col)

It created a checkbox on the grid, but when I edited the data, I received error:

data type mismatch, Expecting type 'bool', got type 'int'.

I am using a Postgres backend.

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/loom.20120417T000818-636@post.gmane.org

©2012 Cheryl
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: John Fabiani

Posted: 2012-04-16 20:16:58   Link

On Monday, April 16, 2012 10:13:14 PM Cheryl wrote:

> Cheryl <cheryl@...> writes:

>

>

> I tried adding the following to the dGrid afterInit method.

>

> def afterInit(self):

> col = dabo.ui.dColumn(self, Name="key_field", Order=10,

> DataField="key_field",DataType="integer", Width=60,

> Caption="Key?", Sortable=False,Searchable=False,

> Editable=True)

>

> self.addColumn(col)

> It created a checkbox on the grid, but when I edited the data, I received

> error: data type mismatch, Expecting type 'bool', got type 'int'.

> I am using a Postgres backend.

What is the datatype in Postgres?

Johnf

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/3545662.Yq7G1asjVB@linux-12

©2012 John Fabiani
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Simon Giraudo

Posted: 2012-04-16 20:54:58   Link

form the research I have done on dGrid, it appears that dGrid is set up to view data and

not edit it. Editing data through dGrid appears to throw this error.

here is a link http://old.nabble.com/Editting-date-fields-in-a-dGrid-td25772025.html

What happens if you change the datatype from integer to bool in afterInit?

simon

On 17/04/2012, at 9:16 AM, John Fabiani wrote:

> On Monday, April 16, 2012 10:13:14 PM Cheryl wrote:

>> Cheryl <cheryl@...> writes:

>>

>>

>> I tried adding the following to the dGrid afterInit method.

>>

>> def afterInit(self):

>> col = dabo.ui.dColumn(self, Name="key_field", Order=10,

>> DataField="key_field",DataType="integer", Width=60,

>> Caption="Key?", Sortable=False,Searchable=False,

>> Editable=True)

>>

>> self.addColumn(col)

>> It created a checkbox on the grid, but when I edited the data, I received

>> error: data type mismatch, Expecting type 'bool', got type 'int'.

>> I am using a Postgres backend.

>

> What is the datatype in Postgres?

> Johnf

> _______________________________________________

> Post Messages to: Dabo-users@leafe.com

> Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

> Searchable Archives: http://leafe.com/archives/search/dabo-users

> This message: http://leafe.com/archives/byMID/3545662.Yq7G1asjVB@linux-12

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/804E78E0-D8DA-4E18-88DA-0EFDB01ECBC8@giraudo.com.au

©2012 Simon Giraudo
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Cheryl

Posted: 2012-04-16 22:04:17   Link

the datatype in Postgres is boolean

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/loom.20120417T050226-952@post.gmane.org

©2012 Cheryl
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Cheryl

Posted: 2012-04-16 22:11:25   Link

Cheryl <cheryl@...> writes:

>

>

> the datatype in Postgres is boolean

>

>

the code that I should have posted originally datatype = "bool", but it didn't

work, so I tried "integer", but that didn't work either.

def afterInit(self):

col = dabo.ui.dColumn(self, Name="key_field", Order=10,

DataField="key_field",DataType="bool", Width=60,

Caption="Key?", Sortable=False,Searchable=False, Editable=True)

self.addColumn(col)

this is the code that actually gave me the error: data type mismatch, Expecting

type 'bool', got type 'int'.

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/loom.20120417T050624-513@post.gmane.org

©2012 Cheryl
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: John Fabiani

Posted: 2012-04-17 07:55:34   Link

On Tuesday, April 17, 2012 03:11:25 AM Cheryl wrote:

> Cheryl <cheryl@...> writes:

> > the datatype in Postgres is boolean

>

> the code that I should have posted originally datatype = "bool", but it

> didn't work, so I tried "integer", but that didn't work either.

>

> def afterInit(self):

> col = dabo.ui.dColumn(self, Name="key_field", Order=10,

> DataField="key_field",DataType="bool", Width=60,

> Caption="Key?", Sortable=False,Searchable=False,

> Editable=True)

>

> self.addColumn(col)

>

>

> this is the code that actually gave me the error: data type mismatch,

> Expecting type 'bool', got type 'int'.

If somebody had asked me yesterday if the grid worked with boolean I would

have said "yes". Maybe some sort of side effect has occurred from some change.

Can you run the Dabo demo of the grid? There is a perfect example of using a

boolean in the grid for the column 'Geek'.

Also have you confirmed the data? Look at the DataSet and confirm you are

dealing with a boolean.

Johnf

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/1704548.UvI61G1JQU@linux-12

©2012 John Fabiani
Back to top
Re: [dabo-users] help with checkbox in dgrid

Author: Paul McNett

Posted: 2012-04-17 13:04:52   Link

On 4/17/12 5:55 AM, John Fabiani wrote:

> If somebody had asked me yesterday if the grid worked with boolean I would

> have said "yes". Maybe some sort of side effect has occurred from some change.

I just whipped up one of my tests to prove that Dabo handles editable checkboxes just

fine:

http://paulmcnett.com/test_grid_checkbox.py

Please follow the code in there and run it to prove it for yourself, too.

Paul

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/4F8DB0C4.8040505@ulmcnett.com

©2012 Paul McNett