You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andy Pahne <ap...@der-die-das.org> on 2006/11/08 20:22:05 UTC

need help with design of a component

Hi,

I am thinking about a component with a specific behaviour, but have no
idea how to implement it. I am using 4.1.1-SNAPSHOT.

I need to display a list of items. Most of the data about the items is
stored in a local relational database, but some other data about the
items is retrieved in a remote call that can take significantly longer
than retrieving items from the database.

My plan was:

  1. get data about items from database
  2. render the items inside a loop, with a placeholder
     for the data to be retrieved
  3. retrieve the data from the remote source
  4. onLoad of the page, asynch udate of the items,
     replacing the placeholders with the actual data


I think, that would work, but I don't know the items's component-ids as 
they are rendered inside a loop and I haven't assigned them explicitly. 
How could I update those components asynchronously without knowing their 
  id's?

Do you have any suggestions or a better solution for my problem?

Thanks,
Andy


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


Re: need help with design of a component

Posted by edward pedersson <cp...@googlemail.com>.
could you send some javascript with the data implying the id's e.g

<head>

<script language="javascript">

var idsToUpdate = [];

function addToIdsToUpdate(andId) {
 idsToUpdate.push(anId)
}

</script>
</head>

<div id="someData"> some data <div>

<script language="javascript">
addToIdsToUpdate("someData");
</script>

may not be what you are after though

On 08/11/06, Andy Pahne <ap...@der-die-das.org> wrote:
>
>
> Hi,
>
> I am thinking about a component with a specific behaviour, but have no
> idea how to implement it. I am using 4.1.1-SNAPSHOT.
>
> I need to display a list of items. Most of the data about the items is
> stored in a local relational database, but some other data about the
> items is retrieved in a remote call that can take significantly longer
> than retrieving items from the database.
>
> My plan was:
>
>   1. get data about items from database
>   2. render the items inside a loop, with a placeholder
>      for the data to be retrieved
>   3. retrieve the data from the remote source
>   4. onLoad of the page, asynch udate of the items,
>      replacing the placeholders with the actual data
>
>
> I think, that would work, but I don't know the items's component-ids as
> they are rendered inside a loop and I haven't assigned them explicitly.
> How could I update those components asynchronously without knowing their
>   id's?
>
> Do you have any suggestions or a better solution for my problem?
>
> Thanks,
> Andy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 


-- e