You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ron Piterman <rp...@gmx.net> on 2006/12/14 17:25:27 UTC

Re: IAutocompleteModel change

I think you get a List<Object[]> from hibernate?
you can change your model to extract object[0] as key, object[1] as 
value, and return the whole object for getForPrimaryKey( key ) - ( I 
think its another method signature- but the same meaning)...
Cheers,
Ron

Norbert Sándor wrote:
> Hello,
> 
> Unfortunatelly I've not followed the discussion about the subject.
> As the new doc says for IAutocompleteModel.getValues():
> 
>     * Expected to return a list of all possible values, filtering out 
> values that
>     * match the specified String in the <strong>label</strong> 
> representation of the value.
> 
> Sorry for the late reaction but I think the previous version was better. 
> I explain why.
> In my application I use Autocompleter to list Hibernate objects.
> Until this modification my query was:
> 
>    SELECT o.id,o.text FROM ... WHERE filter condition
> 
> but now I have to write
> 
>    SELECT o FROM ... WHERE filter condition
> 
> so the query must return full objects, it may require much more DB 
> bandwidth.
> I see that Autocompleter's implementation is now very clean
> 
>            key = model.getPrimaryKey(value);
>            label = model.getLabelFor(value);
> 
> but it may have negative performance impact in case of more complex 
> applications.
> 
> Sorry if I misunderstood something...
> 
> Regards:
> Norbi
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


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


Re: IAutocompleteModel change

Posted by Norbert Sándor <de...@erinors.com>.
Yes, in Hungary. Although it's not too late yet, I'm very tired :|

You're right, I will try it, but only tomorrow ;)

Regards:
Norbi

Ron Piterman írta:
> Norbert Sándor wrote:
>> Sorry, I don't fully understand...
>> If I understand the new API well, my query in the implementation of 
>> getValues() should return a list of full hibernate objects in my case.
>> I don't see how can I still query only the ID and the label - 
>> although today was a long day :)
>
> So your are also in europe?
>
> Currently, a list of objects is returned from the model, for each one 
> getPK and getLabel is called.
> It doesn't really mutter if the objects are the same as the value or not.
>
> The same getLabel and getPK are also called with the Value of the 
> Autocompleter, so you can still use a list of Object[] in your filter 
> method, but you habe to check beforehand what is given, the value 
> (entity) or an Object[]...
>
> Better?
> Cheers,
> Ron
>
>
>>
>> Regards:
>> Norbi
>>
>> Ron Piterman írta:
>>
>>> I think you get a List<Object[]> from hibernate?
>>> you can change your model to extract object[0] as key, object[1] as 
>>> value, and return the whole object for getForPrimaryKey( key ) - ( I 
>>> think its another method signature- but the same meaning)...
>>> Cheers,
>>> Ron
>>>
>>> Norbert Sándor wrote:
>>>
>>>> Hello,
>>>>
>>>> Unfortunatelly I've not followed the discussion about the subject.
>>>> As the new doc says for IAutocompleteModel.getValues():
>>>>
>>>>     * Expected to return a list of all possible values, filtering 
>>>> out values that
>>>>     * match the specified String in the <strong>label</strong> 
>>>> representation of the value.
>>>>
>>>> Sorry for the late reaction but I think the previous version was 
>>>> better. I explain why.
>>>> In my application I use Autocompleter to list Hibernate objects.
>>>> Until this modification my query was:
>>>>
>>>>    SELECT o.id,o.text FROM ... WHERE filter condition
>>>>
>>>> but now I have to write
>>>>
>>>>    SELECT o FROM ... WHERE filter condition
>>>>
>>>> so the query must return full objects, it may require much more DB 
>>>> bandwidth.
>>>> I see that Autocompleter's implementation is now very clean
>>>>
>>>>            key = model.getPrimaryKey(value);
>>>>            label = model.getLabelFor(value);
>>>>
>>>> but it may have negative performance impact in case of more complex 
>>>> applications.
>>>>
>>>> Sorry if I misunderstood something...
>>>>
>>>> Regards:
>>>> Norbi
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>

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


Re: IAutocompleteModel change

Posted by Ron Piterman <rp...@gmx.net>.
Norbert Sándor wrote:
> Sorry, I don't fully understand...
> If I understand the new API well, my query in the implementation of 
> getValues() should return a list of full hibernate objects in my case.
> I don't see how can I still query only the ID and the label - although 
> today was a long day :)

So your are also in europe?

Currently, a list of objects is returned from the model, for each one 
getPK and getLabel is called.
It doesn't really mutter if the objects are the same as the value or not.

The same getLabel and getPK are also called with the Value of the 
Autocompleter, so you can still use a list of Object[] in your filter 
method, but you habe to check beforehand what is given, the value 
(entity) or an Object[]...

Better?
Cheers,
Ron


> 
> Regards:
> Norbi
> 
> Ron Piterman írta:
> 
>> I think you get a List<Object[]> from hibernate?
>> you can change your model to extract object[0] as key, object[1] as 
>> value, and return the whole object for getForPrimaryKey( key ) - ( I 
>> think its another method signature- but the same meaning)...
>> Cheers,
>> Ron
>>
>> Norbert Sándor wrote:
>>
>>> Hello,
>>>
>>> Unfortunatelly I've not followed the discussion about the subject.
>>> As the new doc says for IAutocompleteModel.getValues():
>>>
>>>     * Expected to return a list of all possible values, filtering out 
>>> values that
>>>     * match the specified String in the <strong>label</strong> 
>>> representation of the value.
>>>
>>> Sorry for the late reaction but I think the previous version was 
>>> better. I explain why.
>>> In my application I use Autocompleter to list Hibernate objects.
>>> Until this modification my query was:
>>>
>>>    SELECT o.id,o.text FROM ... WHERE filter condition
>>>
>>> but now I have to write
>>>
>>>    SELECT o FROM ... WHERE filter condition
>>>
>>> so the query must return full objects, it may require much more DB 
>>> bandwidth.
>>> I see that Autocompleter's implementation is now very clean
>>>
>>>            key = model.getPrimaryKey(value);
>>>            label = model.getLabelFor(value);
>>>
>>> but it may have negative performance impact in case of more complex 
>>> applications.
>>>
>>> Sorry if I misunderstood something...
>>>
>>> Regards:
>>> Norbi
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


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


Re: IAutocompleteModel change

Posted by Norbert Sándor <de...@erinors.com>.
Sorry, I don't fully understand...
If I understand the new API well, my query in the implementation of 
getValues() should return a list of full hibernate objects in my case.
I don't see how can I still query only the ID and the label - although 
today was a long day :)

Regards:
Norbi

Ron Piterman írta:
> I think you get a List<Object[]> from hibernate?
> you can change your model to extract object[0] as key, object[1] as 
> value, and return the whole object for getForPrimaryKey( key ) - ( I 
> think its another method signature- but the same meaning)...
> Cheers,
> Ron
>
> Norbert Sándor wrote:
>> Hello,
>>
>> Unfortunatelly I've not followed the discussion about the subject.
>> As the new doc says for IAutocompleteModel.getValues():
>>
>>     * Expected to return a list of all possible values, filtering out 
>> values that
>>     * match the specified String in the <strong>label</strong> 
>> representation of the value.
>>
>> Sorry for the late reaction but I think the previous version was 
>> better. I explain why.
>> In my application I use Autocompleter to list Hibernate objects.
>> Until this modification my query was:
>>
>>    SELECT o.id,o.text FROM ... WHERE filter condition
>>
>> but now I have to write
>>
>>    SELECT o FROM ... WHERE filter condition
>>
>> so the query must return full objects, it may require much more DB 
>> bandwidth.
>> I see that Autocompleter's implementation is now very clean
>>
>>            key = model.getPrimaryKey(value);
>>            label = model.getLabelFor(value);
>>
>> but it may have negative performance impact in case of more complex 
>> applications.
>>
>> Sorry if I misunderstood something...
>>
>> Regards:
>> Norbi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>

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