You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Fermin Da Costa Gomez <da...@gmail.com> on 2009/10/16 00:12:40 UTC

T5: Removing empty valued columns from grid

Hi,

I'm looking for a piece of advice/suggestion on the best way to handle the
following.

Using Lucene i generate a searchResult list, in which each searchResult
entry contains a (Lucene)Document. These results wil be displayed in a grid.
Since i cannot determine beforehand which columns (read fields) i will be
receiving i put together my own model and conduit (as per example on the
list somewhere).
So far so good, i'm getting the results i'm looking for.

Final tweak concerns the elimination of the columns without any values.
Obviously this needs to be done prior to rendering but after the results
have been obtained.

My question is twofold:
1. Can i modify the grid model (excluding columns) after its initial
creation, and
2. If so, what would be the best place to do so?

Tia,

Fermin Da Costa Gomez

Re: T5: Removing empty valued columns from grid

Posted by Fermin Da Costa Gomez <da...@dcgconsultancy.nl>.
On Fri, Oct 16, 2009 at 7:31 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Fri, 16 Oct 2009 13:40:18 -0300, Fermin Da Costa Gomez <
> dacostagomez@dcgconsultancy.nl> escreveu:
>
>  Hmm, mucking about in the DOM is not what i'm looking forward to ..
>> I my assumption correct that once the grid building has started it
>> *is*actually doing the rendering as such?
>>
>
> I guess so. Makes sense to think that Grid expects to render exactly what
> it received (source and model).
>
So the rendering starts where, OnPrepare or onPrepareForRender .. ?


> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
“The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.”
- George Bernard Shaw (1856 - 1950)

Re: T5: Removing empty valued columns from grid

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 16 Oct 2009 13:40:18 -0300, Fermin Da Costa Gomez  
<da...@dcgconsultancy.nl> escreveu:

> Hmm, mucking about in the DOM is not what i'm looking forward to ..
> I my assumption correct that once the grid building has started it
> *is*actually doing the rendering as such?

I guess so. Makes sense to think that Grid expects to render exactly what  
it received (source and model).

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: T5: Removing empty valued columns from grid

Posted by Fermin Da Costa Gomez <da...@dcgconsultancy.nl>.
On Fri, Oct 16, 2009 at 1:22 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Thu, 15 Oct 2009 20:02:31 -0300, Fermin Da Costa Gomez <
> dacostagomez@dcgconsultancy.nl> escreveu:
>
>  Coming to think about it i have to rephrase my question to:
>> Is is possible to 'modify' the grid *after* the conduit has done its job,
>> ie. just prior to the actual rendering.
>>
>
> I guess not, but you can write a mixin to do that after the rendering,
> changing the generated DOM.

Hmm, mucking about in the DOM is not what i'm looking forward to ..
I my assumption correct that once the grid building has started it
*is*actually doing the rendering as such?


> We use "Obrigado desde já". :)
>
> I didn't know that acronym. I learned something new today. :P

Y'r welcome

Re: T5: Removing empty valued columns from grid

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 15 Oct 2009 20:02:31 -0300, Fermin Da Costa Gomez  
<da...@dcgconsultancy.nl> escreveu:

> Coming to think about it i have to rephrase my question to:
> Is is possible to 'modify' the grid *after* the conduit has done its job,
> ie. just prior to the actual rendering.

I guess not, but you can write a mixin to do that after the rendering,  
changing the generated DOM.

>> Tia = aunt in Portuguese. :P
> So what do you guys use for Thanx in Advance .. aunt? .. ;-)

We use "Obrigado desde já". :)

I didn't know that acronym. I learned something new today. :P

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: T5: Removing empty valued columns from grid

Posted by Fermin Da Costa Gomez <da...@dcgconsultancy.nl>.
>
> My question is twofold:
>> 1. Can i modify the grid model (excluding columns) after its initial
>> creation, and
>>
>
> Yes. Just use beanModel.exclude();

I was that far .. ;-)

 2. If so, what would be the best place to do so?
>

When I need to manipulate the BeanModel, I create a BeanModel getBeanModel()
> method in my page class and add t:model="beanModel" in my Grid.
>
This i did as well.
I can get to the the model, fields etc.

The issue/challenge is the fact that only the conduit "really knows" which
fields are empty but it does its job on a per cell basis, if i'm right.
I suppose i could have a look at making sure all fields are in their final
phase before going into the conduit, but
Coming to think about it i have to rephrase my question to:
Is is possible to 'modify' the grid *after* the conduit has done its job,
ie. just prior to the actual rendering.
If a columnwas created that contained unwanted entries this would be the
only point remove whole columns ... or?

Tia = aunt in Portuguese. :P
>
So what do you guys use for Thanx in Advance .. aunt? .. ;-)



Fermin Da Costa Gomez

-- 
“The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.”
- George Bernard Shaw (1856 - 1950)

Re: T5: Removing empty valued columns from grid

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 15 Oct 2009 19:12:40 -0300, Fermin Da Costa Gomez  
<da...@gmail.com> escreveu:

> Hi,

Olá! :)

> My question is twofold:
> 1. Can i modify the grid model (excluding columns) after its initial
> creation, and

Yes. Just use beanModel.exclude();

> 2. If so, what would be the best place to do so?

When I need to manipulate the BeanModel, I create a BeanModel  
getBeanModel() method in my page class and add t:model="beanModel" in my  
Grid.

> Tia,

Tia = aunt in Portuguese. :P

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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