You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Otho <ta...@googlemail.com> on 2009/02/14 11:23:25 UTC

Re: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Maybe some problem in the setup of the grid page?

Like forgetting the @Persist on the books list?

Otho

Re: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Posted by Marcus Veloso <mv...@gmail.com>.
Hi Howard,
> "In fact, if you look at the rendered URL you'll see that every time
> the Image component rendered, it rendered the same URL."

Yes, it's always the same image (the last one) in grid component.

> "The solution is to use event context to identify the book, or in some
> other way, identify where the data stream is supposed to come from."

Sorry, but i can't figured this out.
Perhaps you can elaborate the solution?

Here is the "relevant" code:
[
http://www.nabble.com/-T5.1--Using-a-custom-image-component-inside-a-Grid-td24421215s302.html]<http://www.nabble.com/-T5.1--Using-a-custom-image-component-inside-a-Grid-td24421215s302.html>

Regards,

Marcus Veloso

Re: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Posted by Howard Lewis Ship <hl...@gmail.com>.
It's very simple.

When the Grid component renders, it is keeping the book property up-to
date as the components in its body render.  Thus, if you look at the
rendered output, you'll see an <img> element and a URL that references
the component and the displayImage custom event.

Now what happens when that URL is triggered?

The Image component attempts to read the book property and
de-reference the binaryStream property.  Well, it was the Grid
components job to keep the book property up-to date *while it was
rendering*, but the Grid component isn't rendering in this new
request.

In fact, if you look at the rendered URL you'll see that every time
the Image component rendered, it rendered the same URL.  How is it
supposed to know from that which book's image to stream to the client?

The solution is to use event context to identify the book, or in some
other way, identify where the data stream is supposed to come from.

On Thu, Feb 19, 2009 at 8:05 AM, Iren Tuna <ir...@sphinx.at> wrote:
>
> If there are no other ideas, whether it should work or not (and why), the way
> I have done it, aside from the alternative solution hints, maybe I should
> try to create a bug issue in T5 jira. For me it is still not clear, why it
> does not work. Any other ideas?
>
> --
> iren
>
>
>
> Thiago H. de Paula Figueiredo wrote:
>>
>> On Sun, Feb 15, 2009 at 8:21 AM, Otho <ta...@googlemail.com> wrote:
>>> One possible solution is to store the images in the filesystem instead of
>>> the database and store only the filename in the db from where you can
>>> construct a path. But I think that isn't compatible with your
>>> requirements?
>>
>> Maybe a better solution would be to provide an Asset binding (like
>> context and classpath) and AssetFactory, both pulling the images from
>> the database.
>>
>> --
>> Thiago
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/-T5.0.18--Bug--%3A-Null-property-problem-with-the-custom-component-inside-a-grid-tp2324166p2353720.html
> Sent from the Tapestry Users 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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Posted by Iren Tuna <ir...@sphinx.at>.
If there are no other ideas, whether it should work or not (and why), the way
I have done it, aside from the alternative solution hints, maybe I should
try to create a bug issue in T5 jira. For me it is still not clear, why it
does not work. Any other ideas?

--
iren



Thiago H. de Paula Figueiredo wrote:
> 
> On Sun, Feb 15, 2009 at 8:21 AM, Otho <ta...@googlemail.com> wrote:
>> One possible solution is to store the images in the filesystem instead of
>> the database and store only the filename in the db from where you can
>> construct a path. But I think that isn't compatible with your
>> requirements?
> 
> Maybe a better solution would be to provide an Asset binding (like
> context and classpath) and AssetFactory, both pulling the images from
> the database.
> 
> -- 
> Thiago
> 
> 

-- 
View this message in context: http://n2.nabble.com/-T5.0.18--Bug--%3A-Null-property-problem-with-the-custom-component-inside-a-grid-tp2324166p2353720.html
Sent from the Tapestry Users 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: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, Feb 15, 2009 at 8:21 AM, Otho <ta...@googlemail.com> wrote:
> One possible solution is to store the images in the filesystem instead of
> the database and store only the filename in the db from where you can
> construct a path. But I think that isn't compatible with your requirements?

Maybe a better solution would be to provide an Asset binding (like
context and classpath) and AssetFactory, both pulling the images from
the database.

-- 
Thiago

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


Re: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Posted by Otho <ta...@googlemail.com>.
You are right.

I tried it out and came to the same result. The Image component works
everywhere except within a t:loop. It seems, that the PropertyConduitSource
is the reason for that. Is it possible, that one has to supply a custom
translator for byte[] ?

One possible solution is to store the images in the filesystem instead of
the database and store only the filename in the db from where you can
construct a path. But I think that isn't compatible with your requirements?

Otho

2009/2/14 Iren Tuna <ir...@sphinx.at>

>
> Hi,
>
> @Persist is already there on "books". Anyway, I have no problem with the
> listing of the search results. Only the images in the grid are not
> displayed, because of this "null property" problem. I have already tried
> @Persist on the "book" property (row object of the grid) in the Search
> page,
> too. In this case, the images are indeed displayed, but then in the image
> cells of all books only the image of the last book in the result list. I
> mean, if there are 3 books, three times the image of the last book, which
> is
> for me somehow comprehensible (not totally yet, though :-)).
>
> Thanks anyway for the reply.
> iren
>
>
>
>
> Otho wrote:
> >
> > Maybe some problem in the setup of the grid page?
> >
> > Like forgetting the @Persist on the books list?
> >
> > Otho
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/-T5.0.18--Bug--%3A-Null-property-problem-with-the-custom-component-inside-a-grid-tp2324166p2326447.html
> Sent from the Tapestry Users 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: [T5.0.18] Bug? : Null property problem with the custom component inside a grid

Posted by Iren Tuna <ir...@sphinx.at>.
Hi,

@Persist is already there on "books". Anyway, I have no problem with the
listing of the search results. Only the images in the grid are not
displayed, because of this "null property" problem. I have already tried
@Persist on the "book" property (row object of the grid) in the Search page,
too. In this case, the images are indeed displayed, but then in the image
cells of all books only the image of the last book in the result list. I
mean, if there are 3 books, three times the image of the last book, which is
for me somehow comprehensible (not totally yet, though :-)).

Thanks anyway for the reply.
iren




Otho wrote:
> 
> Maybe some problem in the setup of the grid page?
> 
> Like forgetting the @Persist on the books list?
> 
> Otho
> 
> 

-- 
View this message in context: http://n2.nabble.com/-T5.0.18--Bug--%3A-Null-property-problem-with-the-custom-component-inside-a-grid-tp2324166p2326447.html
Sent from the Tapestry Users 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