Hi Rich,

Yep same guy, guilty as charged.  This may not be the best solution, you may
get some better advice from some of the more experienced Tapestry people on
the forum, but it's the approach I used.  The post I included earlier was
indeed about just ensuring a specific order was enforced in the js includes
for the ClientInfrastructure, but I have used a variation on it to include
my local version of blackbird.js, rather than the one that comes with
T5.1.0.5.  The code is as follows:

AppModule.java:
      public ClientInfrastructure
decorateClientInfrastructure(ClientInfrastructure original,
@InjectService("AssetSource") AssetSource assetSource) {
          return new MyClientInfrastructure(original, assetSource);
      }


MyClientInfrastructure.java:
public class MyClientInfrastructure implements ClientInfrastructure {

        @Inject
        AssetSource assetSource;
        
        ClientInfrastructure clientInfrastructure;
    List javascriptStack = new ArrayList(); 

    @SuppressWarnings("unchecked")
        public MyClientInfrastructure(ClientInfrastructure
clientInfrastructure, AssetSource assetSource) {
        this.assetSource = assetSource;    
        this.clientInfrastructure = clientInfrastructure;
        // Add jQuery assets in ahead of Prototype - IE8 was burping
otherwise, despite jQuery.noConflict being set
        javascriptStack.add(assetSource.getAsset(null,
"context:/scripts/jquery-1.4.2.min.js", null));
        javascriptStack.add(assetSource.getAsset(null,
"context:/scripts/jquery-ui-1.8.1.custom.min.js", null));

        List assets = this.clientInfrastructure.getJavascriptStack();
        for (Iterator i = assets.iterator(); i.hasNext();) {
            Asset asset = (Asset) i.next();
            if (!asset.toString().contains("blackbird.js")) {
                javascriptStack.add(asset);
            } else {
                javascriptStack.add(assetSource.getAsset(null,
"context:/scripts/blackbird_1_0/blackbird.js", null));
            }
           
        }
    }

    public List<Asset> getJavascriptStack() {
                //return clientInfrastructure.getJavascriptStack();
                return javascriptStack;
    }

    public List<Asset> getStylesheetStack() {
            return clientInfrastructure.getStylesheetStack();
    }
}

I have my local blackbird.js physically located in the project under
src\main\webapp\scripts\blackbird_1_0\blackbird.js.

Obviously the jQuery ordering is not relevant to your specific problem, just
the replacement of blackbird.js is.  Probably could be more
elegant/efficient, but it's just called once at startup so I wasn't too
concerned about it.

Hope this get things working for you <and I don't get chewed by the more
enlightened forum members!>.

Regards,
Jim.

-----Original Message-----
From: Rich [mailto:rich...@moremagic.com] 
Sent: 20 July 2010 19:41
To: Tapestry users
Subject: Re: blackbird.js and IE breaking fixed CSS background image

Ah, thanks that seems like a start, but I'm having some issues with it.

The call to the constructor in the decorator method throws a 
NullPointerException, it seems because there is an issue with the 
ClientInfrastructure passed into the decorator method.  Also, the logic 
in your example seems to be based around having one javascript library 
file supersede another in the stack order. How will this apply to 
getting my CSS to work? Should I pass in a second, fixed version of the 
blackbird.js to the javascriptStack after the original is contributed? 
Also, how exactly is an asset referenced when adding to the 
javascriptStack list, as a path like generic 
assets/package/name/asset.filetype ?

I'm guessing you were the guy who mentioned the blackbird issue in the 
first place since your name is also Jim. Thanks for the help so far.

Thanks,
Rich

Jim O'Callaghan wrote:
> See this post for a possible workaround:
>
>
http://markmail.org/message/fsu22hjz4bxvpczb?q=list:org%2Eapache%2Etapestry%
> 2Eusers+MyClientInfrastructure
>
> I don't know why this hasn't been raised more often as an issue with
> blackbird and IE.  I think blackbird has been removed from T5.2.0 in
favour
> of an internal solution to logging client side messages.
>
> Regards,
> Jim.
>
> -----Original Message-----
> From: Rich [mailto:rich...@moremagic.com] 
> Sent: 20 July 2010 17:25
> To: users@tapestry.apache.org
> Subject: blackbird.js and IE breaking fixed CSS background image
>
> Hi,
>
> I'm aware blackbird.js is not directly Tapestry code, but I'm looking 
> for advice on how to handle an issue with the blackbird.js file. I had 
> been having problems with getting the fixed background image in my 
> tapestry webapp to stay fixed in Internet Explorer. I'd given up 
> searching for a solution (it appeared to be beyond the CSS I was using) 
> until someone recently pointed out that a line of code in blackbird.js 
> breaks the fixed background for IE.
>
> I went and re-jared the tapestry-core with the line of code commented 
> out and it now works in internet explorer. However, having to manage my 
> own version of the tapestry-core jar to fix an IE bug does not seem like 
> a good idea. Is there a way to exclude blackbird from my projects all 
> together? Or maybe there is some other, better solution?
>
> Regards,
> Rich
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to