close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Searches not clearing properly with new DataAssist

Thread began 5/16/2011 8:58 am by Justin@AdventDesign | Last modified 7/30/2014 7:42 am by Jason Byrnes | 2367 views | 5 replies |

Justin@AdventDesign

Searches not clearing properly with new DataAssist

Using the latest version of DataAssist for the first time and have a problem that I never ran into with the older version. When I do a search and get to the results page, the search functions properly. However, when I click back to a fresh copy of the results page (same page without the URL string search criteria), the page is still displaying the same previous search results rather than all records as it should.

I'm not sure where to go or how to troubleshoot. Anyone have suggestions?

Sign in to reply to this post

Jason ByrnesWebAssist

the search is stored in a session variable, this is done so that search results will be retained when using the paging controls.
the session will be name using the following naming convention:
WADbSearch1_<page_name>


so on Products_Results.php, the session would be named:
WADbSearch1_Products_Results


you can create a link to clear the results passing a query string variable:
<a href="Products_Results.php?clear=true">Clear Results</a>

then add the following code at line 1 of the results page:

php:
<?php

@session_start();
if(isset(
$_GET['clear']) && $_GET['clear'] == "true") {if(isset($_SESSION['WADbSearch1_Products_Results'])) unset($_SESSION['WADbSearch1_Products_Results']);}
?>
Sign in to reply to this post

Justin@AdventDesign

That did the trick. Thanks!

Worked perfectly.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Justin@AdventDesign

Show clear link only if search is in effect?

I'm still using this technique to clear search results. I'd like to hide the button to clear the search results and only show it if the user has actually searched (as this is the results page with data assist, most of the time users just click in to view the full recordset, in which case having a "clear search" button is unnecessary and confusing).

So would one go about constructing a 'show if session variable is set' in PHP?

Sign in to reply to this post

Jason ByrnesWebAssist

The code would look something like this:
<?php if(isset($_SESSION['sessionName']) && $_SESSION['sessionName'] != "") { ?>
clear search link
<?php } ?>

where sessionName is the name of the session to check.

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...