On Thursday, February 17, 2011 05:27:36 am bruno gallart wrote:
> Hi all,
>
> I am trying Dabo and it is very interesting.
> I made a test with sqlite's base and one table. I did a form with
> dListBox (LtVerbesOc) that loads the records coming from a table named
> VerbesOc. I have followed the help,
>
> create a connexion etc...and write the initAll's fonction like this
>
> def afterInitAll(self):
> verbesBiz = self.getBizobj("VerbesOc")
>
> verbes, keys = verbesBiz.chargeLtVerbesOc()
> self.LtVerbesOc.Choices = verbes
> self.LtVerbesOc.Keys = keys
> self.LtVerbesOc.ValueMode = "Key"
> self.requery()
> All works fine but i saw that there are in the dListBox's proprieties,
> a DataSource' propriety and DataFied's propriety. In my test this
> informations are blank and all works fine.
>
> My question:
> There is a another way to load my sqlite's table VerbesOc directly in my
> sListBox in informing DataSource and Datafield without the little
> program in afterInitAll(). In fact, more automaticaly ?
>
> I hope you understand my bad english sorry for this,
>
> Regars,
> Bruno
Don't worry your English is fine. To my knowledge there is no other way to
populate a list, no special framework method that will not require what you
are currently doing. The DataSource and DataField properties are used to
associate the list control with a bizobj and allow retrieval of the data.
DataSource and DataField are one of the major features of the Dabo.
Only one gotcha - when retrieving data from the bizobj for the list control
you have to insure all possible values are available in the Choices/Keys.
That would include a None value. Therefore, in the method
"verbesBiz.chargeLtVerbesOc()" you will need to add for a choice "None" and
zero for Keys. This will mostly like occur when dealing with a blank/empty
record/row.
Hope this helps,
Johnf
_______________________________________________
Post Messages to: [email protected]
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/[email protected]