The first time I set the src of the iframe, it doesn't happen indeed.
I tried to remove the pagemap, but with no luck.
My code now looks like this :
PageMap.forName("subpage").remove();
iFrame.add(new SimpleAttributeModifier("src", urlFor(PageMap.forName("subpage"), SubPage.class, null)));
When debugging
public final void renderHead(final Response response)
in WebPage, "subpage" is still an entry of meta.pageMapNames...
"Johan Compagner"
<[EMAIL PROTECTED]>
Verzonden door: [EMAIL PROTECTED] 14/11/2006 13:50
|
|
Does it really happen the first time you open that iframe?
(i mean really the very first time)
if it then goes fine then you could do this right before:
iFrame.add(new SimpleAttributeModifier("src", urlFor(PageMap.forName("subpage"), SubPage.class, null)));
do this:
PageMap.forName("subpage").remove();
So make sure there is no old subpage pagemap hanging around.
johan
On 11/14/06, Marieke Vandamme <[EMAIL PROTECTED]> wrote:
Hello,
I'm having difficulties using iframe inside a webpage, as the destination page of my iframe is loaded twice.
Example code:
MainPage.html
<form wicket:id="webForm">
<input type="submit" wicket:id="btnSubmit"/>
</form>
<iframe wicket:id="iFrame"></iframe>
MainPage.java
private WebMarkupContainer iFrame = null;
public MainPage() {
iFrame = new WebMarkupContainer("iFrame");
iFrame.setOutputMarkupId(true);
add(iFrame);
Form webForm = new Form("webForm");
webForm.add(new AjaxSubmitButton("btnSubmit", webForm){
protected void onSubmit(AjaxRequestTarget target, Form form) {
iFrame.add(new SimpleAttributeModifier("src", urlFor(PageMap.forName("subpage"), SubPage.class, null)));
target.addComponent(iFrame);
}
});
add(webForm);
}
There will be two SubPage-instances created with different pagemap (first time "subpage", second time "wicket-0").
When looking into this, I saw in the wicket.markup.html.WebPage, that the location is set again with different pagemap.
I tried also 2 other options :
1. Set the pagemap in the constructor of the SubPage : super(PageMap.forName("subpage"));
2. Use wicket.markup.html.link.InlineFrame instead of WebMarkupContainer. With this last one, I'm not sure I implemented it right.
iFrame = new InlineFrame("iFrame", PageMap.forName("subpage"), SubPage.class);
// I want an empty iframe the first time
iFrame.add(new SimpleAttributeModifier("src", ""));
iFrame = new WebMarkupContainer("iFrame");
iFrame.setOutputMarkupId(true);
add(iFrame);
Form webForm = new ...
When testing all the above, sometimes I ran into a neverending cycle, because the window.location is set everytime.
What is the solution? I know that using no iframes is the best one, but I have a searchbox + underneath my results.
Only the results may be scrollable, so the searchbox is always visible.
Thanks in advance !
**** DISCLAIMER **** http://www.tvh.be/newen/pages/emaildisclaimer.html "This message is delivered to all addressees subject to the conditions set forth in the attached disclaimer, which is an integral part of this message." |
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user