You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Donarus <pa...@gmail.com> on 2010/06/08 17:39:00 UTC

How to enable suggestions when entering the input field

Hi, 
  this is example part of code of my autocomplete textfield (im using T
5.1.0.5)

JAVA PART:
List<String> onProvideCompletionsFromNaseptavacValue(String partial) {
   List<String> matches = new ArrayList<String>();
   matches.add("match1");
   matches.add("match2");
   matches.add("match3");
   return matches;
}

TML PART:
<form t:type="form" t:id="naseptavacForm" t:zone="vybranoZone">
   <input t:id="naseptavacValue" t:type="TextField"
t:mixins="lastautocomplete"/>
   <input type="submit" value="odeslat" />
</form>

I need to make autocomplete textfield, but i need functionality, that when
user activate blank textfield (eg. he click into textfield), suggestions
will be showed (I dont want to wait for starting typing any text).

I know, that there is t:minChars property (default = 1), but when i change
it to 0, it does nothing. Is there aby possible easy way, how to solve
this?(how to fire event for showing possible suggestions immediatelly when
user clicks inside textfield)?

Im sorry for my English.

Donarus


-- 
View this message in context: http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28819610.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to enable suggestions when entering the input field

Posted by Donarus <pa...@gmail.com>.

Pablo dos Reis wrote:
> 
> Use the Select and not a AutoComplete.
> Thanks for reply, 
  but that is not a solution for me. I can't use select box.

This was only example, but my real application will do more... If input will
be some string, which is not in suggestions, it will search it in DB, but
when string will be equal with some suggestion, then my component will do
something else ... So I have to use textfield with autocomplete function. 
-- 
View this message in context: http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28824025.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to enable suggestions when entering the input field

Posted by Pablo dos Reis <pa...@gmail.com>.
Use the Select and not a AutoComplete.



2010/6/8 Donarus <pa...@gmail.com>

>
> Hi,
>  this is example part of code of my autocomplete textfield (im using T
> 5.1.0.5)
>
> JAVA PART:
> List<String> onProvideCompletionsFromNaseptavacValue(String partial) {
>   List<String> matches = new ArrayList<String>();
>   matches.add("match1");
>   matches.add("match2");
>   matches.add("match3");
>   return matches;
> }
>
> TML PART:
> <form t:type="form" t:id="naseptavacForm" t:zone="vybranoZone">
>   <input t:id="naseptavacValue" t:type="TextField"
> t:mixins="lastautocomplete"/>
>   <input type="submit" value="odeslat" />
> </form>
>
> I need to make autocomplete textfield, but i need functionality, that when
> user activate blank textfield (eg. he click into textfield), suggestions
> will be showed (I dont want to wait for starting typing any text).
>
> I know, that there is t:minChars property (default = 1), but when i change
> it to 0, it does nothing. Is there aby possible easy way, how to solve
> this?(how to fire event for showing possible suggestions immediatelly when
> user clicks inside textfield)?
>
> Im sorry for my English.
>
> Donarus
>
>
> --
> View this message in context:
> http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28819610.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Pablo Henrique dos Reis

Re: How to enable suggestions when entering the input field

Posted by Inge Solvoll <in...@gmail.com>.
Excellent :)

Good to know in case someone needs to do this later some time.

Inge

On Thu, Jun 10, 2010 at 4:17 PM, Donarus <pa...@gmail.com> wrote:

>
> Hi again,
>   so I tried to construct solution in way, you mentioned.
> Here is my solution.
>
>
>
> Event.observe(autoCompleterTextFieldElementIdPasteHere, 'focus',
> function(event) {
>   $T(autoCompleterTextFieldElementIdPasteHere).autocompleter.activate();
> });
>
>
> This is working as I want .. So THX very much !!!
> Dnrs
>
>
>
>
>
> Inge Solvoll-2 wrote:
> >
> > I checked the scriptaculous docs, looking for a way to manually trigger a
> > server roundtrip. If such a function were available and documented (it is
> > not), you could do this:
> >
> > autoCompleterTextField.observe('focus', function(event) {
> >
> >
> $T('autoCompleterTextField').autoCompleter.goGetSomeAutoCompletionsRightNow();
> >
> > });
> >
> > If you check the sources, you might find out that this is actually
> > possible.
> > I don't know.
> >
> >
> >
> > On Wed, Jun 9, 2010 at 11:54 AM, Donarus <pa...@gmail.com> wrote:
> >
> >>
> >> Hi and thanks for your reply!
> >>
> >>  I haven't time at the moment for trying this, but think, that it is
> >> possible way how to resolve my problem. So thanks for that link - I will
> >> try
> >> it as soon as possible and let you know..
> >>
> >> Dnrs
> >>
> >>
> >>
> >>
> >> Josh Canfield wrote:
> >> >
> >> > The autocomplete mixin is based on Scriptaculous's autocompleter.
> >> >
> >> > See if this helps:
> >> >
> >>
> http://blog.ilexius.de/blog-post/2010/02/05/activate-autocompleter-in-scriptaculous-when-entering-a-field-on-focus/
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28828142.html
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28843722.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: How to enable suggestions when entering the input field

Posted by Donarus <pa...@gmail.com>.
Hi again,
   so I tried to construct solution in way, you mentioned. 
Here is my solution. 



Event.observe(autoCompleterTextFieldElementIdPasteHere, 'focus',
function(event) {
   $T(autoCompleterTextFieldElementIdPasteHere).autocompleter.activate();
});


This is working as I want .. So THX very much !!!
Dnrs





Inge Solvoll-2 wrote:
> 
> I checked the scriptaculous docs, looking for a way to manually trigger a
> server roundtrip. If such a function were available and documented (it is
> not), you could do this:
> 
> autoCompleterTextField.observe('focus', function(event) {
> 
> $T('autoCompleterTextField').autoCompleter.goGetSomeAutoCompletionsRightNow();
> 
> });
> 
> If you check the sources, you might find out that this is actually
> possible.
> I don't know.
> 
> 
> 
> On Wed, Jun 9, 2010 at 11:54 AM, Donarus <pa...@gmail.com> wrote:
> 
>>
>> Hi and thanks for your reply!
>>
>>  I haven't time at the moment for trying this, but think, that it is
>> possible way how to resolve my problem. So thanks for that link - I will
>> try
>> it as soon as possible and let you know..
>>
>> Dnrs
>>
>>
>>
>>
>> Josh Canfield wrote:
>> >
>> > The autocomplete mixin is based on Scriptaculous's autocompleter.
>> >
>> > See if this helps:
>> >
>> http://blog.ilexius.de/blog-post/2010/02/05/activate-autocompleter-in-scriptaculous-when-entering-a-field-on-focus/
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28828142.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28843722.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: enhanced grid component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 10 Jun 2010 08:03:30 -0300, Kiss Izolda <iz...@freemail.hu> wrote:

> Dear Tapestry Users,

Hi!

> The header of the org.apache.tapestry5.corelib.components.Grid component  
> is not suitable for the Client.
> The title should be aligned to left and the short icon to right...

Take a look at the generated HTML using Firebug. You'll notice that you  
can use CSS to override the default styles.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


enhanced grid component

Posted by Kiss Izolda <iz...@freemail.hu>.
Dear Tapestry Users,

The header of the org.apache.tapestry5.corelib.components.Grid component is not suitable for the Client.
The title should be aligned to left and the short icon to right...
I would like to avoide overriding the header for each column.
Could anybody advice me some enhanced grid component?

Thank you in advance,

Izolda


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to enable suggestions when entering the input field

Posted by Inge Solvoll <in...@gmail.com>.
I checked the scriptaculous docs, looking for a way to manually trigger a
server roundtrip. If such a function were available and documented (it is
not), you could do this:

autoCompleterTextField.observe('focus', function(event) {

$T('autoCompleterTextField').autoCompleter.goGetSomeAutoCompletionsRightNow();

});

If you check the sources, you might find out that this is actually possible.
I don't know.



On Wed, Jun 9, 2010 at 11:54 AM, Donarus <pa...@gmail.com> wrote:

>
> Hi and thanks for your reply!
>
>  I haven't time at the moment for trying this, but think, that it is
> possible way how to resolve my problem. So thanks for that link - I will
> try
> it as soon as possible and let you know..
>
> Dnrs
>
>
>
>
> Josh Canfield wrote:
> >
> > The autocomplete mixin is based on Scriptaculous's autocompleter.
> >
> > See if this helps:
> >
> http://blog.ilexius.de/blog-post/2010/02/05/activate-autocompleter-in-scriptaculous-when-entering-a-field-on-focus/
> >
>
> --
> View this message in context:
> http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28828142.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: How to enable suggestions when entering the input field

Posted by Donarus <pa...@gmail.com>.
Hi and thanks for your reply!

  I haven't time at the moment for trying this, but think, that it is
possible way how to resolve my problem. So thanks for that link - I will try
it as soon as possible and let you know.. 

Dnrs




Josh Canfield wrote:
> 
> The autocomplete mixin is based on Scriptaculous's autocompleter.
> 
> See if this helps:
> http://blog.ilexius.de/blog-post/2010/02/05/activate-autocompleter-in-scriptaculous-when-entering-a-field-on-focus/
> 

-- 
View this message in context: http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28828142.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to enable suggestions when entering the input field

Posted by Josh Canfield <jo...@gmail.com>.
The autocomplete mixin is based on Scriptaculous's autocompleter.

See if this helps:
http://blog.ilexius.de/blog-post/2010/02/05/activate-autocompleter-in-scriptaculous-when-entering-a-field-on-focus/

Josh

On Tue, Jun 8, 2010 at 8:39 AM, Donarus <pa...@gmail.com> wrote:
>
> Hi,
>  this is example part of code of my autocomplete textfield (im using T
> 5.1.0.5)
>
> JAVA PART:
> List<String> onProvideCompletionsFromNaseptavacValue(String partial) {
>   List<String> matches = new ArrayList<String>();
>   matches.add("match1");
>   matches.add("match2");
>   matches.add("match3");
>   return matches;
> }
>
> TML PART:
> <form t:type="form" t:id="naseptavacForm" t:zone="vybranoZone">
>   <input t:id="naseptavacValue" t:type="TextField"
> t:mixins="lastautocomplete"/>
>   <input type="submit" value="odeslat" />
> </form>
>
> I need to make autocomplete textfield, but i need functionality, that when
> user activate blank textfield (eg. he click into textfield), suggestions
> will be showed (I dont want to wait for starting typing any text).
>
> I know, that there is t:minChars property (default = 1), but when i change
> it to 0, it does nothing. Is there aby possible easy way, how to solve
> this?(how to fire event for showing possible suggestions immediatelly when
> user clicks inside textfield)?
>
> Im sorry for my English.
>
> Donarus
>
>
> --
> View this message in context: http://old.nabble.com/How-to-enable-suggestions-when-entering-the-input-field-tp28819610p28819610.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org