JimmyCrackedCorn
Posts: 583
|
| Posted: 02/27/2008, 6:33 PM |
|
OK. This has to be really simple and I'm just brain-dead this evening! :)
I have a table of locations, each of which is assigned one of four compass designators (NW, NE, SW and SE).
I create a search box with a Checkbox list and set the four compass options.
I create a grid to display the data.
When I tick ONE of the checkboxes, the correct set of records is displayed BUT, if I tick more than one of the checkboxes then no records are displayed.
Seems like this should be as easy as telling CCS to treat these checkboxes with an OR condition rather than an AND condition.
What am I missing?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
mrachow
Posts: 509
|
| Posted: 02/27/2008, 11:55 PM |
|
Havn't not used builders for a while.
But somewhere maybe "behind" a Details or Advanced button you can choose if the search expressions should be concatenated by OR or AND.
This is not a property of the search form so you can't change it later.
There are some settings you can select during the build process but which are not offered as properties of the form. (Some of them one would like to have for sure.)
_________________
Best regards,
Michael |
 |
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 02/28/2008, 12:49 AM |
|
I think I found what you are referring to in the Search Builder...
Advanced Search Options
* Create separate column fields and use AND condition
* Create a single search field and use OR condition
But neither option makes the checkbox work as an OR rather than an AND. It still returns no records if more than one checkbox is ticked.
_________________
Walter Kempees...you are dearly missed. |
 |
 |
wkempees
Posts: 1679
|
| Posted: 02/28/2008, 3:39 AM |
|
The desired search handling is not implemented out of the box.
Besides you are probably mixing up two problems here at the same time.
Are your checkboxes just 4 textboxes or are the 4 checkboxes in a multi-checkbox list scenario?
Besides the above question:
You need to have the resultgrid SQL DataSource adjusted to your needs.
In other words build you own handling (sounds harder than it is.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 02/28/2008, 3:48 AM |
|
A checkbox list with multi-check ability will only submit as a single checkbox.
Therefore you need to add some custom coding to identify the checked ones.
someting along the lines of:
$s_list = CCGetParam("s_checklist", "");
if (count($s_list) > 0 AND is_array($s_list)) {
foreach ($s_list as $key => $value) {
.........
}
Once you have identified the checked boxes, you need to adjust the WHERE clause in the ResultGrid.
If you have the Search/Grid build through the builder, without the checkboxes (or just one) AND have accepted the option to 'Create Single Searchfield/OR' you will already have a search that searches for 'KeyPhrases' not 'KeyWords' (The latter is posted by FEHA in Tips section recently).
So you ended up with a mutli-AND search in the ResultGrid's DataSource.
Now you probably already know what to do.
Analyse the checkboxes, and alter the WHERE accordingly in th appropriate _event.
Hope this helps.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 02/28/2008, 11:57 AM |
|
Thanks Walter. I'll try your suggestions later today. I'm surprised this isn't a standard option for CCS. Seems like a row of checkboxes for AND or OR would be a fairly common thing for developers to use.
_________________
Walter Kempees...you are dearly missed. |
 |
 |
wkempees
|
| Posted: 02/28/2008, 12:13 PM |
|
Correct, in one word.
"JimmyCrackedCorn" <JimmyCrackedCorn@forum.codecharge> schreef in bericht
news:247c71215b9e32@news.codecharge.com...
> Thanks Walter. I'll try your suggestions later today. I'm surprised this
> isn't a
> standard option for CCS. Seems like a row of checkboxes for AND or OR
> would be a
> fairly common thing for developers to use.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 02/29/2008, 4:20 AM |
|
OK. this ended up being an extremely simple solution involving no custom coding at all!
after a couple of back-and-forths with support, they remembered a simple way to do this. basically, in your Where condition, instead of using "like" use "IN"
works like a charm!
_________________
Walter Kempees...you are dearly missed. |
 |
 |
wkempees
|
| Posted: 02/29/2008, 11:22 AM |
|
Show me the 'simple' code!
Must be something like in (x, y, z)
"JimmyCrackedCorn" <JimmyCrackedCorn@forum.codecharge> schreef in bericht
news:247c7f89893fe1@news.codecharge.com...
> OK. this ended up being an extremely simple solution involving no custom
> coding
> at all!
>
> after a couple of back-and-forths with support, they remembered a simple
> way to
> do this. basically, in your Where condition, instead of using "like" use
> "IN"
>
> works like a charm!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |