close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DataAssist & Search functionality

Thread began 5/19/2009 3:05 pm by fragop363190 | Last modified 5/22/2009 7:25 am by fragop363190 | 2127 views | 8 replies |

fragop363190

DataAssist & Search functionality

Ok i got a public page that i have created using DataAssist and Public template with single record per row usage. I also checked search on page.

Everything created fine.

In my search box i got 2 search paramets.

Now i run into this problem probably easy to resolve. This page has to be filtered to produce specific records using $_GET requests.

im geting to this page by a URL like results.php?subCat=x where x is a number.

That is why i filtered the recordset generated by DataAssist with a WHERE clause and a parameter in order to filter by the subCat value.

Everything ok till i press the search button... It passes to the recordset only the 2 values from the search and cause i got my own WHERE clause in the primary recordset and no subCat value is passed i dont see anything in page.

I tried adding to append to the form code action="results.php?subCat=<?php $_GET['subCat'] so it keeps from primary link the subCat thing and repost it on submit of form (search button) but it doesnt append the subCat=x just goes to results.php and appends the filters of the search box (the 2 ones refered above).

I also tried inserting a 3rd HIDDEN parameter in the search box by using the server behavior, gave it to take that $_GET thing from above so it filters my recordset and submit form correctly.

if i do that i need to take out my filter from the where clause but then...at the begining wihtout pressing the search button all records will be shown and i want them filtered from start. Just want to add 2 more search choices availalbe to public and ofc always filterd by what id i pass it.

I can not make it work correctly.
Need some help/propositions here.

Sign in to reply to this post

Ray BorduinWebAssist

Instead of adding the WHERE clause in the recordset, add it as the default where clause in the DataAssist Search server behavior and leave the recordset without a where clause. I think that will give you the result that you want.

Sign in to reply to this post

fragop363190

Ok this works.

I added default where clause but had to manualy fix it in code

"$WADbSearch1_DefaultWhere = "idsct_cmp = ".$_GET["S_idsct_cmp"];"

because i need to get the parameter also from the get (initial filtering without user interactin). But if i put the .$_GET["S_idsct_cmp"] the behavior stops showing on the DWCS4 panel. Minor problem but still its a small bug. I supposse DWCS4 wants some stuff in specific ways so probably need to work it as DW parameters code and then use it in there but im not a DW code expert your tech guys should know why and how to fix it to a next release.

But ... there is a problem with INCLUDE in search engine. I got a column named name_suf and im using a text field(edit in search behavior) using the "INCLUDE" option to search in it.

It just doesn't work. I even fixed a FULL-TEXT index in my db on that column in case it is required.

example : search function passes the above line

?S_municipality_cmp=&S_idsct_cmp=28&S_name_cmp=pk

S_name_cmp is the field/attribute that gets the users input from the text box. Here the user typed "pk" and the search engine should search in my table the appropriate column for the text "pk" inside it. i don't know what it does but it is not working.

Here is the code on top at php portion

$WADbSearch1->addComparisonFromEdit("name_cmp","S_name_cmp","AND","Includes",0);

so it should be passed ok in the search.

Need it to work asap please.

Sign in to reply to this post

fragop363190

Ok fixed it using a hidden field and the Default Where as yyou said, it worked like a charm.

But Include of text field isnt working. It doesn't filter records based on the partial name of the companies. as i said, i even added a FULL-TEXT index to that column.

Please advise maybe im doing sth wrong.

Sign in to reply to this post

Ray BorduinWebAssist

What trigger are you using? Is it filtering it at all?

Try writing the resulting where clause to the page and see if you can spot what is wrong with it.... should be something like: WADbSearch1->WhereClause

Sign in to reply to this post

fragop363190

Yes there is code for it. And in general the search functionality for the Dynamic Menu and for the hidden field wok fine. Only the text/edit box which is pointed as INCLUDE isnt filtering the records. The other 2 are pointed as "=" and filter fine.
Here is the code you requested...

if (1 == 1) {
$_SESSION["WADbSearch1_companies_Public_Results"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_companies_Public_Results"]) && $_SESSION["WADbSearch1_companies_Public_Results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_companies_Public_Results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';

Sign in to reply to this post

fragop363190

Include Search Functinality not working. Please advise.

Sign in to reply to this post

Ray BorduinWebAssist

What is the trigger you are using for the search?

Sign in to reply to this post

fragop363190

Attaching page in support ticket.

Include is not working. All created with wizzard.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...