Re: Extend a mixin class as a component?

2013-05-22 Thread George Ludwig
>>Have you tried implementing that as another mixin, say NiceAutcomplete,
subclassing from Autocomplete?

I considered that approach, however it seemed that I would need to modify
the autocomplete javascript in order to insert an element to contain the
greyed out text, which would then pose even more challenges with regard to
making sure it was all visually consistent when designers start adding CSS.
I'm doing my best to avoid re-writing the jQuery stuff, that's why I took
the approach of stacking text fields and wiring it together. However this
is proving to be yet another challenge as far as making it all behave
exactly the way it should.


On Wed, May 22, 2013 at 12:30 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 22 May 2013 15:57:29 -0300, George Ludwig 
> wrote:
>
>  @Thiago: The goal was not to apply a component as a mixin.
>>
>
> I'm sorry for misunderstanding you.
>
>
>  I'm working on a fancy AutocompleteTextfield class that acts like
>> Google's search text field, i.e. as you type, you get a greyed out
>> completion of the top result in the autocomplete list. If you open gmail
>> and type in to the
>> search field, you'll see exactly what I mean.
>>
>
> Interesting!
>
>
>  It works pretty good, but it still needs some tweaks, which is why I
>> asked the original question. It occurred to me that I may be able to
>> simplify the code if I could extend the existing Autocomplete mixin.
>> Perhpas it's a bad idea, but it was just a thought.
>>
>
> Have you tried implementing that as another mixin, say NiceAutcomplete,
> subclassing from Autocomplete?
>
>
>  BTW, I believe I have permission to release this component as open source
>> once it's completed, so any help would be much appreciated :)
>>
>
> Yay! :)
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Extend a mixin class as a component?

2013-05-22 Thread Thiago H de Paula Figueiredo
On Wed, 22 May 2013 15:57:29 -0300, George Ludwig   
wrote:



@Thiago: The goal was not to apply a component as a mixin.


I'm sorry for misunderstanding you.

I'm working on a fancy AutocompleteTextfield class that acts like  
Google's search text field, i.e. as you type, you get a greyed out  
completion of the top result in the autocomplete list. If you open gmail  
and type in to the

search field, you'll see exactly what I mean.


Interesting!

It works pretty good, but it still needs some tweaks, which is why I  
asked the original question. It occurred to me that I may be able to  
simplify the code if I could extend the existing Autocomplete mixin.  
Perhpas it's a bad idea, but it was just a thought.


Have you tried implementing that as another mixin, say NiceAutcomplete,  
subclassing from Autocomplete?



BTW, I believe I have permission to release this component as open source
once it's completed, so any help would be much appreciated :)


Yay! :)

--
Thiago H. de Paula Figueiredo

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



Re: Extend a mixin class as a component?

2013-05-22 Thread George Ludwig
@Thiago: The goal was not to apply a component as a mixin.

I'm working on a fancy AutocompleteTextfield class that acts like Google's
search text field, i.e. as you type, you get a greyed out completion of the
top result in the autocomplete list. If you open gmail and type in to the
search field, you'll see exactly what I mean.

I've got a working version that stacks 3 different text fields
together: one that defines the viewable area, one for the greyed out text,
and the last one is the actual text field that the user types in to...it's
this text field that currently uses the autocomplete mixin.

It works pretty good, but it still needs some tweaks, which is why I asked
the original question. It occurred to me that I may be able to simplify the
code if I could extend the existing Autocomplete mixin. Perhpas it's a bad
idea, but it was just a thought.

BTW, I believe I have permission to release this component as open source
once it's completed, so any help would be much appreciated :)



On Wed, May 22, 2013 at 5:28 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 21 May 2013 23:52:49 -0300, George Ludwig 
> wrote:
>
>  Why don't you create a component which uses the mixin instead of one that

>>> extends the mixin?
>>
>> Well, I've already got that component. I'd like to simplify it and have
>> better control over it, and am exploring my options. My thought would be
>> to subclass it and apply its behavior to a textfield within the subclassed
>> .tml
>>
>
> You cannot apply a component to another component like you can with
> mixins. Or I really didn't undertand what you described above, as what you
> describe, IMHO, doesn't need to involve a component subclassing a mixin,
> just mixin applied to a component.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Extend a mixin class as a component?

2013-05-22 Thread Thiago H de Paula Figueiredo
On Tue, 21 May 2013 23:52:49 -0300, George Ludwig   
wrote:


Why don't you create a component which uses the mixin instead of one  
that

extends the mixin?

Well, I've already got that component. I'd like to simplify it and have
better control over it, and am exploring my options. My thought would be  
to subclass it and apply its behavior to a textfield within the  
subclassed .tml


You cannot apply a component to another component like you can with  
mixins. Or I really didn't undertand what you described above, as what you  
describe, IMHO, doesn't need to involve a component subclassing a mixin,  
just mixin applied to a component.


--
Thiago H. de Paula Figueiredo

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



Re: Extend a mixin class as a component?

2013-05-22 Thread Lance Java
You can extend the mixin and then create a component which includes the
extended mixin.


Re: Extend a mixin class as a component?

2013-05-21 Thread George Ludwig
>>Why don't you create a component which uses the mixin instead of one that
extends the mixin?

Well, I've already got that component. I'd like to simplify it and have
better control over it, and am exploring my options. My thought would be to
subclass it and apply its behavior to a textfield within the subclassed .tml


Re: Extend a mixin class as a component?

2013-05-21 Thread Thiago H de Paula Figueiredo
As a general rule, I don't think that's a good idea. On the other hand,  
you can create a common superclass for both the mixin and the component  
and put it in the base package.


On Tue, 21 May 2013 20:18:56 -0300, George Ludwig   
wrote:



If I wanted to extend the Autocomplete mixin, can I extend it as a
component?

I.e., my new class would extend autocomplete, but it would be in the
components package.

Just wondering if this is good Tapestry form or not...


I guess it would work, but as a general rule we suggest to avoid  
inheritance. In this specific case I don't think it would work, as the  
mixin is written to be used applied to a text field, while a component is  
intended to be used standalone.


Why don't you create a component which uses the mixin instead of one that  
extends the mixin?


--
Thiago H. de Paula Figueiredo

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