T5: t:errors not displaying when form has a zone
Hi, I got a form like this, t:errors got displayed, but if I put a zone in the form, errors are not shown, why? -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-t-errors-not-displaying-when-form-has-a-zone-tp3301312p3301312.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: t:errors not displaying when form has a zone
Hi, I got a form like this, t:errors got displayed, but if I put a zone in the form, errors are not shown, why? -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-t-errors-not-displaying-when-form-has-a-zone-tp3301313p3301313.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tapestry 5.2 offline documentation
Hi. I've just download tapestry-src-5.2.4. How can I generate documentation for offline reading? Should I run "mvn site" on every subfolder of tapestry-src-5.2.4 ? I've got the following error when running "mvn site" inside tapestry-src-5.2.4/tapestry-project: [INFO] Trace org.apache.maven.reactor.MavenExecutionException: Could not find the model file 'C:\java-lib\tapestry\tapestry-src-5.2.4\tapestry-project\tapestry-json'. for pr oject unknown It looks like maven is searching for "tapestry-json" inside "tapestry-project" folder. How to tell maven that "tapestry-json" folder is on the same level with "tapestry-project" (not inside "tapestry-project") ? Thanks in advance. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Progress indicator and AJAX example?
Hi, Here is a simple example Java Code :- import org.apache.tapestry5.BindingConstants; import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.Link; import org.apache.tapestry5.MarkupWriter; import org.apache.tapestry5.annotations.AfterRender; import org.apache.tapestry5.annotations.Environmental; import org.apache.tapestry5.annotations.Import; import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.internal.util.CaptureResultCallback; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.json.JSONObject; import org.apache.tapestry5.services.Request; import org.apache.tapestry5.services.javascript.JavaScriptSupport; @Import(library = "progressbar.js") public class ProgressBar { @Parameter(value = "1", defaultPrefix=BindingConstants.LITERAL) private int period; @Parameter(defaultPrefix = BindingConstants.LITERAL) private String clientFunc; @Inject private ComponentResources resources; @Environmental private JavaScriptSupport javaScriptSupport; @Inject private Request request; @AfterRender void afterRender(MarkupWriter writer){ Link link = resources.createEventLink("timer"); JSONObject spec = new JSONObject(); spec.put("url", link.toAbsoluteURI()); spec.put("period", period); spec.put("clientFunc", clientFunc); javaScriptSupport.addScript("new ProgressBar(%s);", spec); } Object onTimer(){ JSONObject spec = new JSONObject(); double value = 0.0; try { value = Double.parseDouble(request.getParameter("value")); }catch(NumberFormatException nfe){ return spec; } CaptureResultCallback callback = new CaptureResultCallback(); resources.triggerEvent("update", new Object[]{value}, callback); value = callback.getResult(); System.out.println("Value = " + value); spec.put("value", value); return spec; } } JavaScript Code :- ProgressBar = Class.create({ initialize:function(spec){ this.value = 0; this.url = spec.url; this.clientFunc = spec.clientFunc; this.executer = new PeriodicalExecuter(this.execute.bind(this), spec.period); }, execute:function(transport){ new Ajax.Request(this.url + "?value=" + this.value, { method:"get", onSuccess:function(transport){ this.onSuccess(transport); }.bind(this) }, this.period); }, onSuccess:function(transport){ var json = transport.responseText.evalJSON(); if(typeof(json.value) == "undefined"){ alert(transport.responseText + ": returned") this.stopExecuter(); } this.value = json.value; if(this.clientFunc){ var func = this.clientFunc +"(" + json.value+")"; eval(func); } if(json.value >= 100){ this.stopExecuter(); } }, stopExecuter:function(){ this.executer.stop(); } }); Usage :- updateFunc = function(percentage){ $("progressBar").update(percentage + "%"); }; Hope it helps regards Taha On Fri, Dec 10, 2010 at 6:55 PM, Richard Hill wrote: > Hi Cameron, > > For an example of how to make an ajax call from your own js see the mail > I sent yesterday. > > Richard. > > > > On Fri, 2010-12-10 at 09:14 -0200, Thiago H. de Paula Figueiredo wrote: > > On Fri, 10 Dec 2010 09:04:49 -0200, Newham, Cameron < > cameron.new...@bl.uk> > > wrote: > > > > > Hi, > > > > Hi! > > > > > I imagine that if I wanted just a simple field on a page that updated > > > with a % then I would have Javascript make an AJAX get and obtain a > > > value from the server. However, as I'm a complete newbie to AJAX, an > > > example of how to do this would be extremely helpful. > > > > The AJAX part itself is completely Tapestry-unrelated and there are many > > examples in the Internet, maybe even in this mailing list archives. I > > answered something similar yesterday. The AJAX Prototype documentation is > > here: http://api.prototypejs.org/ajax/Ajax/Request/. > > > > > Example silly > > > questions: does my field have to be in a Zone? > > > > No, as long as you write your own JavaScript code to do and handle an > AJAX > > request and then update the page DOM. > > > > > Also, would the % value updated by my process just be held in a > @Persist > > > field? > > > > Absolutely no. Just get the % value when handling the request. You don't > > even need a field for that. > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Ajax custom exception handled does not work in tapestry 5.2.4
Can you provide an example of an exception that is not being handled? Are you talking about javascript exception or java exception? On Fri, Dec 10, 2010 at 1:40 PM, Dimitris Zenios wrote: > > Even if i create my own exceptionhandler function and register it through the > Tapestry.ajaxRequest(url,{ onException: function}) the exception handled is > not called when an exception is thrown.I think the problem is in the succes > function that tapestry.js overwrites we have this snippet of code when the > status is 0 or the request was not a success > > if (!response.getStatus() || !response.request.success()) { > Tapestry.error(Tapestry.Messages.ajaxRequestUnsuccessful); > return; > } > > it returns before calling the exception handler > > ps. i already submitted a jira (TAP5-1368) > https://issues.apache.org/jira/browse/TAP5-1368 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Image file upload with Easy FCKEditor
Hi, did you ever get a workaround for this? From looking around I can see there are various fixes involving .htacess files / mods to php config but was hoping there was something obvious within Easy FCKEditor itself ... Regards, Jim. -Original Message- From: Alex W. Croton [mailto:acro...@linkfinancial.eu] Sent: 23 November 2010 17:03 To: users@tapestry.apache.org Subject: Image file upload with Easy FCKEditor Hi All, I cannot work out how to get images to upload using the Easy FCKEditor component in Tapestry. I have created a fresh project, just to test this, using Tapestry 5.2.4,Easy FCK Editor 1.0.5 and the server is Tomcat 6.0.26 [currently being run from Eclipse Helios]. To set this up, I have [almost] followed the instructions on http://t5-easy-fckeditor.kenai.com/Installing.html with the exception of setting the version number to 1.0.4 Following through the above site's very clear tutorials, in the section on 'Supporting File Uploads', as soon as I try and do anything like upload a file or browse the server, I get error messages ("The server didn't reply with a proper XML data") or my browser asking me what to do with this PHP file that it's been given. I have never been treated to the error message that is illustrated on the page. Apologies if this has been answered before - on searching, I can find a few questions, but no answers that make any sense to me. Regards, Alex C - 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
Ajax custom exception handler does not work in tapestry 5.2.4
Even if i create my own exception handler function and register it through the Tapestry.ajaxRequest(url,{ onException: function}) the exception handled is not called when an exception is thrown.I think the problem is in the succes function that tapestry.js overwrites we have this snippet of code when the status is 0 or the request was not a success if (!response.getStatus() || !response.request.success()) { Tapestry.error(Tapestry.Messages.ajaxRequestUnsuccessful); return; } it returns before calling the exception handler ps. i already submitted a jira (TAP5-1368) https://issues.apache.org/jira/browse/TAP5-1368
ajaxExceptionHandler Method name typo in tapestry 5.2.4
There is a typo in tapestry.js regarding ajaxExceptionHandler function.The method name is ajaxExceptionHander instead of ajaxExceptionHandler and you are registering it in (new Ajax.request) as ajaxExceptionHandler ps. i already submitted a jira (TAP5-1367) https://issues.apache.org/jira/browse/TAP5-1367
Ajax custom exception handled does not work in tapestry 5.2.4
Even if i create my own exceptionhandler function and register it through the Tapestry.ajaxRequest(url,{ onException: function}) the exception handled is not called when an exception is thrown.I think the problem is in the succes function that tapestry.js overwrites we have this snippet of code when the status is 0 or the request was not a success if (!response.getStatus() || !response.request.success()) { Tapestry.error(Tapestry.Messages.ajaxRequestUnsuccessful); return; } it returns before calling the exception handler ps. i already submitted a jira (TAP5-1368) https://issues.apache.org/jira/browse/TAP5-1368
ajaxExceptionHandler Method name typo in tapestry 5.2.4
There is a typo in tapestry.js regarding ajaxExceptionHandler function.The method name is ajaxExceptionHander instead of ajaxExceptionHandler and you are registering it in (new Ajax.request) as ajaxExceptionHandler ps. i already submitted a jira (TAP5-1367) https://issues.apache.org/jira/browse/TAP5-1367
Re: T5: When Flash persisted values are cleared?
On Fri, 10 Dec 2010 18:55:06 -0200, Dmitriy Vsekhvalnov wrote: Does @PageDetached works with components? No, but you can use @CleanupRender or @AfterRender for that. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: When Flash persisted values are cleared?
Does @PageDetached works with components? On Fri, Dec 10, 2010 at 9:20 PM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > On Fri, 10 Dec 2010 12:18:22 -0200, Dmitriy Vsekhvalnov < > dvsekhval...@gmail.com> wrote: > > Hi all, i'm slightly confused with @Persist("flash") and XHR requests. >> > > Hi! > > A flash persisted value is cleared when it's read from the session, > something that happens once per request AFAIK. What you see it that AJAX > requests are processed in one request, while non-AJAX action (including form > submission) requests are handled in two (redirect-after-post, one for > handling the action, another for rendering a response). I guess we need > something like a "renderflash" persistence, that removes the object from the > session after a render request, AJAX or not, is finished. Meanwhile, try > setting your field to null in a @PageDetached method. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Prevent double submission w/linkSubmit
I haven't spent a ton of time thinking about your specific problem, or why you can't disable the link, but it reminded me of an old thread about canceling link submits. http://tapestry.1045711.n5.nabble.com/quot-Confirm-quot-mixin-won-t-cancel-when-in-zone-td2436465.html If you can't disable the link then maybe you can just ignore the clicks. Josh On Fri, Dec 10, 2010 at 11:43 AM, David Rees wrote: > On Thu, Dec 9, 2010 at 2:57 PM, Benny Law wrote: >> Keep in mind that a form could be submitted by pressing the Enter key inside >> a text field. A safer approach would be to prevent the form itself from >> being submitted more than once, regardless of how it is submitted. > > Right - and as I stated in my original post I tried disabling the link > by observing the FORM_PREPARE_FOR_SUBMIT_EVENT event - but for some > reason you can't disable the link like you can a button... > > I also tried using a Javascript variable to see if the form had been > submitted once already or not, but I was not able to get the event to > stop... > > -Dave > > - > 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
Re: Prevent double submission w/linkSubmit
Instead of trying to disable every element that can trigger a form submission, I stop the form submission event itself. Here is the JavaScript I have been using, and it seems to be working for me: document.observe("dom:loaded", function() { $$("form").invoke("observe", "submit", function(event) { if (this.submitted) { event.stop(); } else { this.submitted = true; }; }); }); Benny On Fri, Dec 10, 2010 at 2:43 PM, David Rees wrote: > On Thu, Dec 9, 2010 at 2:57 PM, Benny Law wrote: > > Keep in mind that a form could be submitted by pressing the Enter key > inside > > a text field. A safer approach would be to prevent the form itself from > > being submitted more than once, regardless of how it is submitted. > > Right - and as I stated in my original post I tried disabling the link > by observing the FORM_PREPARE_FOR_SUBMIT_EVENT event - but for some > reason you can't disable the link like you can a button... > > I also tried using a Javascript variable to see if the form had been > submitted once already or not, but I was not able to get the event to > stop... > > -Dave > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Prevent double submission w/linkSubmit
On Thu, Dec 9, 2010 at 2:57 PM, Benny Law wrote: > Keep in mind that a form could be submitted by pressing the Enter key inside > a text field. A safer approach would be to prevent the form itself from > being submitted more than once, regardless of how it is submitted. Right - and as I stated in my original post I tried disabling the link by observing the FORM_PREPARE_FOR_SUBMIT_EVENT event - but for some reason you can't disable the link like you can a button... I also tried using a Javascript variable to see if the form had been submitted once already or not, but I was not able to get the event to stop... -Dave - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: When Flash persisted values are cleared?
On Fri, 10 Dec 2010 12:18:22 -0200, Dmitriy Vsekhvalnov wrote: Hi all, i'm slightly confused with @Persist("flash") and XHR requests. Hi! A flash persisted value is cleared when it's read from the session, something that happens once per request AFAIK. What you see it that AJAX requests are processed in one request, while non-AJAX action (including form submission) requests are handled in two (redirect-after-post, one for handling the action, another for rendering a response). I guess we need something like a "renderflash" persistence, that removes the object from the session after a render request, AJAX or not, is finished. Meanwhile, try setting your field to null in a @PageDetached method. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: When Flash persisted values are cleared?
Hi all, i'm slightly confused with @Persist("flash") and XHR requests. I have a Message component which used to show alert/warn/info messages on the page, it has a message property, which is flash persisted: @Persisted("flash") private String msg; //+ getter and setter On several pages it wrapped to Zone, like this: And the page event handler doing something like: public Object onActionFromCopy() { messages.setMsg("Complete"); return new MultiZoneUpdate("toolZone", toolZone).add("messageZone",messages); } if actionFromCopy() called via XHR request message is shown, but if i then refresh page (non-XHR) the message is shown once more and i don't see that FlashPersistentFieldStrategy.didReadChange(..) is called during first XHR. I'd like to use messages component with both XHR and non-XHR requests. What i'm doing wrong? Thanks.
Re: T5: Progress indicator and AJAX example?
Hi Cameron, For an example of how to make an ajax call from your own js see the mail I sent yesterday. Richard. On Fri, 2010-12-10 at 09:14 -0200, Thiago H. de Paula Figueiredo wrote: > On Fri, 10 Dec 2010 09:04:49 -0200, Newham, Cameron > wrote: > > > Hi, > > Hi! > > > I imagine that if I wanted just a simple field on a page that updated > > with a % then I would have Javascript make an AJAX get and obtain a > > value from the server. However, as I'm a complete newbie to AJAX, an > > example of how to do this would be extremely helpful. > > The AJAX part itself is completely Tapestry-unrelated and there are many > examples in the Internet, maybe even in this mailing list archives. I > answered something similar yesterday. The AJAX Prototype documentation is > here: http://api.prototypejs.org/ajax/Ajax/Request/. > > > Example silly > > questions: does my field have to be in a Zone? > > No, as long as you write your own JavaScript code to do and handle an AJAX > request and then update the page DOM. > > > Also, would the % value updated by my process just be held in a @Persist > > field? > > Absolutely no. Just get the % value when handling the request. You don't > even need a field for that. > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Triggering zone update in component
On Fri, 2010-12-10 at 09:09 -0200, Thiago H. de Paula Figueiredo wrote: > On Fri, 10 Dec 2010 08:37:07 -0200, Richard Hill > wrote: > > > Hi All, > > Hi! > > > I have a simple page with a component in it. This component contains a > > zone. I would like to be able to update the zone from the parent page. > > First of all, it's a bad practice for a parent page or component to use > something from component. It's bad encapsulation. > I can see why it would be a bad design for a component to call/access it's parent, but I think there are legitimate cases when you might need a parent to update a child component. > > At the moment I am using an actionlink handler in the parent to call the > > handler in the component - but this results in a full page re-render of > > the parent. > > If this ActionLink has a zone parameter, it will work as long as you > return a block, component instance, JSONObject, JSONArray or > MultiZoneUpdate instance. What I have actually done now is wrap the component in zone. So now I can update from the parent and from within the zone itself. > > So what's the best way of updating a component's zone from it's parent > > page? > > Remember that what you pass to the zone parameter of ActionLink, EventLink > and Form is an HTML id, not a Tapestry t:id. Therefore, all you need is to > create an ActionLink with zone="yourZoneClientId". > Cheers - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Progress indicator and AJAX example?
On Fri, 10 Dec 2010 09:04:49 -0200, Newham, Cameron wrote: Hi, Hi! I imagine that if I wanted just a simple field on a page that updated with a % then I would have Javascript make an AJAX get and obtain a value from the server. However, as I'm a complete newbie to AJAX, an example of how to do this would be extremely helpful. The AJAX part itself is completely Tapestry-unrelated and there are many examples in the Internet, maybe even in this mailing list archives. I answered something similar yesterday. The AJAX Prototype documentation is here: http://api.prototypejs.org/ajax/Ajax/Request/. Example silly questions: does my field have to be in a Zone? No, as long as you write your own JavaScript code to do and handle an AJAX request and then update the page DOM. Also, would the % value updated by my process just be held in a @Persist field? Absolutely no. Just get the % value when handling the request. You don't even need a field for that. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Triggering zone update in component
On Fri, 10 Dec 2010 08:37:07 -0200, Richard Hill wrote: Hi All, Hi! I have a simple page with a component in it. This component contains a zone. I would like to be able to update the zone from the parent page. First of all, it's a bad practice for a parent page or component to use something from component. It's bad encapsulation. At the moment I am using an actionlink handler in the parent to call the handler in the component - but this results in a full page re-render of the parent. If this ActionLink has a zone parameter, it will work as long as you return a block, component instance, JSONObject, JSONArray or MultiZoneUpdate instance. So what's the best way of updating a component's zone from it's parent page? Remember that what you pass to the zone parameter of ActionLink, EventLink and Form is an HTML id, not a Tapestry t:id. Therefore, all you need is to create an ActionLink with zone="yourZoneClientId". -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: Progress indicator and AJAX example?
Hi, Can anyone point me to an example of a progress indicator or, more simply, how one would go about having a page with a % complete field? I have a process that ingests a file and takes quite a long time and I would like to indicate to the user how much of it has been done. I recall from research I did a few months ago that there is a progress bar in one of the T5 component archives but there are no examples as to how to use it and I'm not even sure if it works. I imagine that if I wanted just a simple field on a page that updated with a % then I would have Javascript make an AJAX get and obtain a value from the server. However, as I'm a complete newbie to AJAX, an example of how to do this would be extremely helpful. Example silly questions: does my field have to be in a Zone? Or aren't Zones relevant seeing as I would be making the AJAX get in my own Javascript. Also, would the % value updated by my process just be held in a @Persist field? Anyway - some pointers or hints would be greatly appreciated. Regards, c.
Triggering zone update in component
Hi All, I have a simple page with a component in it. This component contains a zone. I would like to be able to update the zone from the parent page. At the moment I am using an actionlink handler in the parent to call the handler in the component - but this results in a full page re-render of the parent. So what's the best way of updating a component's zone from it's parent page? Many thanks Richard. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org