tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Andreou <andy...@di.uoa.gr>
Subject Re: [VOTE] Release 5.1.0.4
Date Sat, 25 Apr 2009 21:22:32 GMT
Take a look at makeValidIdentifier method in
https://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/script/LetToken.java?view=markup

It was used to convert valid html identifiers into valid javascript
variable names.

On Sat, Apr 25, 2009 at 8:19 PM, Robert Zeigler <robertz@scazdl.org> wrote:
> component did something like the following:
>
> renderSupport.addScript("%s = new XXX();",getClientId());
>
> Where getClientId returns the tapestry-generated id for the component. Note
> that this isn't my code... this is how many of the chenillekit components
> are coded.
> That works ok, unless the component, and consequently the script line, are
> rendered via an ajax request.
>
> Then getClientId() returned a value like: "xyz:xxxx", which may be a valid
> dom id, but isn't a valid javascript variable name.  So these components
> wouldn't work when rendered via ajax.
> As a quick fix, I extended the components and overrode getClientId, using a
> simple search & replace of ":" with _.
>
> Because tapestry changed the generated ids from using a : separator to a -
> separator, the replace code "broke"... there was nothing to replace. And
> xyz-xxxx is still not a valid js variable name.  What caught me off guard
> was the lack of an error message in firebug.  After I realized what was
> going on, I found an error message regarding the expression xyz-xxxx = new
> XXX(); being invalid.  So, there /was/ a js error, which resulted in failure
> to properly initialize all js, which resulted in the form submission via a
> standard post.
> Still not sure why firebug missed the error, but ah well.
>
> It raises an interesting consideration, though.   The need to generate a
> unique javascript variable name is not uncommon; the tapestry id generator
> gets us so close... but not all the way there due to - (previously :)
> showing up in ids, particularly in ajax requests.  To adapt the id to
> something guaranteed suitable as a js variable name requires "private"
> knowledge of the id generation scheme, and hence is a brittle strategy.  But
> it seems a shame to waste a perfectly good id generator... maybe we should
> consider expanding the api to add a "generateJavascriptVariableName" or some
> such, or provide a service for it.
>
> Cheers,
>
> Robert
>
> On Apr 25, 2009, at 4/2510:05 AM , Howard Lewis Ship wrote:
>
>> I'm glad the release is working, but I don't quite follow how the
>> client-side generated URLs broke thing. On the other hand, I strongly
>> advise people to always generate URLs on the server and pass them down
>> to the client (and perhaps add query parameters to them) since the
>> form of URLs can change at any time (i.e., if certain services are
>> overridden).
>>
>> On Fri, Apr 24, 2009 at 9:07 PM, Robert Zeigler <robertz@scazdl.org>
>> wrote:
>>>
>>> Found the issue; not an issue with tapestry, per se, but related to the
>>> change in client-side-id generation (from : to -).
>>> I was using some components from chenillekit.  This components use the
>>> component id as javascript identifiers.
>>> Which worked, unless the components were generated in an ajax request:
>>> foo:xxxxx isn't a valid js identifier. I overrode that to replace : with
>>> _
>>> for those js identifiers for those components.  But the change from : to
>>> -
>>> means my code no longer worked... and foo-xxxx is still an invalid js
>>> identifier. ;)
>>> Sorry, as is typically the case with these things, the problem is with
>>> user
>>> code, not framework code.
>>>
>>> +1 on 5.1.0.4 release.
>>>
>>> Robert
>>>
>>> On Apr 24, 2009, at 4/241:01 PM , Howard Lewis Ship wrote:
>>>
>>>> Very odd; like an Ajax request somehow fell through to the traditional
>>>> page-oriented component event request handler.
>>>>
>>>> On Fri, Apr 24, 2009 at 10:36 AM, Robert Zeigler <robertz@scazdl.org>
>>>> wrote:
>>>>>
>>>>> Hrm. I just noticed something in one of my apps broken in 5.1.0.4.
>>>>>  Tried
>>>>> 5.1.0.3 and it works fine.
>>>>> Scenario is:
>>>>>  zone with some text in it. Click an "edit" link, and text is updated
>>>>> with a
>>>>> form + textarea editor (form is rendered as part of the ajax request,
>>>>> so
>>>>> no
>>>>> issues with form not being available, etc.); this part still works
>>>>> fine.
>>>>>  Submit the form, save, and then update the zone with the saved text.
>>>>>
>>>>> This all works through 5.1.0.3, but the form save fails in 5.1.0.4.
>>>>>  Fails
>>>>> with:
>>>>>
>>>>> A component event handler method returned the value Block[text within
>>>>> ViewProtocolRun:wikitexteditor, at
>>>>> classpath:com/roxanemy/labbook/components/WikiTextEditor.tml, line 2].
>>>>> Return type org.apache.tapestry5.internal.structure.BlockImpl can not
>>>>> be
>>>>> handled. Configured return types are java.lang.Class, java.lang.String,
>>>>> java.net.URL, org.apache.tapestry5.Link,
>>>>> org.apache.tapestry5.StreamResponse,
>>>>> org.apache.tapestry5.runtime.Component.
>>>>>
>>>>> Stack trace:
>>>>>
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.ObjectComponentEventResultProcessor.processResultValue(ObjectComponentEventResultProcessor.java:39)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventResultProcessor_120d92c7e22.processResultValue($ComponentEventResultProcessor_120d92c7e22.java)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventResultProcessor_120d92c7d7d.processResultValue($ComponentEventResultProcessor_120d92c7d7d.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper.handleResult(ComponentResultProcessorWrapper.java:42)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$7.handleResult(ComponentPageElementImpl.java:1053)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.EventImpl.storeResult(EventImpl.java:74)
>>>>> #
>>>>>
>>>>>
>>>>> com.roxanemy.labbook.components.WikiTextEditor.dispatchComponentEvent(WikiTextEditor.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:902)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:263)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:398)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.corelib.components.Form$onAction$invocation_120d92d28c5.invokeAdvisedMethod(Form$onAction$invocation_120d92d28c5.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80)
>>>>> # org.apache.tapestry5.corelib.components.Form.onAction(Form.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:910)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventRequestHandler_120d92c7e13.handle($ComponentEventRequestHandler_120d92c7e13.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventRequestHandler_120d92c7e13.handle($ComponentEventRequestHandler_120d92c7e13.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventRequestHandler_120d92c7e13.handle($ComponentEventRequestHandler_120d92c7e13.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2169)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventRequestHandler_120d92c7e13.handle($ComponentEventRequestHandler_120d92c7e13.java)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentEventRequestHandler_120d92c7d7a.handle($ComponentEventRequestHandler_120d92c7d7a.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
>>>>> #
>>>>>
>>>>>
>>>>> com.roxanemy.labbook.services.impl.AuthComponentRequestFilter.handleComponentEvent(AuthComponentRequestFilter.java:32)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentRequestHandler_120d92c7d7b.handleComponentEvent($ComponentRequestHandler_120d92c7d7b.java)
>>>>> #
>>>>>
>>>>>
>>>>> $ComponentRequestHandler_120d92c7d6c.handleComponentEvent($ComponentRequestHandler_120d92c7d6c.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46)
>>>>> # $Dispatcher_120d92c7d6f.dispatch($Dispatcher_120d92c7d6f.java)
>>>>> # $Dispatcher_120d92c7d60.dispatch($Dispatcher_120d92c7d60.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:250)
>>>>> #
>>>>>
>>>>>
>>>>> com.googlecode.tapestry5cayenne.services.CayenneRequestFilter.service(CayenneRequestFilter.java:48)
>>>>> # $RequestFilter_120d92c7d5b.service($RequestFilter_120d92c7d5b.java)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:783)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> # com.roxanemy.labbook.services.AppModule$1.service(AppModule.java:83)
>>>>> # $RequestFilter_120d92c7d5f.service($RequestFilter_120d92c7d5f.java)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:772)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
>>>>> # $RequestHandler_120d92c7d61.service($RequestHandler_120d92c7d61.java)
>>>>> # $RequestHandler_120d92c7d55.service($RequestHandler_120d92c7d55.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:202)
>>>>> #
>>>>>
>>>>> org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
>>>>> #
>>>>>
>>>>>
>>>>> $HttpServletRequestHandler_120d92c7d57.service($HttpServletRequestHandler_120d92c7d57.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
>>>>> #
>>>>>
>>>>>
>>>>> $HttpServletRequestHandler_120d92c7d57.service($HttpServletRequestHandler_120d92c7d57.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
>>>>> #
>>>>>
>>>>>
>>>>> $HttpServletRequestFilter_120d92c7d54.service($HttpServletRequestFilter_120d92c7d54.java)
>>>>> #
>>>>>
>>>>>
>>>>> $HttpServletRequestHandler_120d92c7d57.service($HttpServletRequestHandler_120d92c7d57.java)
>>>>> #
>>>>>
>>>>>
>>>>> org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:731)
>>>>> #
>>>>>
>>>>>
>>>>> $HttpServletRequestHandler_120d92c7d57.service($HttpServletRequestHandler_120d92c7d57.java)
>>>>> #
>>>>>
>>>>>
>>>>> $HttpServletRequestHandler_120d92c7d51.service($HttpServletRequestHandler_120d92c7d51.java)
>>>>> # org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
>>>>>
>>>>>
>>>>> If I get a sec, I'll try to trackdown the build where this starts
>>>>> failing.
>>>>>
>>>>> Note also that I don't see any js errors in firebug, so it doesn't look
>>>>> like
>>>>> it's a problem with js failing and the form therefore submitting
>>>>> normally.
>>>>>  But that's an offhand assessment.
>>>>>
>>>>> So, right now, I'm -1. ;)
>>>>>
>>>>> Robert
>>>>>
>>>>> On Apr 23, 2009, at 4/2312:27 PM , Howard Lewis Ship wrote:
>>>>>
>>>>>> I've created and uploaded a release of Tapestry 5.1.0.4, ready to
be
>>>>>> voted upon. Tapestry 5.1 is currently in beta, but I think 5.1.0.4
>>>>>> will
>>>>>> ultimately be the final release.
>>>>>>
>>>>>> The files are uploaded to:
>>>>>>
>>>>>> http://people.apache.org/~hlship/tapestry-releases/
>>>>>>
>>>>>> and a Maven repository:
>>>>>>
>>>>>> http://people.apache.org/~hlship/tapestry-ibiblio-rsynch-repository/
>>>>>>
>>>>>> Please examine these files to determine if the new release, 5.1.0.4,
>>>>>> is
>>>>>> ready.
>>>>>>
>>>>>> I've also created a 5.1.0.4 tag in Subversion:
>>>>>>
>>>>>> http://svn.apache.org/viewvc/tapestry/tapestry5/tags/releases/5.1.0.4/
>>>>>>
>>>>>> On a successful vote, I'll move the files from these directories
to
>>>>>> the proper distribution directories and update the Tapestry site
>>>>>> documentation.
>>>>>>
>>>>>> Vote will run for three days; on success I'll move the voted artifacts
>>>>>> into place and send out appropriate notifications.
>>>>>>
>>>>>> Howard M. Lewis Ship: +1 binding
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Howard M. Lewis Ship
>>>>>>
>>>>>> Creator of Apache Tapestry
>>>>>> Director of Open Source Technology at Formos
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Howard M. Lewis Ship
>>>>
>>>> Creator of Apache Tapestry
>>>> Director of Open Source Technology at Formos
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>> Director of Open Source Technology at Formos
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Mime
View raw message