this the last of it 4) In our embedding page class, News, we have an event handler to be notified of the selection by handling the "viewitem" event:
void onViewitem(long id) { this.currentItem = newsSource.getItemById(id); logger.info("got " + this.currentItem.getTitle()); } Now if you run this (I can pass along the project with a mock dao, no real db needed) you'll see that up through the last bit, where the page handles the event from the NewsQuote component, everything works perfectly. We catch the event in the page and grab the object. The problem is still how to deal with the T5-encouraged redirect and maintain that value in the page, so we can render the news item. That is, without using @Persist.... Still thinking on this - input welcome! chris Josh Canfield wrote: > Are you trying to keep the news id out of the url? Doesn't sound like > it from your response to not doing the redirect. Since that's the > case, why not add it to the page context? > > I suppose if you were building a portal with several components then > keeping track of component parameters could get unwieldy. If you were > showing a news article from the news portlet, and a stock highlight > from the stock portlet... At that point you're sort of building a > framework on a framework. > > You could build your page such that it accumulated context from it's > components. Push a ComponentContext object into the Environment > onActivate, and setupRender in your page (env gets cleared before > render phase, not sure if there is a better way than doing it in > both.) Then collect component parameter mappings. onPassivate for your > page would organize and return these as it's context (you might want > to sort them to get consistent results) > > Your url might look like this: > > http://localhost/context/mypage/cc/news/4527/stock/MCD > > Then onactivate you init the ComponentContext from the url keying off > the "cc" to grab the remaining parameters and use them as key/value > for the components. The your components do something like: > > @Environmental > private ComponentContext _compContext; > > void setupRender() { > Long newsId = _compContext.getLong(_resources.getId()); > } > > void onPickNewsItem(Long id) { > _compContext.put(_resources.getId(), id); > } > > > -- http://thegodcode.net --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]