views:

269

answers:

1

Hi,

I need to get a

<rich:modalPanel id="mod1" .../> 

component to load an external page on "show" action, defined as:

<a4j:commandButton value="link" id="l1" reRender="mod1" oncomplete="Richfaces.showModalPanel('mod1')">
    <f:setPropertyActionListener target="#{mybean.someParam}" value="#{myOtherbean.someOtherparam}" />
</a4j:commandButton>

. My first try was with

<rich:modalPanel id="mod1">
    <ui:include src="#{mybean.generateURL}"/>
</rich:modalPanel>

but it just throws me a 404 page not found error, typing the generated URL directly into the address bar works perfectly fine.

Does anyone know what's causing the problem , or what's the correct way to do this?

The system is running on seam/richfaces.

Thanks!

+2  A: 

You can't use <x:include> to include external pages. You have two options:

  • As Damo suggested in the comments, use an <iframe> inside the modal
  • use a bean of yours to load the contents of the target url (via URL.openConnection()) and output them in a page, which you can then include.
Bozho
Thanks, using <iframe> is working perfectly fine. Pardon me for being an idiot here, I'm bad at web devs, so: - I don't really get why you can't use the <x:include> tags, is it something to do with the page rendering phases? - I can't figure out how to use approach 2 either.
John