You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wicket_newb <jc...@hestonsystems.com> on 2012/01/25 23:33:46 UTC

jQuery Mobile styling disappears after Wicket ajax update

I'm trying to implement a list that updates itself after a user clicks on a
link.  The list is a ListView repeater and is a child of WebMarkupContainer. 
For each ListView item, I've attached an AjaxFallbackLink with the
WebMarkupContainer object as the sole ajax target.

My implementation mostly works except some jQuery Mobile styling in the
container disappear.  Looking at Firebug, I noticed that jQuery Mobile's
dynamically-generated class attributes are gone.

As an example, my repeating divs before Wicket ajax update looks like this:
<div class="ui-collapsible-set" data-role="collapsible-set">
	<div class="ui-collapsible" data-role="collapsible">
		etc...
	</div
</div>

After the ajax update:
<div data-role="collapsible-set">
	<div data-role="collapsible">
		etc...
	</div>
</div>

Is there a way to tell Wicket to keep jQuery Mobile styling after an ajax
update?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/jQuery-Mobile-styling-disappears-after-Wicket-ajax-update-tp4328874p4328874.html
Sent from the Users forum 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: jQuery Mobile styling disappears after Wicket ajax update

Posted by Hielke Hoeve <Hi...@topicus.nl>.
Correct. You need to use modifiers or appenders on your components if you manually apply the style or call any jquery functions to make sure that jquery reapplies the styles. The html gets replaced and with that any jquery additions generated on the client. You can use the renderHead(IHeaderResponse) function of any component to render resources and domready events for that component

Hielke
 
-----Original Message-----
From: Bodis, Jerome [mailto:bodis@uni-mainz.de] 
Sent: donderdag 26 januari 2012 9:03
To: 'users@wicket.apache.org'
Subject: RE: jQuery Mobile styling disappears after Wicket ajax update

Correct me if i'm wrong, but with normal jquery event handlers get lost if an element has changed. That's why you have to reattach them with on()/live(). Maybe this is the case? If it's only the css class you could try to add them with AttributeAppender/Modifier.


> -----Original Message-----
> From: wicket_newb [mailto:jcebedo@hestonsystems.com]
> Sent: Wednesday, January 25, 2012 11:34 PM
> To: users@wicket.apache.org
> Subject: jQuery Mobile styling disappears after Wicket ajax update
> 
> I'm trying to implement a list that updates itself after a user clicks on a link.
> The list is a ListView repeater and is a child of WebMarkupContainer.
> For each ListView item, I've attached an AjaxFallbackLink with the 
> WebMarkupContainer object as the sole ajax target.
> 
> My implementation mostly works except some jQuery Mobile styling in 
> the container disappear.  Looking at Firebug, I noticed that jQuery 
> Mobile's dynamically-generated class attributes are gone.
> 
> As an example, my repeating divs before Wicket ajax update looks like this:
> <div class="ui-collapsible-set" data-role="collapsible-set">
> 	<div class="ui-collapsible" data-role="collapsible">
> 		etc...
> 	</div
> </div>
> 
> After the ajax update:
> <div data-role="collapsible-set">
> 	<div data-role="collapsible">
> 		etc...
> 	</div>
> </div>
> 
> Is there a way to tell Wicket to keep jQuery Mobile styling after an 
> ajax update?
> 
> --
> View this message in context: http://apache-
> wicket.1842946.n4.nabble.com/jQuery-Mobile-styling-disappears-after-
> Wicket-ajax-update-tp4328874p4328874.html
> Sent from the Users forum 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


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


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


RE: jQuery Mobile styling disappears after Wicket ajax update

Posted by "Bodis, Jerome" <bo...@uni-mainz.de>.
Correct me if i'm wrong, but with normal jquery event handlers get lost if an element has changed. That's why you have to reattach them with on()/live(). Maybe this is the case? If it's only the css class you could try to add them with AttributeAppender/Modifier.


> -----Original Message-----
> From: wicket_newb [mailto:jcebedo@hestonsystems.com]
> Sent: Wednesday, January 25, 2012 11:34 PM
> To: users@wicket.apache.org
> Subject: jQuery Mobile styling disappears after Wicket ajax update
> 
> I'm trying to implement a list that updates itself after a user clicks on a link.
> The list is a ListView repeater and is a child of WebMarkupContainer.
> For each ListView item, I've attached an AjaxFallbackLink with the
> WebMarkupContainer object as the sole ajax target.
> 
> My implementation mostly works except some jQuery Mobile styling in the
> container disappear.  Looking at Firebug, I noticed that jQuery Mobile's
> dynamically-generated class attributes are gone.
> 
> As an example, my repeating divs before Wicket ajax update looks like this:
> <div class="ui-collapsible-set" data-role="collapsible-set">
> 	<div class="ui-collapsible" data-role="collapsible">
> 		etc...
> 	</div
> </div>
> 
> After the ajax update:
> <div data-role="collapsible-set">
> 	<div data-role="collapsible">
> 		etc...
> 	</div>
> </div>
> 
> Is there a way to tell Wicket to keep jQuery Mobile styling after an ajax
> update?
> 
> --
> View this message in context: http://apache-
> wicket.1842946.n4.nabble.com/jQuery-Mobile-styling-disappears-after-
> Wicket-ajax-update-tp4328874p4328874.html
> Sent from the Users forum 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


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