google-code-export / jqwicket

Automatically exported from code.google.com/p/jqwicket
1 stars 0 forks source link

Wiquery and JQWicket crash each other!!!! #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When using Wicket (1.5.3) + JQWicket 8.0 + Wiquery (1.5.3) , the order of the 
js libraries will be wrong 

What steps will reproduce the problem?
1.I've started with:

Wicket (1.5.3) + JQWicket 8.0 

run TipTipPage , work fine!!!!
2.+ Wiquery (1.5.3) into Maven's  pom.xml 
order of the js libraries will be wrong !!!!

This wrong order error is suppppppper weird ?
Did Wiquery and JQWicket use some conflict libraries like JS 1.7R2 or 
something, I can't understand it! 

What version of the product are you using? On what operating system?
Wicket (1.5.3) + JQWicket 8.0 + Wiquery (1.5.3) into Maven's  pom.xml 

Please provide any additional information below.

Original issue reported on code.google.com by hn.sgmedia on 26 Jan 2012 at 4:28

Attachments:

GoogleCodeExporter commented 9 years ago
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:57