You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Audrius Peseckis <au...@ivs.lt> on 2005/09/21 09:29:49 UTC

Bug with Tapestry 4 frames?

Hello,

I have a problem with a page, that contains two frame components. I want to make my page, which contains frames, set a property to frame's page before it is displayed. I think this can be accomplished by creating a method in parent page's class like:

public IPage getTopPage(){
    PopupTop page = (PopupTop)this.getRequestCycle().getPage("PopupTop");
    page.setSource(new ArrayList());
    return page;
}

Then on creating frame component, page specification should contain:

<component id="popupTop" type="Frame" >
    <binding name="page" value="ognl:topPage" />
</component>

But this approach doesn't work for me. I get an exception, stating that: "Page '$PopupTop_9@dfb094[PopupTop]' not found in application namespace."

But if I try to add this page directly, by specifying it's literal name, everything works fine:

<component id="popupTop" type="Frame" >
    <binding name="page" value="literal:PopupTop" />
</component>

Can anybody help me with this issue? Is it some kind of bug or what?

Thanks,
Audrius

Re: Bug with Tapestry 4 frames?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Audrius Peseckis <audrius <at> ivs.lt> writes:

> public IPage getTopPage(){
>     PopupTop page = (PopupTop)this.getRequestCycle().getPage("PopupTop");
>     page.setSource(new ArrayList());
>     return page;
> }
> 
> Then on creating frame component, page specification should contain:
> 
> <component id="popupTop" type="Frame" >
>     <binding name="page" value="ognl:topPage" />
> </component>

This won't work because the "page" parameter above expects a page name
(a string), not a page object.

To achieve what you want, you may try (untested code follows):

<FRAMESET>
    <FRAME jwcid="popupTop">
    <FRAME jwcid="...">
</FRAMESET>

<component id="popupTop" type="Any" >
    <binding name="src" value="ognl:url" />
</component>

class MyPage {
  @injectObject("engine-service:external")
  public abstract IEngineService getExternalService();

  String getUrl() {
    return getExternalService().getLink(getRequestCycle(), false, 
      new Object[]{"popupTop", new ArrayList()}).getURL();
  }
}

Of course your popupTop page needs to implement IExternalPage.
Note that I'm not entirely sure about the parameters expected
by the external service. So check the code to make it sure.

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)


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