Index
2007-02-28 13:43 – Dave Nation : [dabo-users] Re : Reference biz objects from ui
2007-02-28 13:54 – johnf : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 14:08 – johnf : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 14:20 – Uwe Grauer : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 15:16 – Nate Lowrie : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 18:13 – Paul McNett : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 18:42 – Nate Lowrie : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 18:56 – johnf : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 20:03 – Nate Lowrie : Re: [dabo-users] Re : Reference biz objects from ui
2007-02-28 20:11 – johnf : Re: [dabo-users] Re : Reference biz objects from ui
Back to top
[dabo-users] Re : Reference biz objects from ui

Author: Dave Nation

Posted: 2007-02-28 13:43:09   Link

Thanks for your speedy reply.

I have tried your suggestions and got the following exceptions :

File "C:\THS\orderbook\ui\PagEditProduct.py", line 45, in createItems

mybiz = self.getBizObject('product')

AttributeError: 'PagEditProduct' object has no attribute 'getBizObject'

File "C:\THS\orderbook\ui\PagEditProduct.py", line 45, in createItems

mybiz = self.Form.getBizObject('product')

AttributeError: 'FrmProduct' object has no attribute 'getBizObject'

My code in biz\Product.py is as follows :-

def getDepartments(self):

crs = self.getTempCursor()

crs.execute('select id, name from department order by name')

dset = crs.getDataSet()

names = [rec['name'] for rec in dset]

ids = [rec['id'] for rec in dset]

return (names,keys)

My code in ui\PagEditProduct is as follows :-

mybiz = self.Form.getBizObject('product')

objectRef = self.addObject(dabo.ui.dListBox, Caption="Department",

NameBase="DepartmentID", DataSource="Product",

DataField="DepartmentID", ValueMode='Key',

Choices = mybiz.getDepartments()[0],

Keys = mybiz.getDepartments()[1])

I am now also wondering, if I've started from the wrong place. I used

the AppWizard to generate the code as a base for my application, and am

now trying to modify the generated code to handle foreign keys etc.

Given your comments about the ClassDesigner not being able to 'edit'

classes generated by the AppWizard, I am wondering if I am really

starting from the wrong place.

Should I rather be building my classes from scratch.

Thanks once again for your help.

Dave

©2007 Dave Nation
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: johnf

Posted: 2007-02-28 13:54:37   Link

On Wednesday 28 February 2007 10:43, Dave Nation wrote:

> Thanks for your speedy reply.

>

> I have tried your suggestions and got the following exceptions :

>

> File "C:\THS\orderbook\ui\PagEditProduct.py", line 45, in createItems

> mybiz = self.getBizObject('product')

> AttributeError: 'PagEditProduct' object has no attribute 'getBizObject'

>

>

> File "C:\THS\orderbook\ui\PagEditProduct.py", line 45, in createItems

> mybiz = self.Form.getBizObject('product')

> AttributeError: 'FrmProduct' object has no attribute 'getBizObject'

>

> My code in biz\Product.py is as follows :-

> def getDepartments(self):

> crs = self.getTempCursor()

> crs.execute('select id, name from department order by name')

> dset = crs.getDataSet()

> names = [rec['name'] for rec in dset]

> ids = [rec['id'] for rec in dset]

> return (names,keys)

>

> My code in ui\PagEditProduct is as follows :-

> mybiz = self.Form.getBizObject('product')

> objectRef = self.addObject(dabo.ui.dListBox, Caption="Department",

> NameBase="DepartmentID", DataSource="Product",

> DataField="DepartmentID", ValueMode='Key',

> Choices = mybiz.getDepartments()[0],

> Keys = mybiz.getDepartments()[1])

>

> I am now also wondering, if I've started from the wrong place. I used

> the AppWizard to generate the code as a base for my application, and am

> now trying to modify the generated code to handle foreign keys etc.

>

> Given your comments about the ClassDesigner not being able to 'edit'

> classes generated by the AppWizard, I am wondering if I am really

> starting from the wrong place.

> Should I rather be building my classes from scratch.

>

> Thanks once again for your help.

>

> Dave

It is "getBizobj" and not "getBizObject" and it is method of the form.

--

John Fabiani

©2007 johnf
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: johnf

Posted: 2007-02-28 14:08:29   Link

On Wednesday 28 February 2007 10:54, johnf wrote:

> > I am now also wondering, if I've started from the wrong place. I used

> > the AppWizard to generate the code as a base for my application, and am

> > now trying to modify the generated code to handle foreign keys etc.

> >

> > Given your comments about the ClassDesigner not being able to 'edit'

> > classes generated by the AppWizard, I am wondering if I am really

> > starting from the wrong place.

> > Should I rather be building my classes from scratch.

IMHO I would drop AppWizard. It was designed as simple way to demo Dabo and

provide a search,browse, and edit function based on a single table.

Take a look at a recent screencast on www.dabodev.com. They demo how easy it

is to create a form that allows similar functions as AppWizard. But more

importantly you can edit code directly. For example the screencast show you

how to include a link table.

After working with the ClassDesigner you will move on to creating your own

classes.

--

John Fabiani

©2007 johnf
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: Uwe Grauer

Posted: 2007-02-28 14:20:32   Link

Dave Nation wrote:

> Thanks for your speedy reply.

>

> I have tried your suggestions and got the following exceptions :

>

> File "C:\THS\orderbook\ui\PagEditProduct.py", line 45, in createItems

> mybiz = self.getBizObject('product')

> AttributeError: 'PagEditProduct' object has no attribute 'getBizObject'

>

>

mybiz = self.Form.getBizobj('product')

> File "C:\THS\orderbook\ui\PagEditProduct.py", line 45, in createItems

> mybiz = self.Form.getBizObject('product')

> AttributeError: 'FrmProduct' object has no attribute 'getBizObject'

>

> My code in biz\Product.py is as follows :-

> def getDepartments(self):

> crs = self.getTempCursor()

> crs.execute('select id, name from department order by name')

> dset = crs.getDataSet()

> names = [rec['name'] for rec in dset]

> ids = [rec['id'] for rec in dset]

> return (names,keys)

>

> My code in ui\PagEditProduct is as follows :-

> mybiz = self.Form.getBizObject('product')

> objectRef = self.addObject(dabo.ui.dListBox, Caption="Department",

> NameBase="DepartmentID", DataSource="Product",

> DataField="DepartmentID", ValueMode='Key',

> Choices = mybiz.getDepartments()[0],

> Keys = mybiz.getDepartments()[1])

>

You can do:

Choices, Keys = mybiz.getDepartments()

Otherwise your query runs twice.

Uwe

©2007 Uwe Grauer
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: Nate Lowrie

Posted: 2007-02-28 15:16:32   Link

On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> On Wednesday 28 February 2007 10:54, johnf wrote:

> > > I am now also wondering, if I've started from the wrong place. I used

> > > the AppWizard to generate the code as a base for my application, and am

> > > now trying to modify the generated code to handle foreign keys etc.

> > >

> > > Given your comments about the ClassDesigner not being able to 'edit'

> > > classes generated by the AppWizard, I am wondering if I am really

> > > starting from the wrong place.

> > > Should I rather be building my classes from scratch.

> IMHO I would drop AppWizard. It was designed as simple way to demo Dabo and

> provide a search,browse, and edit function based on a single table.

I would agree. It's far easier to do it manually.

>

> Take a look at a recent screencast on www.dabodev.com. They demo how easy it

> is to create a form that allows similar functions as AppWizard. But more

> importantly you can edit code directly. For example the screencast show you

> how to include a link table.

>

> After working with the ClassDesigner you will move on to creating your own

> classes.

Or just drop the ClassDesigner to code apps by hand :)

> --

> John Fabiani

>

©2007 Nate Lowrie
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: Paul McNett

Posted: 2007-02-28 18:13:10   Link

Nate Lowrie wrote:

> On 2/28/07, johnf <jfabiani@yolo.com> wrote:

>> On Wednesday 28 February 2007 10:54, johnf wrote:

>>>> I am now also wondering, if I've started from the wrong place. I used

>>>> the AppWizard to generate the code as a base for my application, and am

>>>> now trying to modify the generated code to handle foreign keys etc.

>>>>

>>>> Given your comments about the ClassDesigner not being able to 'edit'

>>>> classes generated by the AppWizard, I am wondering if I am really

>>>> starting from the wrong place.

>>>> Should I rather be building my classes from scratch.

>> IMHO I would drop AppWizard. It was designed as simple way to demo Dabo and

>> provide a search,browse, and edit function based on a single table.

>

> I would agree. It's far easier to do it manually.

>

>> Take a look at a recent screencast on www.dabodev.com. They demo how easy it

>> is to create a form that allows similar functions as AppWizard. But more

>> importantly you can edit code directly. For example the screencast show you

>> how to include a link table.

>>

>> After working with the ClassDesigner you will move on to creating your own

>> classes.

>

> Or just drop the ClassDesigner to code apps by hand :)

I just have to add my 2 cents to the mix. The ClassDesigner isn't ready

for production use, because it is still in flux and bugs are found and

fixed all the time.

While the generated output from the AppWizard is indeed simple, and only

really deals with single tables and gives you only a simple CRUD design,

it does give you a skeleton structure to build from, that IMO is pretty

well designed.

If you are going to code by hand, consider starting with a generated

AppWizard app and build from there. I've done this with 2 commercial

apps and a handful of internal apps so far, and I really believe that it

scales.

--

pkm ~ http://paulmcnett.com

©2007 Paul McNett
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: Nate Lowrie

Posted: 2007-02-28 18:42:33   Link

On 2/28/07, Paul McNett <p@ulmcnett.com> wrote:

> Nate Lowrie wrote:

> > On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> >> On Wednesday 28 February 2007 10:54, johnf wrote:

> >>>> I am now also wondering, if I've started from the wrong place. I used

> >>>> the AppWizard to generate the code as a base for my application, and am

> >>>> now trying to modify the generated code to handle foreign keys etc.

> >>>>

> >>>> Given your comments about the ClassDesigner not being able to 'edit'

> >>>> classes generated by the AppWizard, I am wondering if I am really

> >>>> starting from the wrong place.

> >>>> Should I rather be building my classes from scratch.

> >> IMHO I would drop AppWizard. It was designed as simple way to demo Dabo and

> >> provide a search,browse, and edit function based on a single table.

> >

> > I would agree. It's far easier to do it manually.

> >

> >> Take a look at a recent screencast on www.dabodev.com. They demo how easy it

> >> is to create a form that allows similar functions as AppWizard. But more

> >> importantly you can edit code directly. For example the screencast show you

> >> how to include a link table.

> >>

> >> After working with the ClassDesigner you will move on to creating your own

> >> classes.

> >

> > Or just drop the ClassDesigner to code apps by hand :)

>

> I just have to add my 2 cents to the mix. The ClassDesigner isn't ready

> for production use, because it is still in flux and bugs are found and

> fixed all the time.

>

> While the generated output from the AppWizard is indeed simple, and only

> really deals with single tables and gives you only a simple CRUD design,

> it does give you a skeleton structure to build from, that IMO is pretty

> well designed.

>

> If you are going to code by hand, consider starting with a generated

> AppWizard app and build from there. I've done this with 2 commercial

> apps and a handful of internal apps so far, and I really believe that it

> scales.

I think that I would do that just for the db and biz connections code

and chuck the UI portion. That is, assuming I ever actually do get

around to fiddling with the db and biz tiers....Maybe by then we will

just have a connections app.

>

> --

> pkm ~ http://paulmcnett.com

>

>

©2007 Nate Lowrie
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: johnf

Posted: 2007-02-28 18:56:11   Link

On Wednesday 28 February 2007 15:42, Nate Lowrie wrote:

> On 2/28/07, Paul McNett <p@ulmcnett.com> wrote:

> > Nate Lowrie wrote:

> > > On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> > >> On Wednesday 28 February 2007 10:54, johnf wrote:

> > >>>> I am now also wondering, if I've started from the wrong place. I

> > >>>> used the AppWizard to generate the code as a base for my

> > >>>> application, and am now trying to modify the generated code to

> > >>>> handle foreign keys etc.

> > >>>>

> > >>>> Given your comments about the ClassDesigner not being able to 'edit'

> > >>>> classes generated by the AppWizard, I am wondering if I am really

> > >>>> starting from the wrong place.

> > >>>> Should I rather be building my classes from scratch.

> > >>

> > >> IMHO I would drop AppWizard. It was designed as simple way to demo

> > >> Dabo and provide a search,browse, and edit function based on a single

> > >> table.

> > >

> > > I would agree. It's far easier to do it manually.

> > >

> > >> Take a look at a recent screencast on www.dabodev.com. They demo how

> > >> easy it is to create a form that allows similar functions as

> > >> AppWizard. But more importantly you can edit code directly. For

> > >> example the screencast show you how to include a link table.

> > >>

> > >> After working with the ClassDesigner you will move on to creating your

> > >> own classes.

> > >

> > > Or just drop the ClassDesigner to code apps by hand :)

> >

> > I just have to add my 2 cents to the mix. The ClassDesigner isn't ready

> > for production use, because it is still in flux and bugs are found and

> > fixed all the time.

> >

> > While the generated output from the AppWizard is indeed simple, and only

> > really deals with single tables and gives you only a simple CRUD design,

> > it does give you a skeleton structure to build from, that IMO is pretty

> > well designed.

> >

> > If you are going to code by hand, consider starting with a generated

> > AppWizard app and build from there. I've done this with 2 commercial

> > apps and a handful of internal apps so far, and I really believe that it

> > scales.

>

> I think that I would do that just for the db and biz connections code

> and chuck the UI portion. That is, assuming I ever actually do get

> around to fiddling with the db and biz tiers....Maybe by then we will

> just have a connections app.

>

> > --

> > pkm ~ http://paulmcnett.com

OK my .03 (what did I just say? I lose more cents that way?).

The only issue for a newbie is there so much going on with an AppWizard

program. Just following the datanav2 is tuff and when you add in all the

created objects from the AppwWizard it makes it even harder. Where as with

the ClassDesigner the screen code is hidden in the cdxml file. But things

that effect the screen are not hidden i.e. the bizobj's, onHit methods, etc..

The Newbie can then play with simple objects (but very important ones) and

see immediate results to any code changes.

--

John Fabiani

©2007 johnf
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: Nate Lowrie

Posted: 2007-02-28 20:03:12   Link

On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> On Wednesday 28 February 2007 15:42, Nate Lowrie wrote:

> > On 2/28/07, Paul McNett <p@ulmcnett.com> wrote:

> > > Nate Lowrie wrote:

> > > > On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> > > >> On Wednesday 28 February 2007 10:54, johnf wrote:

> > > >>>> I am now also wondering, if I've started from the wrong place. I

> > > >>>> used the AppWizard to generate the code as a base for my

> > > >>>> application, and am now trying to modify the generated code to

> > > >>>> handle foreign keys etc.

> > > >>>>

> > > >>>> Given your comments about the ClassDesigner not being able to 'edit'

> > > >>>> classes generated by the AppWizard, I am wondering if I am really

> > > >>>> starting from the wrong place.

> > > >>>> Should I rather be building my classes from scratch.

> > > >>

> > > >> IMHO I would drop AppWizard. It was designed as simple way to demo

> > > >> Dabo and provide a search,browse, and edit function based on a single

> > > >> table.

> > > >

> > > > I would agree. It's far easier to do it manually.

> > > >

> > > >> Take a look at a recent screencast on www.dabodev.com. They demo how

> > > >> easy it is to create a form that allows similar functions as

> > > >> AppWizard. But more importantly you can edit code directly. For

> > > >> example the screencast show you how to include a link table.

> > > >>

> > > >> After working with the ClassDesigner you will move on to creating your

> > > >> own classes.

> > > >

> > > > Or just drop the ClassDesigner to code apps by hand :)

> > >

> > > I just have to add my 2 cents to the mix. The ClassDesigner isn't ready

> > > for production use, because it is still in flux and bugs are found and

> > > fixed all the time.

> > >

> > > While the generated output from the AppWizard is indeed simple, and only

> > > really deals with single tables and gives you only a simple CRUD design,

> > > it does give you a skeleton structure to build from, that IMO is pretty

> > > well designed.

> > >

> > > If you are going to code by hand, consider starting with a generated

> > > AppWizard app and build from there. I've done this with 2 commercial

> > > apps and a handful of internal apps so far, and I really believe that it

> > > scales.

> >

> > I think that I would do that just for the db and biz connections code

> > and chuck the UI portion. That is, assuming I ever actually do get

> > around to fiddling with the db and biz tiers....Maybe by then we will

> > just have a connections app.

> >

> > > --

> > > pkm ~ http://paulmcnett.com

>

> OK my .03 (what did I just say? I lose more cents that way?).

>

> The only issue for a newbie is there so much going on with an AppWizard

> program. Just following the datanav2 is tuff and when you add in all the

> created objects from the AppwWizard it makes it even harder. Where as with

> the ClassDesigner the screen code is hidden in the cdxml file. But things

> that effect the screen are not hidden i.e. the bizobj's, onHit methods, etc..

> The Newbie can then play with simple objects (but very important ones) and

> see immediate results to any code changes.

The class designer kinda reminds me of the Visual Studio forms

designer in the way that it hides the GUI code from you and still

let's you edit things like event handler functions.

One word of advice though...As good as the visual design tools are, it

is still an extremely good idea to learn how to hand code parts of the

framework, especially the UI tier. You never know when you will need

to debug code and know the framework API.

>

> --

> John Fabiani

>

©2007 Nate Lowrie
Back to top
Re: [dabo-users] Re : Reference biz objects from ui

Author: johnf

Posted: 2007-02-28 20:11:31   Link

On Wednesday 28 February 2007 17:03, Nate Lowrie wrote:

> On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> > On Wednesday 28 February 2007 15:42, Nate Lowrie wrote:

> > > On 2/28/07, Paul McNett <p@ulmcnett.com> wrote:

> > > > Nate Lowrie wrote:

> > > > > On 2/28/07, johnf <jfabiani@yolo.com> wrote:

> > > > >> On Wednesday 28 February 2007 10:54, johnf wrote:

> > > > >>>> I am now also wondering, if I've started from the wrong place. I

> > > > >>>> used the AppWizard to generate the code as a base for my

> > > > >>>> application, and am now trying to modify the generated code to

> > > > >>>> handle foreign keys etc.

> > > > >>>>

> > > > >>>> Given your comments about the ClassDesigner not being able to

> > > > >>>> 'edit' classes generated by the AppWizard, I am wondering if I

> > > > >>>> am really starting from the wrong place.

> > > > >>>> Should I rather be building my classes from scratch.

> > > > >>

> > > > >> IMHO I would drop AppWizard. It was designed as simple way to

> > > > >> demo Dabo and provide a search,browse, and edit function based on

> > > > >> a single table.

> > > > >

> > > > > I would agree. It's far easier to do it manually.

> > > > >

> > > > >> Take a look at a recent screencast on www.dabodev.com. They demo

> > > > >> how easy it is to create a form that allows similar functions as

> > > > >> AppWizard. But more importantly you can edit code directly. For

> > > > >> example the screencast show you how to include a link table.

> > > > >>

> > > > >> After working with the ClassDesigner you will move on to creating

> > > > >> your own classes.

> > > > >

> > > > > Or just drop the ClassDesigner to code apps by hand :)

> > > >

> > > > I just have to add my 2 cents to the mix. The ClassDesigner isn't

> > > > ready for production use, because it is still in flux and bugs are

> > > > found and fixed all the time.

> > > >

> > > > While the generated output from the AppWizard is indeed simple, and

> > > > only really deals with single tables and gives you only a simple CRUD

> > > > design, it does give you a skeleton structure to build from, that IMO

> > > > is pretty well designed.

> > > >

> > > > If you are going to code by hand, consider starting with a generated

> > > > AppWizard app and build from there. I've done this with 2 commercial

> > > > apps and a handful of internal apps so far, and I really believe that

> > > > it scales.

> > >

> > > I think that I would do that just for the db and biz connections code

> > > and chuck the UI portion. That is, assuming I ever actually do get

> > > around to fiddling with the db and biz tiers....Maybe by then we will

> > > just have a connections app.

> > >

> > > > --

> > > > pkm ~ http://paulmcnett.com

> >

> > OK my .03 (what did I just say? I lose more cents that way?).

> >

> > The only issue for a newbie is there so much going on with an AppWizard

> > program. Just following the datanav2 is tuff and when you add in all the

> > created objects from the AppwWizard it makes it even harder. Where as

> > with the ClassDesigner the screen code is hidden in the cdxml file. But

> > things that effect the screen are not hidden i.e. the bizobj's, onHit

> > methods, etc.. The Newbie can then play with simple objects (but very

> > important ones) and see immediate results to any code changes.

>

> The class designer kinda reminds me of the Visual Studio forms

> designer in the way that it hides the GUI code from you and still

> let's you edit things like event handler functions.

>

> One word of advice though...As good as the visual design tools are, it

> is still an extremely good idea to learn how to hand code parts of the

> framework, especially the UI tier. You never know when you will need

> to debug code and know the framework API.

No question about it hand coding teaches and thanks to you I can hand code a

form.

The biggest problem with the ClassDesigner is the lack of the ability to move

controls or add controls in the middle of some sizer. Hand coding allows you

to insert sizers and controls or change the order of controls without losing

anything. But if you know what you are designing and no changes are needed

there is nothing faster than using the ClassDesigner.

--

John Fabiani

©2007 johnf