Subject | Re: [IBO] IBO Search with 'OR' |
---|---|
Author | Geoff Worboys |
Post date | 2016-01-27T02:19:33Z |
Hi Marcin,
Ah yes, the dreaded drop-down boxes (lookups and combos).
In theory this should be feasible with a single control, but
it would take a lot of effort to develop.
Internally IB_ComboBoxEnh uses a listbox derivation that does
support checkboxes, it also supports alternate highlighting
that could be used instead.
Internally both IB_LookupEnh & IB_LookupCombo use IB_Grid which
supports selecting of multiple rows (bookmarking).
The search processing already has a way to let the control
manage what WHERE clause is generated for its criteria, so that
part should not be a big problem.
The real complication comes not with the multiple selection but
with how to change the main display area so that it displays
the results of the multiple selection without getting itself
(or the user) confused.
This next bit is directed partly at Jason I guess (it actually
relates to a separate conversation I had with Jason), but if
you are feeling adventurous, Marcin, you could do this:
For ComboBox controls (IBO and Enh) it would be feasible to set
up linking of controls whose searches are to be OR'd together.
The existence of these links would be detected in
TIB_FieldDataLink.DoPrepareSQL and would alter processing
so that instead of adding the search of each field link to
the whereitems as separate entries (AND), it would collect
from all linked field links and put together a single
whereitems entry for all the items (using OR).
Working out how to handle linking the controls efficiently
could be a challenge, but it may offer a way to achieve the
desired result without impacting normal operation (even
search save/restore should continue to work as expected).
But for lookups it gets messier because the search is handled
by the keydatalink between the lookup dataset and the main
dataset (not by LookupCombo). LookupEnh has a work around for
this, but it requires additional changes to IBO that would
prevent the use of LookupCombo.
--
Geoff Worboys
Telesis Computing Pty Ltd
'Marcin Bury' marcin.bury@... [IBObjects] wrote:
Ah yes, the dreaded drop-down boxes (lookups and combos).
In theory this should be feasible with a single control, but
it would take a lot of effort to develop.
Internally IB_ComboBoxEnh uses a listbox derivation that does
support checkboxes, it also supports alternate highlighting
that could be used instead.
Internally both IB_LookupEnh & IB_LookupCombo use IB_Grid which
supports selecting of multiple rows (bookmarking).
The search processing already has a way to let the control
manage what WHERE clause is generated for its criteria, so that
part should not be a big problem.
The real complication comes not with the multiple selection but
with how to change the main display area so that it displays
the results of the multiple selection without getting itself
(or the user) confused.
This next bit is directed partly at Jason I guess (it actually
relates to a separate conversation I had with Jason), but if
you are feeling adventurous, Marcin, you could do this:
For ComboBox controls (IBO and Enh) it would be feasible to set
up linking of controls whose searches are to be OR'd together.
The existence of these links would be detected in
TIB_FieldDataLink.DoPrepareSQL and would alter processing
so that instead of adding the search of each field link to
the whereitems as separate entries (AND), it would collect
from all linked field links and put together a single
whereitems entry for all the items (using OR).
Working out how to handle linking the controls efficiently
could be a challenge, but it may offer a way to achieve the
desired result without impacting normal operation (even
search save/restore should continue to work as expected).
But for lookups it gets messier because the search is handled
by the keydatalink between the lookup dataset and the main
dataset (not by LookupCombo). LookupEnh has a work around for
this, but it requires additional changes to IBO that would
prevent the use of LookupCombo.
--
Geoff Worboys
Telesis Computing Pty Ltd
'Marcin Bury' marcin.bury@... [IBObjects] wrote:
> Hi Geoff
> Thank you for your suggestions.
> The sample with two edits is only for the purpose of this
> message ;-) Actually I need two IB_LookupEnh or IB_ComboEnh
> binded to the same DataField so an user could select one or
> two values for the search criteria. That's why I'm looking
> for some 'OR' solutions. I will take a closes look at
> OnProcessSearchBuffer event.
> Maybe Jason will add his 0.02$ ;-)
> Regards
> Marcin