You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gillespie59 <em...@atosorigin.com> on 2011/02/28 18:05:26 UTC

JavaScript Stack aggregator

Hi everybody !

I have some problems with the aggregation of my JavaScript stack when
PRODUCTION_MODE='true'.

When PRODUCTION_MODE is false, everything is OK. My 4 js files are included
into my page. 

But when i change to true, the js of my stack is empty. If i am right, this
js file have to include all my 4 js files ? 
All i have is : 

;/**/
Tapestry.markScriptLibrariesLoaded([]); 

Did I forgot something in my JavaScriptStack class or in my AppModule ? 

Thanks !

Emmanuel

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/JavaScript-Stack-aggregator-tp3403611p3403611.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: JavaScript Stack aggregator

Posted by Gillespie59 <em...@atosorigin.com>.
I found the solution. 

I add the js files to my stack in the getJavaScriptLibraries method
depending of a parameter of my request.

public List getJavaScriptLibraries() {
		List  jsStack = new ArrayList();
		if (myRequest.getMyParam) {
				jsStack.add(customMessages);
                }
		return jsStack;
}

But when the StackAssetRequestHandler service call this method, I lost this
parameter, so Tapestry include any file. My final JS file is empty. 

I extended the StackAssetRequestHandler class. I set again my param in the
handleAssetRequest method, depending of the desired Stack name.


    public boolean handleAssetRequest(Request request, Response response,
String extraPath) throws IOException
    {
   
    	if(extraPath.endsWith("myStack.js")) myRequest.setMyParam(true);
    	   	
    	return super.handleAssetRequest(request, response, extraPath);
    }

Thanks

Emmanuel

--
View this message in context: http://tapestry.1045711.n5.nabble.com/JavaScript-Stack-aggregator-tp3403611p3407618.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: JavaScript Stack aggregator

Posted by LLTYK <LL...@mailinator.com>.
We can't really tell what you've forgotten if we haven't seen how you did it.


-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/JavaScript-Stack-aggregator-tp6074088p6074478.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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