Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
I do some inspection into the code a little and find out something:
If I just add Wiquery in to Maven's pom.xml
-> The default
"org.apache.wicket.markup.html.internal.HtmlHeaderContainer"
is immediatly replaced by
"WiQueryDecoratingHeaderResponse"
... which is weird ,
why I've never use any of Wiquery function but the
WiQueryDecoratingHeaderResponse show up in my response ???
Or JQWicket mislead to create a wrong HeaderResponse ...
After that, the way Wiquery does with the Order of JS file is misterious too...
:p
----------------------------------------
WiQueryDecoratingHeaderResponse .java source code
----------------------------------------
private void renderResponse()
{
Page page = (Page) ((IPageRequestHandler) getActiveRequestHandler()).getPage();
Long renderTime = page.getMetaData(WIQUERY_PAGE_KEY);
Boolean rendered =
renderTime != null && renderTime.equals(RequestCycle.get().getStartTime());
page.setMetaData(WIQUERY_PAGE_KEY, RequestCycle.get().getStartTime());
RequestCycle.get().setMetaData(WIQUERY_KEY, Boolean.TRUE);
// return when response has already been rendered.
if (rendered)
return;
final List<WiQueryPluginRenderingListener> pluginRenderingListeners =
settings.getListeners();
WiQueryPluginCollector visitor = new WiQueryPluginCollector();
visitor.component(page, new Visit<Void>());
page.visitChildren(visitor);
JsStatement jsStatement = new JsStatement();
for (IWiQueryPlugin plugin : visitor.getPlugins())
{
JsStatement tempStatement = plugin.statement();
if (tempStatement != null)
{
jsStatement.append("\t").append(tempStatement.render()).append("\n");
}
// calling listeners to compute specific stuff
for (WiQueryPluginRenderingListener listener : pluginRenderingListeners)
{
listener.onRender(plugin, this);
}
}
jsq.setStatement(jsStatement);
}
----------------------------------------------------
Can one of core developer tell me what I miss, or what configuration should I
do when I want to run Wiquery and JQWicket at the same time?
Thank in advance!
Original comment by hn.sgmedia
on 26 Jan 2012 at 5:54
Hi!
JQWicket and WiQuery do not work well together. Both aim to do the same but
using a different approach. Choose either one, not both.
When you add WiQuery to the classpath it installs itself using a Wicket
Initializer and sets a HeaderResponseDecorator. The HeaderResponseDecorator
manages all resource references when they are of a certain type and manages the
jQuery initializing statements.
Original comment by hielke.hoeve
on 26 Jan 2012 at 7:02
Ah,... got it!!
But sad enough to say I must use one of them not both.
So is there any solution to take care of the HeaderResponseDecorator myself...
if I really have to hack to make they work together...
Thank very much for your support!
Original comment by hn.sgmedia
on 26 Jan 2012 at 7:42
why would you want to use both? They seem to do the same thing...
You can unset the HeaderResponseDecorator but this will disable all of wiquerys
inner workings....
Original comment by hielke.hoeve
on 1 Feb 2012 at 10:29
The reason is my company want to use some components which delivery right
straight with the both lib. I'm trying to modify the source code of Wiquery
inHeaderResponseDecorator to make they aware of changes made by JQWicket...
You know, it's just about the order of the JS Libs...
But, as far as I can see, Wiquery also make VisuralWicket and other libs
crash!
So, maybe the core developers should make a more gentle way (aware of
others libs) to handle JSLibs order because they force to add its
HeaderResponseDecorator in the Initation step!
--
*SG* *M*edia - Hà Nội
*Mobile:* Mr. Quỳnh 01266.166.662 - Mr.Cường 0987.999.160*
*
*Mail: *hn.sgmedia@gmail.com
*Facebook: *facebook.com/hn.sgmedia <http://quynhvalentine.eu.tf>
Original comment by hn.sgmedia
on 2 Feb 2012 at 2:44
Original comment by hielke.hoeve
on 13 Feb 2012 at 12:44
Original issue reported on code.google.com by
hn.sgmedia
on 26 Jan 2012 at 5:00Attachments: