[dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
Hi,
I have always had issues with dropdowns selection determining the a second 
control.  Now I have need to have fours dropdowns and each of the dropdowns 
data (or Choices) will depend on the preceding dropdown selection.  Does 
anyone have a suggestion on how best to deal with my requirement?

Thanks in advance,
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/201104070722.51749.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Nate Lowrie
On Thu, Apr 7, 2011 at 10:22, John Fabiani jo...@jfcomputer.com wrote:

 Hi,
 I have always had issues with dropdowns selection determining the a second
 control.  Now I have need to have fours dropdowns and each of the dropdowns
 data (or Choices) will depend on the preceding dropdown selection.  Does
 anyone have a suggestion on how best to deal with my requirement?

John,

I would disable the controls that aren't populated yet. Populate the
first control.  Then, have event handlers for each dropdown to
populate the next one and enable it.  If the user changes the first
dropdown, the event handler should repopulate the second dropdown and
disable the rest, essentially forcing the process to start over.

Regards,

Nate
___
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/banlktikmuqetejdpwz9wg4340nmazo0...@mail.gmail.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Henning Hraban Ramm

Am 2011-04-07 um 16:22 schrieb John Fabiani:

 Hi,
 I have always had issues with dropdowns selection determining the a  
 second
 control.  Now I have need to have fours dropdowns and each of the  
 dropdowns
 data (or Choices) will depend on the preceding dropdown selection.   
 Does
 anyone have a suggestion on how best to deal with my requirement?

I reload the other dropdowns’ choices after a Hit on one, it all  
happens in the onHit handler.
Perhaps I don’t undersa´tand your question?


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net
https://www.cacert.org (I'm an assurer)




___
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/21ea9dc7-07c6-4c4e-b1eb-63b7a34cf...@fiee.net


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
On Thursday, April 07, 2011 07:44:56 am Henning Hraban Ramm wrote:
 Am 2011-04-07 um 16:22 schrieb John Fabiani:
  Hi,
  I have always had issues with dropdowns selection determining the a
  second
  control.  Now I have need to have fours dropdowns and each of the
  dropdowns
  data (or Choices) will depend on the preceding dropdown selection.
  Does
  anyone have a suggestion on how best to deal with my requirement?
 
 I reload the other dropdowns’ choices after a Hit on one, it all
 happens in the onHit handler.
 Perhaps I don’t undersa´tand your question?
 
 
 Greetlings from Lake Constance!
 Hraban
 ---
 http://www.fiee.net
 https://www.cacert.org (I'm an assurer)

No that's right - I will be using OnHit.  But the problem is not as straight 
forward as you suggest.  If I set the first dropdown the second, third, and 
forth must match.  If I set the second the third and forth data choices must 
match what is in 1 and 2  - and so on.  If I set all of them and then change 
the first then all the rest must change.  To make matters worse none of the 
data items come from the same tables.  Each dropdown filters the data 
available for the next.  And remember I want this to work with Dabo's 
DataSource and DataFields when not entering data into a new record.

I have considered creating a view and then actually filter the data as 
required since the records are related but then I could have several thousands 
of records in memory.  So I have discounted that solution.  

I have considered creating a class that would provide a dynamic property that 
could be set to retrieve the data (choices and keys).  Similar to the ones Ed 
and Paul have created for other controls.  Not sure how much work this would 
be?

I have considered creating a single method that all dropdowns call and control 
the data in the method.  I would be able to read the values (keys) from each 
of the controls and do what is required to reset the choices for each of the 
controls.  This might be the way to go.

But I looking for suggestions - from the list.  I don't want to start a lot 
coding only to later discover I'm traveling along the wrong path.

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/201104070806.45733.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
On Thursday, April 07, 2011 07:44:49 am Nate Lowrie wrote:
 On Thu, Apr 7, 2011 at 10:22, John Fabiani jo...@jfcomputer.com wrote:
  Hi,
  I have always had issues with dropdowns selection determining the a
  second control.  Now I have need to have fours dropdowns and each of the
  dropdowns data (or Choices) will depend on the preceding dropdown
  selection.  Does anyone have a suggestion on how best to deal with my
  requirement?
 
 John,
 
 I would disable the controls that aren't populated yet. Populate the
 first control.  Then, have event handlers for each dropdown to
 populate the next one and enable it.  If the user changes the first
 dropdown, the event handler should repopulate the second dropdown and
 disable the rest, essentially forcing the process to start over.
 
 Regards,
 
 Nate

I had not considered disabling and then enabling the controls.  I like it.  No 
matter how this gets written I bet that suggestion will be used.  Thanks Nate!

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/201104070809.45233.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Henning Hraban Ramm
Am 2011-04-07 um 17:06 schrieb John Fabiani:
 No that's right - I will be using OnHit.  But the problem is not as  
 straight
 forward as you suggest.  If I set the first dropdown the second,  
 third, and
 forth must match.  If I set the second the third and forth data  
 choices must
 match what is in 1 and 2  - and so on.  If I set all of them and  
 then change
 the first then all the rest must change.  To make matters worse none  
 of the
 data items come from the same tables.  Each dropdown filters the data
 available for the next.  And remember I want this to work with Dabo's
 DataSource and DataFields when not entering data into a new record.

 I have considered creating a view and then actually filter the data as
 required since the records are related but then I could have several  
 thousands
 of records in memory.  So I have discounted that solution.

 I have considered creating a class that would provide a dynamic  
 property that
 could be set to retrieve the data (choices and keys).  Similar to  
 the ones Ed
 and Paul have created for other controls.  Not sure how much work  
 this would
 be?

 I have considered creating a single method that all dropdowns call  
 and control
 the data in the method.  I would be able to read the values (keys)  
 from each
 of the controls and do what is required to reset the choices for  
 each of the
 controls.  This might be the way to go.

 But I looking for suggestions - from the list.  I don't want to  
 start a lot
 coding only to later discover I'm traveling along the wrong path.

The other suggestion of disabling not-yet-set dropdowns is probably  
good.

You could use events/signals to update all DDs in need.

Most easy is probably to update DD2 from DD1.onHit, update DD3 from  
DD2.onHit etc.
(only the next one, not more, except if there’s a high probability  
that the user wants a default value)
and perhaps reset all following DDs (in case someone changes the  
selection of DD1 after setting DD3).

In my similar case, I try to keep the selection of following DDs,  
since some selection-cascades are very similar, and it’s annoying to  
choose the same over and over if you’re exploring possibilities.

But in my case I don’t use Dabo’s bizobjs, but have read all the data  
from an http/JSON call and keep it in memory for the runtime (it’s not  
so much, only lists of sections and subsections for several magazines).

Sorry for being of no big help.

Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net
https://www.cacert.org (I'm an assurer)




___
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/ba53ae8c-5d6f-4044-a98f-28d0c8d3a...@fiee.net


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
On Thursday, April 07, 2011 08:20:37 am Henning Hraban Ramm wrote:
 Am 2011-04-07 um 17:06 schrieb John Fabiani:
  No that's right - I will be using OnHit.  But the problem is not as
  straight
  forward as you suggest.  If I set the first dropdown the second,
  third, and
  forth must match.  If I set the second the third and forth data
  choices must
  match what is in 1 and 2  - and so on.  If I set all of them and
  then change
  the first then all the rest must change.  To make matters worse none
  of the
  data items come from the same tables.  Each dropdown filters the data
  available for the next.  And remember I want this to work with Dabo's
  DataSource and DataFields when not entering data into a new record.
  
  I have considered creating a view and then actually filter the data as
  required since the records are related but then I could have several
  thousands
  of records in memory.  So I have discounted that solution.
  
  I have considered creating a class that would provide a dynamic
  property that
  could be set to retrieve the data (choices and keys).  Similar to
  the ones Ed
  and Paul have created for other controls.  Not sure how much work
  this would
  be?
  
  I have considered creating a single method that all dropdowns call
  and control
  the data in the method.  I would be able to read the values (keys)
  from each
  of the controls and do what is required to reset the choices for
  each of the
  controls.  This might be the way to go.
  
  But I looking for suggestions - from the list.  I don't want to
  start a lot
  coding only to later discover I'm traveling along the wrong path.
 
 The other suggestion of disabling not-yet-set dropdowns is probably
 good.
 
 You could use events/signals to update all DDs in need.
 
 Most easy is probably to update DD2 from DD1.onHit, update DD3 from
 DD2.onHit etc.
 (only the next one, not more, except if there’s a high probability
 that the user wants a default value)
 and perhaps reset all following DDs (in case someone changes the
 selection of DD1 after setting DD3).
 
 In my similar case, I try to keep the selection of following DDs,
 since some selection-cascades are very similar, and it’s annoying to
 choose the same over and over if you’re exploring possibilities.
 
 But in my case I don’t use Dabo’s bizobjs, but have read all the data
 from an http/JSON call and keep it in memory for the runtime (it’s not
 so much, only lists of sections and subsections for several magazines).
 
 Sorry for being of no big help.
 
 Greetlings from Lake Constance!
 Hraban
 ---
 http://www.fiee.net
 https://www.cacert.org (I'm an assurer)

Actually anything someone says is helpful even if it's wrong (not that you are 
wrong) as long as others correct it.  Ask Ed how many times he's corrected me 
on this list.  Of course maybe Ed doesn't agree with my statement.

I doubt this problem is very unique (did it all the time for VFP) but it is 
different for wxPython (therefore Dabo) IMO.  With VFP the dropdown (comboBox) 
was more dynamic.  Anyway, I'm playing as I type with a solution of course 
it's not working.

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/201104070838.56657.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Paul McNett
On 4/7/11 7:22 AM, John Fabiani wrote:
 I have always had issues with dropdowns selection determining the a second
 control.  Now I have need to have fours dropdowns and each of the dropdowns
 data (or Choices) will depend on the preceding dropdown selection.  Does
 anyone have a suggestion on how best to deal with my requirement?

I suggest that 90% of the code you write belongs in the bizobj. Provide a 
method or 
methods in the bizobj to determine the choices for the 4 dropdowns based on the 
values of other fields. Provide a method or methods to return True or False 
whether 
or not the user is allowed to modify that field currently.

Hook into biz.afterSetFieldVal() to catch when the user picks a different row 
in the 
listbox.

The easiest way to let the UI know that it needs to update the display from the 
bizobj that I know of would be:

self.Application.ActiveForm.update()

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/4d9de01b.5000...@ulmcnett.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
On Thursday, April 07, 2011 09:02:35 am Paul McNett wrote:
 On 4/7/11 7:22 AM, John Fabiani wrote:
  I have always had issues with dropdowns selection determining the a
  second control.  Now I have need to have fours dropdowns and each of the
  dropdowns data (or Choices) will depend on the preceding dropdown
  selection.  Does anyone have a suggestion on how best to deal with my
  requirement?
 
 I suggest that 90% of the code you write belongs in the bizobj. Provide a
 method or methods in the bizobj to determine the choices for the 4
 dropdowns based on the values of other fields. Provide a method or methods
 to return True or False whether or not the user is allowed to modify that
 field currently.
 
 Hook into biz.afterSetFieldVal() to catch when the user picks a different
 row in the listbox.
 
 The easiest way to let the UI know that it needs to update the display from
 the bizobj that I know of would be:
 
 self.Application.ActiveForm.update()
 
 Paul

I had not considered using the bizobj to control the choices.  Mostly because 
I keep ui stuff out (I have exceptions) of the bizobj code.  I also haven't 
used the afterSetFieldVal() in the past - I'll look into it.  

Thanks for the suggestions,
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/201104070919.28710.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
On Thursday, April 07, 2011 09:02:35 am Paul McNett wrote:
 On 4/7/11 7:22 AM, John Fabiani wrote:
  I have always had issues with dropdowns selection determining the a
  second control.  Now I have need to have fours dropdowns and each of the
  dropdowns data (or Choices) will depend on the preceding dropdown
  selection.  Does anyone have a suggestion on how best to deal with my
  requirement?
 
 I suggest that 90% of the code you write belongs in the bizobj. Provide a
 method or methods in the bizobj to determine the choices for the 4
 dropdowns based on the values of other fields. Provide a method or methods
 to return True or False whether or not the user is allowed to modify that
 field currently.
 
 Hook into biz.afterSetFieldVal() to catch when the user picks a different
 row in the listbox.
 
 The easiest way to let the UI know that it needs to update the display from
 the bizobj that I know of would be:
 
 self.Application.ActiveForm.update()
 
 Paul

Oops?  I don't see an afterSetFieldVal 

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/201104070924.16194.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread John Fabiani
On Thursday, April 07, 2011 09:24:16 am John Fabiani wrote:
 On Thursday, April 07, 2011 09:02:35 am Paul McNett wrote:
  On 4/7/11 7:22 AM, John Fabiani wrote:
   I have always had issues with dropdowns selection determining the a
   second control.  Now I have need to have fours dropdowns and each of
   the dropdowns data (or Choices) will depend on the preceding dropdown
   selection.  Does anyone have a suggestion on how best to deal with my
   requirement?
  
  I suggest that 90% of the code you write belongs in the bizobj. Provide a
  method or methods in the bizobj to determine the choices for the 4
  dropdowns based on the values of other fields. Provide a method or
  methods to return True or False whether or not the user is allowed to
  modify that field currently.
  
  Hook into biz.afterSetFieldVal() to catch when the user picks a different
  row in the listbox.
  
  The easiest way to let the UI know that it needs to update the display
  from the bizobj that I know of would be:
  
  self.Application.ActiveForm.update()
  
  Paul
 
 Oops?  I don't see an afterSetFieldVal
 
 Johnf

Sorry I'm dealing with an older version of Dabo.

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/201104070939.06119.jo...@jfcomputer.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Paul McNett
On 4/7/11 9:24 AM, John Fabiani wrote:
 Oops?  I don't see an afterSetFieldVal

Was added in r6233 on 2 Dec, 2010.

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/4d9de8e8.8020...@ulmcnett.com


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Werner F. Bruhin
On 07/04/2011 18:24, John Fabiani wrote:
...
 Oops?  I don't see an afterSetFieldVal

http://thewinecellarbook.com/daboDocTestAlt/search.html?q=afterSetFieldValcheck_keywords=yesarea=default

;-)

Werner

___
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/4d9debd1.2000...@free.fr


Re: [dabo-users] cascading dropdown controls selections

2011-04-07 Thread Paul McNett
On 4/7/11 9:19 AM, John Fabiani wrote:
 I had not considered using the bizobj to control the choices.  Mostly because
 I keep ui stuff out (I have exceptions) of the bizobj code.

The bizobj wouldn't know anything about the UI, just what choices to present 
given 
the current values of fields in the bizobj.

The self.Application.ActiveForm.update() does cross the line, though. But 
sometimes 
practicality beats purity.

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/4d9dec23.1040...@ulmcnett.com