rasyahadlinugraha / wiquery

Automatically exported from code.google.com/p/wiquery
MIT License
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 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 of JQWicket (in attached file) , 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 5:00

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
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:54

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

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

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

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

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 13 Feb 2012 at 12:44