You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by SantiagoA <s....@gmx.de> on 2007/09/20 16:27:16 UTC

Ajax Problem on Page with IFRAME

Hallo,
I have a Problem with AJAX functionality. 
I have some InputFields which have an Ajax based refresh
(onUpdate(AjaxRequestTarget target)) like an inputField for birthdate and
one for "AgeInYears". If a birthdate is commited, the Field "AgeInYears"
will be refreshed.
There are some TabPanels on this site, also.
One of them has an IFrame.
If this TabbedPanel is active, then the onUpdate-Methode of the InputFields
won´t be reached.
Is one of the TabbedPanels without an IFrame active, everything works fine.
This happens that way for IE and Firefox.
For Opera i got one Problem more, if the user changes the birthdate, while
the IFrame-panel is active the above written happens too and in addition no
other Panel can be activated by clicking anymore.

Is this a known problem with AJAX and IFrames, or am I doing something
terribly wrong.

Thanks for any help,
Santiago
-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12798348
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by SantiagoA <s....@gmx.de>.

I have a mainpage with some inputfields with ajax in, a submitbutton and a
TabbePanel with three panels.
The panels are for output only.
one of the panels holds an Iframe.

you can change inputs and on submit the panels are refreshed with new
outputs.
If one of the panels without the Iframe is active, i can change the inputs,
while some of the inputfields themselves are refreshed by ajax (e.g.
Birthdate input "22-06-1971" refreshes the inputfield for "AgeInYears" to
"36").
That works.
But if the panel with the Iframe is active, means the Tab for the panel was
clicked, none of the ajax above works anymore. With this panel active an
input/change in the mainpage seems to be not recognized. the
onUpdate(AjaxRequestTarget target)-methode of a component of the mainpage is
not reached, like the debugger shows me.
The processing and the output works fine, except the panel with the Iframe
is active.

thanks for spending time on that.
-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12861929
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by SantiagoA <s....@gmx.de>.
Thank you for your help, it works with Wicket 1.3.0beta3.
The migration was not quite easy, as i thought, but finally everything
works, even the IFrame.
-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12993964
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by SantiagoA <s....@gmx.de>.
I use 1.2.6.
Migrating the whole app will last for some time.
I´ll post feedback when its done
-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12902743
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by Kent Tong <ke...@cpttm.org.mo>.

SantiagoA wrote:
> 
> I have a mainpage with some inputfields with ajax in, a submitbutton and a
> TabbePanel with three panels.
> The panels are for output only.
> one of the panels holds an Iframe.
> 
> But if the panel with the Iframe is active, means the Tab for the panel
> was clicked, none of the ajax above works anymore. With this panel active
> an input/change in the mainpage seems to be not recognized. the
> onUpdate(AjaxRequestTarget target)-methode of a component of the mainpage
> is not reached, like the debugger shows me.
> 

I tried it and it works fine. Are you using 1.3 beta3? Try my code as
attached. http://www.nabble.com/file/p12893436/Home.html Home.html 
http://www.nabble.com/file/p12893436/Home.java Home.java 
http://www.nabble.com/file/p12893436/MyPanel1.html MyPanel1.html 
http://www.nabble.com/file/p12893436/MyPanel1.java MyPanel1.java 
http://www.nabble.com/file/p12893436/MyPanel2.html MyPanel2.html 
http://www.nabble.com/file/p12893436/MyPanel2.java MyPanel2.java 
http://www.nabble.com/file/p12893436/FramedPage.html FramedPage.html 
http://www.nabble.com/file/p12893436/FramedPage.java FramedPage.java 
-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12893436
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by SantiagoA <s....@gmx.de>.

I have a mainpage with some inputfields with ajax in, a submitbutton and a
TabbePanel with three panels.
The panels are for output only.
one of the panels holds an Iframe.

you can change inputs and on submit the panels are refreshed with new
outputs.
If one of the panels without the Iframe is active, i can change the inputs,
while some of the inputfields themselves are refreshed by ajax (e.g.
Birthdate input "22-06-1971" refreshes the inputfield for "AgeInYears" to
"36").
That works.
But if the panel with the Iframe is active, means the Tab for the panel was
clicked, none of the ajax above works anymore. With this panel active an
input/change in the mainpage seems to be not recognized. the
onUpdate(AjaxRequestTarget target)-methode of a component of the mainpage is
not reached, like the debugger shows me.
The processing and the output works fine, except the panel with the Iframe
is active.

thanks for spending time on that.
-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12861930
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by Kent Tong <ke...@cpttm.org.mo>.

SantiagoA wrote:
> 
> Sorry, doesn´t work for me either.
> 
> The Problem is, that the refreshing in the "main"-page does not work, if
> the particular Panel is active.
> The inputs and the ajax are nested in the main page, the panel shows a
> "readonly" Iframe with no inputs.
> 

Sorry that I don't understand what you're saying. Please state the precise
steps you're 
performing, the expected result and the actual result.

-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12861635
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by SantiagoA <s....@gmx.de>.
Sorry, doesn´t work for me either.

The Problem is, that the refreshing in the "main"-page does not work, if the
particular Panel is active.
The inputs and the ajax are nested in the main page, the panel shows a
"readonly" Iframe with no inputs.

thanks for help!

-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12860755
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by Kent Tong <ke...@cpttm.org.mo>.

Martijn Dashorst wrote:
> 
> I think you need to resend again, this time escaping the markup. It
> seems like nabble have changed something in their interface, as this
> is a recurring theme lately.
> 

No problem.

Home:
<html>
<body>
	
</body>
</html>
public class Home extends WebPage {
	public Home() {
		List<ITab> tabs = new ArrayList<ITab>();
		tabs.add(new AbstractTab(new Model("tab1")) {
			public Panel getPanel(String panelId) {
				return new MyPanel(panelId);
			}
		});
		TabbedPanel tabPanel = new TabbedPanel("tabPanel", tabs);
		add(tabPanel);
	}
}

MyPanel:
<wicket:panel>
	<iframe wicket:id="iframe"/>
</wicket:panel>
public class MyPanel extends Panel {

	public MyPanel(String id) {
		super(id);
		WebComponent iframe = new WebComponent("iframe");
		iframe.add(new AttributeModifier("src", true, new AbstractReadOnlyModel()
{
			public Object getObject() {
				return urlFor(FramedPage.class, null);
			}
		}));
		add(iframe);
	}
}

FramedPage:
<html>
<body>
	<form wicket:id="form">
		<input type="text" wicket:id="f1">
		<input type="text" wicket:id="f2">
	</form>
</body>
</html>
public class FramedPage extends WebPage {
	private String foo = "";
	private TextField f2;

	public FramedPage() {
		Form form = new Form("form");
		add(form);
		TextField f1 = new TextField("f1", new PropertyModel(this, "foo"));
		f2 = new TextField("f2",
						new PropertyModel(this, "capitalFoo"));
		f2.setOutputMarkupId(true);
		form.add(f1);
		form.add(f2);
		f1.add(new OnChangeAjaxBehavior() {
			protected void onUpdate(AjaxRequestTarget target) {
				target.addComponent(f2);
			}
		});
	}
	public String getCapitalFoo() {
		return foo.toUpperCase();
	}
	public void setCapitalFoo(String capitalFoo) {
		foo = capitalFoo.toLowerCase();
	}
}

-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12834657
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Ajax Problem on Page with IFRAME

Posted by Martijn Dashorst <ma...@gmail.com>.
I think you need to resend again, this time escaping the markup. It
seems like nabble have changed something in their interface, as this
is a recurring theme lately.

Martijn

On 9/22/07, Kent Tong <ke...@cpttm.org.mo> wrote:
>
>
> SantiagoA wrote:
> >
> > One of them has an IFrame.
> > If this TabbedPanel is active, then the onUpdate-Methode of the
> > InputFields won´t be reached.
> > Is one of the TabbedPanels without an IFrame active, everything works
> > fine.
> > This happens that way for IE and Firefox.
> >
>
> It works fine for me. Try my code:
>
> Home page:
>
>
>
> MyPanel:
>
>
>
> FramedPage:
>
>
>
> --
> View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12833344
> Sent from the Wicket - User mailing list archive at Nabble.com.
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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


Re: Best approach for list items: discrete markup or panels?

Posted by Eelco Hillenius <ee...@gmail.com>.
On 9/21/07, Chris Colman <ch...@stepaheadsoftware.com> wrote:
> I have a number of pages that display a list of items and am wondering
> about the best approach to implementing them in Wicket.
>
> To date I have created a single panel that contains the list and the
> markup for that panel holds the discrete markup elements for the fields
> in each item of the list.
>
> Another approach could be to create an individual panel that is
> responsible for providing the data for the items in the list. Then the
> list page markup just has a reference to that panel instead of holding
> the discrete item fields itself.
>
> I'm just wondering if anyone has used the later approach and with what
> success. It probably means there is a little bit of extra work up front
> to create the list panel markup and its class but then I end up with a
> reusable panel that I would easily be dropped into other pages as
> required.

Both work fine. Putting it into a separate panel works good if you
want to be able to reuse it in other occasions or want to be able to
shove it around.

Eelco

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


Best approach for list items: discrete markup or panels?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
I have a number of pages that display a list of items and am wondering
about the best approach to implementing them in Wicket.

To date I have created a single panel that contains the list and the
markup for that panel holds the discrete markup elements for the fields
in each item of the list.

Another approach could be to create an individual panel that is
responsible for providing the data for the items in the list. Then the
list page markup just has a reference to that panel instead of holding
the discrete item fields itself.

I'm just wondering if anyone has used the later approach and with what
success. It probably means there is a little bit of extra work up front
to create the list panel markup and its class but then I end up with a
reusable panel that I would easily be dropped into other pages as
required.

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


Re: Ajax Problem on Page with IFRAME

Posted by Kent Tong <ke...@cpttm.org.mo>.

SantiagoA wrote:
> 
> One of them has an IFrame.
> If this TabbedPanel is active, then the onUpdate-Methode of the
> InputFields won´t be reached.
> Is one of the TabbedPanels without an IFrame active, everything works
> fine.
> This happens that way for IE and Firefox.
> 

It works fine for me. Try my code:

Home page:



MyPanel:



FramedPage:



-- 
View this message in context: http://www.nabble.com/Ajax-Problem-on-Page-with-IFRAME-tf4487902.html#a12833344
Sent from the Wicket - User mailing list archive at Nabble.com.