[Scriptaculous] Problem with Autocompleter

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

[Scriptaculous] Problem with Autocompleter

PETIT Thomas
Hello,

I've got a problem with the SUAutocompleterTest class:
when I clik on one of the name given by the scrolling list, the content of the
InputText is well displayed but the variable 'text' is not refreshed.

What can I do in order to refresh it ?

Thanks a lot :-)

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

Re: [Scriptaculous] Problem with Autocompleter

Lukas Renggli
> I've got a problem with the SUAutocompleterTest class:
> when I clik on one of the name given by the scrolling list, the content of the
> InputText is well displayed but the variable 'text' is not refreshed.
>
> What can I do in order to refresh it ?

The auto-completer only sets the value within the input-field, it does
not know how to serialize the input-field itself. There are two
missing events for the auto-completer (onShow:, onHide:) that can be
used to fix the issue. I will commit the fixed test soon, but first I
have to clean up some experimental changes in my image ;-)

html textInput
        id: 'text';
        value: text;
        callback: [ :value | text := value ];
        script: ((html autocomplete: 'name')
                on: #renderListOn: of: self;
                onHide: (html request
                        triggerFormElement: 'text';
                        after: (html effect id: 'name'; fade))).

Cheers,
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: [Scriptaculous] Problem with Autocompleter

PETIT Thomas
> The auto-completer only sets the value within the input-field, it
> does not know how to serialize the input-field itself. There are two
> missing events for the auto-completer (onShow:, onHide:) that can be
> used to fix the issue. I will commit the fixed test soon, but first
> I have to clean up some experimental changes in my image ;-)
>
> html textInput
> id: 'text';
> value: text;
> callback: [ :value | text := value ];
> script: ((html autocomplete: 'name')
> on: #renderListOn: of: self;
> onHide: (html request
> triggerFormElement: 'text';
> after: (html effect id: 'name'; fade))).
>
> Cheers,
> Lukas

Hello,

First of all, thanks for your answer... but it still doesn't work :'(
When I add the 'onHide' event, the list appears but fades so fast that no
click is possible.

PETIT Thomas


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

popup questions: used it and if yes, how to?

Giorgio Ferraris
Hi all,

Afetr one week of seaside usage, and getting results really encouraging, I
have some question about popup.
For what I can see of the documentation I foud on the net, it seems that on
seaside you don't use popup window. Is this my wrong understanding or is
this true? And if it's true, can you explain me why? Religion or there is no
need of popup?  I'm trying to adapt to general usage, if possible.

I have right now some question related to popup.

-Popup date chooser: I like a popup date choser more that the way done using
the widgets in seaside. Someone else use popup date chooser? There is a
suggested way for integratimg popup on seaside, and there is some code
available, or I should not use it, and then, wich way you present a chooser?

-I like to use popup for allowing user select thing (for example, I'm
editing an order, I should enter the customer, so I display a popup with a
query form for customer data, then I show a list of customer satisfying the
query and then I give back the result to my calling form) Is this something
you do, or you do the same thing just using call:? (a more flat feel..)

-The second question start another question: there is a way in seaside to
read some query parameter? I found info about REST urls, but I haven't found
the way to reading back the query parameter. I'm working on VisualWorks, at
the moment, and there I can use some internal feature of the web frameworks,
but this will not be portable to squeak. Why I need this? Becouse in my
question number 2, I want to use a seaside application inside my popup, but
I need to configure the application (a general query and list chooser) to
know wich class query for, and query parameter are the only things I suppose
I can use.


Thanks for any answer (hope my english his understandable...)

Giorgio Ferraris


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

Re: popup questions: used it and if yes, how to?

Ragnar Hojland Espinosa-2
On 4/8/06, Giorgio Ferraris <[hidden email]> wrote:
> -I like to use popup for allowing user select thing (for example, I'm
> editing an order, I should enter the customer, so I display a popup with a
> query form for customer data, then I show a list of customer satisfying the
> query and then I give back the result to my calling form) Is this something
> you do, or you do the same thing just using call:? (a more flat feel..)

I used a calendar popup to fill out date fields. Worked fine, although
I have my doubts about it being faster than a smart date field,
specially when it's in the middle of a form.

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

Re: [Scriptaculous] Problem with Autocompleter

Lukas Renggli
In reply to this post by PETIT Thomas
> First of all, thanks for your answer... but it still doesn't work :'(
> When I add the 'onHide' event, the list appears but fades so fast that no
> click is possible.

This is strange, because it works for me.

However there is one major problem I didn't thought of: #onHide: and
#onShow: are (internal) callback-events used to display and hide the
completion-list. The original intention of their existence is to be
able to use a different effect to show and hide the completion-list,
not to do other things such as to serialize the input-field.

So probably we should go a different path (as usual, there are
different ways to do more or less the same thing):

- Add an #onBlur: event to the text-input that serializes the
text-field as soon as the input box looses its focus.

- Add a submit-button (or a default form action, if you don't want a
button) to submit the data, either transparently trough an AJAX
request or using a normal form callback.

I published Scriptaculous.60-lr.mcz to SqueakSource that reverts to
the original code and adds an #onBlur: event. Depending on your exact
requirements you might want to try my other suggestion.

html textInput
        id: 'text';
        value: text;
        callback: [ :value | text := value ];
        onBlur: (html request
                triggerFormElement: 'text');
        script: ((html autocomplete: 'name')
                on: #renderListOn: of: self).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside