Auto-complete with LiveUpdate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Auto-complete with LiveUpdate

anthony lander
Hi List,

Is it possible to do an auto-complete dropdown on a text entry field
using LiveUpdate?

Thanks,

   -Anthony

--
PGP key at http://anthony.etherealplanet.org
3FF8 6319 CADA 2D21 03BB 175F 3382 822A 502F AE80

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Auto-complete with LiveUpdate

Philippe Marschall
> Is it possible to do an auto-complete dropdown on a text entry field
> using LiveUpdate?

IIRC you need Scriptaculous for that.

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Auto-complete with LiveUpdate

Lukas Renggli
On 2/21/06, Philippe Marschall <[hidden email]> wrote:
> > Is it possible to do an auto-complete dropdown on a text entry field
> > using LiveUpdate?
>
> IIRC you need Scriptaculous for that.

There is an example in SUExample.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Auto-complete with LiveUpdate

anthony lander
On Tuesday 21 February 2006 02:18, Lukas Renggli wrote:
> > > Is it possible to do an auto-complete dropdown on a text entry field
> > > using LiveUpdate?
> >
> > IIRC you need Scriptaculous for that.
>
> There is an example in SUExample.

Thanks for the pointers, Lukas and Philippe.

I'm using Michel Bany's VW port, and I don't think it includes the SU
components yet.

Michel, is there anything I can do to help? ...or would it be nicer to add
that feature to LiveUpdate? (I'll volunteer to take a stab at it)

Thanks,

 -Anthony

--
PGP key at http://anthony.etherealplanet.org
3FF8 6319 CADA 2D21 03BB 175F 3382 822A 502F AE80
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Auto-complete with LiveUpdate

Michel Bany-3

>I'm using Michel Bany's VW port, and I don't think it includes the SU
>components yet.
>
>Michel, is there anything I can do to help? ...or would it be nicer to add
>that feature to LiveUpdate? (I'll volunteer to take a stab at it)
>
>  
>
Hi Anthony,

As far as I know Scriptaculous has not been ported to VW. It's on my
list with some other things.

On the other hand, I believe that auto-completion is feasible with the
latest version of  SeasideAsync,
i.e. no new javascript needed :-). See the public repository and make
sure you are also using the latest
version of SeasideForWebtoolkit. I am attaching something that you may
want to use to get started.

Best luck,
Michel.


<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks®, 7.4 of lundi 5 décembre 2005 on mercredi 22 février 2006 at 22:45:41</time-stamp>


<class>
<name>AutoCompleteDemo</name>
<environment>Smalltalk</environment>
<super>Seaside.WAComponent</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>val selectedVal </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>My Classes</category>
<attributes>
<package>(none)</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>AutoCompleteDemo class</class-id> <category>initialize-release</category>

<body package="(none)" selector="initialize">initialize
        self registerAsApplication: 'Auto-Complete'</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>AutoCompleteDemo</class-id> <category>rendering</category>

<body package="(none)" selector="namelist">namelist
        ^#(#Jefferson #Jeffrey #Jeremy #Jerry #John #Josuah)</body>

<body package="(none)" selector="renderAutoCompleteOn:">renderAutoCompleteOn: html
        | selection |
        html divNamed: #autoc
                with:
                        [(val isEmptyOrNil not and: [selectedVal isNil])
                                ifTrue:
                                        [selection := self namelist
                                                                detect: [:ea | (ea copyFrom: 1 to: (val size min: ea size)) asUppercase = val asUppercase]
                                                                ifNone: [nil].
                                        html attributes size: 3.
                                        html
                                                selectFromList: self namelist
                                                selected: selection
                                                callback: [:v | val := v]
                                                labels: [:ea | ea]
                                                liveCallback:
                                                        [:v :h |
                                                        val := v.
                                                        selectedVal := val.
                                                        self renderTextFieldOn: h]]]</body>

<body package="(none)" selector="renderContentOn:">renderContentOn: html
        html form: [self renderTextFieldOn: html]</body>

<body package="(none)" selector="renderTextFieldOn:">renderTextFieldOn: html
        html divNamed: #input
                with:
                        [html
                                textInputWithValue: val
                                callback: [:v | val := v]
                                liveCallback:
                                        [:v :h |
                                        val := v.
                                        selectedVal := nil.
                                        self renderAutoCompleteOn: h]].
        self renderAutoCompleteOn: html</body>
</methods>

<initialize>
<class-id>AutoCompleteDemo</class-id>
</initialize>

</st-source>

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Auto-complete with LiveUpdate

anthony lander
Thanks Michel,

I'll give it a try and let you know how it goes. Thanks also for the very
clever code example :)

  -Anthony

On Wednesday 22 February 2006 16:48, Michel Bany wrote:

> >I'm using Michel Bany's VW port, and I don't think it includes the SU
> >components yet.
> >
> >Michel, is there anything I can do to help? ...or would it be nicer to add
> >that feature to LiveUpdate? (I'll volunteer to take a stab at it)
>
> Hi Anthony,
>
> As far as I know Scriptaculous has not been ported to VW. It's on my
> list with some other things.
>
> On the other hand, I believe that auto-completion is feasible with the
> latest version of  SeasideAsync,
> i.e. no new javascript needed :-). See the public repository and make
> sure you are also using the latest
> version of SeasideForWebtoolkit. I am attaching something that you may
> want to use to get started.
>
> Best luck,
> Michel.

--
PGP key at http://anthony.etherealplanet.org
3FF8 6319 CADA 2D21 03BB 175F 3382 822A 502F AE80
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside