Home
The Toolkit for Online Communities
12892 Community Members, 1 member online
Log In Register

OpenACS BlogArchive

OpenACS Home : OpenACS Blog : Archive : 2006

How-To: Add an Autosuggest Text Field

Goal: Add an autosuggest textbox similar to Google's autosuggest.

Assumptions:

  1. You have installed the ajaxhelper package.
  2. You do not want to fetch the data everytime and just fetch it once.

This is somewhat similar to Ryan Gallimore's smart search widget. The differences are:

  • Doesn't hit the database everytime a key is pressed
  • Support for search term and description in the results like Google's autosuggest
  • Doesn't need an additional page for the ajaxupdater to load as it already supports query or list passing

Steps:

  1. For the input field, just create a textbox with id parameter set to "autosuggest_box" (current limitation). In ad_form you can do this like so:

    {tags:text,optional {html {size 50 id autosuggest_box}}....
  2. Generate the ajaxhelper source for autosuggest

    set ah_sources [ah::js_sources -source "autosuggest"]
  3. Generate the array for the suggest box. The first element will be the value for autosuggestion and the second one for the description.

    set query "select username, email from cc_users"
    set ah_suggestions_array [ah::generate_autosuggest_array -sql_query $sql_query]

    or
    set array_list {{apple red} {banana yellow} {orange orange}}
    set ah_suggestions_array [ah::generate_autosuggest_array -array_list $array_list]
  4. In the corresponding adp file, add in the following
    <property name="header_stuff">
    @ah_sources;noquote@
    <script type="text/javascript">
    @ah_suggestions_array;noquote@
    </script>
    </property>
  5. Call the loadAutoSuggest js proc on load

    window.onload=loadAutoSuggest();
  6. You should now be able to type into the textbox and fire up the autosuggest script.

Some nice things to do

  • integrate into ad_form so that one can just do "fieldname:text(autosuggest)"
  • allow to be used as the values param in listfilter widgets so that it would be easier to filter by typing rather than being presented with long select boxes

04:53 AM, 30 Oct 2006 by Deds Castillo Permalink | Comments (0)

large pg_dumps [openacs.org]

a way to create/handle big dumps (by Steve):

pg_dump yourdb | split -b 1024m - yourdb_

which will create 1Gb files called yourdb_aa, yourdb_ab, yourdb_ac etc.

Then you can import them using cat:

cat yourdb_* | psql yourdb

11:51 AM, 09 Mar 2006 by Rocael Hernández Rizzardini Permalink | Comments (0)

How I use dot Folio [www.timedeskblog.com]

I am using dotfolio to create user friendly point of entry to the toolkit. My index page is the startingpoint, and I provide my customers with their owm dotfolio, to further expand the functionality to their site.

The layout control is not yet perfect, but I just wanted to share this approach with you. I realise it's a dummies approach but It shows what you can do with the default toolkit, without digging into the code.

The current forced info fields need some tweaking, and the hard coded "portrait" title needs to be removed, but it's a start for most newbies. I guess.

Once you are satisfied with your dotfolio page, you go to the kernel in your admin pannel, and change use the redirect setting to change the url.

Cheers
Ben

04:37 PM, 24 Feb 2006 by Ben Koot Permalink | Comments (2)

How-To: Using the OpenACS Shell to access the OpenACS API

Goal: Use OpenACS Shell to access the OpenACS API

Assumptions:
1. Email is correctly configured on your server
2. OpenACS is configured to send email
3. You have installed OpenACS Developer Support (which includes the OpenACS shell) using the OpenACS Package Manager

OpenACS Developer Support (DS) is a set of tools that can help you develop your web applications, debug problems, test code, and explore the OpenACS API.

Take a look at the following procedure, which we will be using for this short exercise:

http://openacs.org/api-doc/proc-view?proc=acs%5fmail%5flite%3a%3asend

We are going to use this and DS to run a little tcl and execute the code.

Go to developer support on your website (standard location is /ds) and click on OpenACS Shell

Enter the following into the text area (change to and from addresses as needed):

acs_mail_lite::send -to_addr "your.email@address.com" -from_addr "oacs@your.website.org" -subject "The Sweet Taste of..." -body "Success!"

The web page should give you back an address in the Result section of the page that can be used programatically to respond to the email that you sent out and you should have an email in your inbox.

07:25 PM, 13 Feb 2006 by Carl Robert Blesius Permalink | Comments (0)

Startup Service

Great, you've managed to get your system up and running. Chances are you're considering what the next step should be. In that case, tell us what you are trying to create, and we'll help you get started.

04:29 PM, 13 Feb 2006 by Ben Koot Permalink | Comments (0)

End-users, please tell us how you would make OACS more user friendly.

Sometime small changes can have major implications. Features you may have been looking for could be deeply hidden in the admin functions of openacs. This blog is set up to try and get the most usefull features to the surface.

Tip 1:
Create one section with all links relevant to features and modules, and make it as simple as possible for the end user/admin to install them. From this discussion it seems that both developers and endusers have different perspectives in this respect. Solving this will help all 3 user groups.

What would you change? Please add your contribution by starting a new topic, and select the category "end-users". Please do not use the comment function for a new Tip, as that will not show up as an RSS update.

06:46 AM, 02 Jan 2006 by Ben Koot Permalink | Comments (0)

User contributions [cvs.openacs.org]

There are more packages & enhancements available form CVS. See also and in the file-storage.

03:18 PM, 01 Jan 2006 by Ben Koot Permalink | Comments (0)

XML

Archive

January 2006
S M T W T F S
1  2 
10  11  12  13  14 
15  16  17  18  19  20  21 
22  23  24  25  26  27  28 
29  30  31         
April 2007
March 2007
October 2006
March 2006
February 2006
January 2006
December 2005
November 2005
August 2005
July 2005
June 2005
May 2005

Notifications

You may request notification for OpenACS Blog.

Syndication Feed

XML

Recent Comments

  1. Silvio Ernesto: hola
  2. Martin v. Löwis: Cannot run pg_ctl from launchd
  3. Joan Miller: Something Interesting
  4. Hubert Erlmoser: trustpharma.com
  5. Hubert Erlmoser: TRUSTPHARMA
  6. Ben Koot: Selva
  7. LARRY SCOVEL: TRUST PHARMA
  8. Nick Carroll: Theme Selva
  9. Ben Koot: More enhancements
  10. Jane Perez: Trustpharma.com