upload files an zone
Hi all, I'm new to tapestry and have the following issue. I have a form with upload field in it. I use: @Property @Persist private UploadedFile file; After executing a button action, I try to refresh a zone, out of the form, and to fill it with the file content. Without zone it works fine, but I do not want to refresh the whole page, just the dynamic content part, so I put the zone, but after that I got some problem with the file persistence - it's not persisted at all, when I try to access it, I got null pointer. Оригинално писмо От: nn kk Относно: How to add dinamic content До: users@tapestry.apache.org Изпратено на: Неделя, 2013, Август 18 14:28:32 EEST Hi all, I want to be able to create and insert component dynamicly. For example, I want to have quot;add buttonquot; and by every click to add whole new tapestry page or component. I don't know how many addings will I have, I want this to be handeled dynamicly. It's like using spring to return ModelAndView object by ajax request and inserting it in some UI container. - Само сега спечели смартфон SAMSUNG и още много награди!виж http://www.specheli.eu/specheli-textgbg.php - Само сега спечели смартфон SAMSUNG и още много награди!виж http://www.specheli.eu/specheli-textgbg.php - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: upload files an zone
Standard tapestry upload component doesn't work with ajax requests and so it can not be used in zone. You can try custom solution like this: http://mutabra.blogspot.com/2012/07/tapestry-ajax-upload-fixin.html Or this: http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/ On Tue, Aug 20, 2013 at 10:31 AM, nn kk inv...@abv.bg wrote: Hi all, I'm new to tapestry and have the following issue. I have a form with upload field in it. I use: @Property @Persist private UploadedFile file; After executing a button action, I try to refresh a zone, out of the form, and to fill it with the file content. Without zone it works fine, but I do not want to refresh the whole page, just the dynamic content part, so I put the zone, but after that I got some problem with the file persistence - it's not persisted at all, when I try to access it, I got null pointer. Оригинално писмо От: nn kk Относно: How to add dinamic content До: users@tapestry.apache.org Изпратено на: Неделя, 2013, Август 18 14:28:32 EEST Hi all, I want to be able to create and insert component dynamicly. For example, I want to have quot;add buttonquot; and by every click to add whole new tapestry page or component. I don't know how many addings will I have, I want this to be handeled dynamicly. It's like using spring to return ModelAndView object by ajax request and inserting it in some UI container. - Само сега спечели смартфон SAMSUNG и още много награди!виж http://www.specheli.eu/specheli-textgbg.php - Само сега спечели смартфон SAMSUNG и още много награди!виж http://www.specheli.eu/specheli-textgbg.php - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- BR Ivan
Re: upload files an zone
Unfortunately file upload in browsers is pretty archaic and ajax upload is quite difficult and requires a trick or two. For this reason tapestry-core only supports non-ajax file upload out of the box. If you use tapestry-jquery, you can use the ajaxupload component http://tapestry5-jquery.com/components/docsajaxupload Taha has also blogged about using valums file-uploader with tapestry http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/ https://github.com/valums/file-uploader I'm sure if you google for ajax file upload you'll find various other libraries, some supporting drag and drop and multi file upload using various techniques (including flash) which wouldn't be hard to integrate with tapestry.
Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js
Hello, Felix; thanks, yes this would be a good intermediary hack for the time being! Howard; there is a little bit of dependency stuff going on yes and certain situations (as for the carousel) where a small initialization script is required (rather than data attributes doing the work). Would be cool to go full modular at some point; perhaps this is more the work of an add-on project such as tapestry-bootstrap (that's already done some pretty intense 'Tapestr(y)-ification' of bootstrap components. The only terrible side effect of supplying an empty bootstrap.js is that some of the core components will cease to function unless I manually shim in the related js at the right times. We're also trying to use bootstrap fully in less; have included a reduced version of the full bootstrap via the AppModule and in the case of components including just a less file importing the specific component less and its dependencies (often just variables.less and mixins.less). This may be worth another topic; we're trying to figure out some best practices for using Bootstrap modularly and customizing it across multiple sites that require slight or extreme varying style. Really loving the direction 5.4 is taking more and more. Feels much more natural to use than previous iterations! Thanks, Peter P.S.: Bootstrap 3 is now final it seems! Hopefully we'll see it in 5.4 soon if we're lucky! :) - Original Message - From: Felix Gonschorek fe...@netzgut.net To: Tapestry users users@tapestry.apache.org Sent: Monday, August 19, 2013 9:36:52 PM Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js what you can do is a small hack: you can point org.apache.tapestry5.SymbolConstants.BOOTSTRAP_ROOT to a folder with an empty bootstrap.js file and then care by yourselfes to include it everywhere, where it's needed. you could include the minimum bootstrap.js in the border layout and then include the additions (e.g. boostrap-dropdown.js) the same way you are doing it currently where it's needed. On Mon, Aug 19, 2013 at 1:54 PM, Peter Hvass p.hv...@albourne.com wrote: Hi Thiago, Thanks for the reply. I don't think I was clear enough in my first post! In the instance where this is affecting us; Our BootstrapDropdown mixin includes Bootstrap's bootstrap-dropdown.js and Tapestry's core components (in this case, Errors) is including bootstrap.js. Since bootstrap.js also contains the contents of bootstrap-dropdown.js we get a double execution. I'm aware that we could just opt to use bootstrap.js ourselves but I was wondering whether anyone on the dev team would deem using the individual bootstrap-*.js files useful and more modular as opposed to piling in the entire bootstrap.js each time. Thanks! Peter - Original Message - From: Thiago H de Paula Figueiredo thiag...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, August 19, 2013 2:44:51 PM Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js On Mon, 19 Aug 2013 07:10:43 -0300, Peter Hvass p.hv...@albourne.com wrote: Hi all, Hi! We're running into issues where bootstrap.js is included by various core components and scripts are executing twice! Tapestry checks for duplicate additions of the same file and adds it only once, so there's something wrong here: your code or Tapestry. How did you include the JS files in your components? -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
custom logout+logout confirmation page with Tynamo
Hi, since there is no such a configuration(as far as i know) like configuration.override(SecuritySymbols.SUCCESS_URL, ***); in the case of a succesfull logout, i figured out that i must use a custom logout to achieve that. example: t:security.authenticated t:actionlink t:id=logoutLink id=logoutLinkmy custom logout/t:actionlink /t:security.authenticated and then add a Object onActionFromLogoutLink() in my java file. this work perfect and I am redirected to the logout confirmation page as wished. But on my page, I can still see the autogenerated logout link of tynamo, so i have 2 logout links now! how can I prvent the tynamo logoutlink to be shown? thanks - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: AJAX zone refresh not working in IE9 and IE10
Here's what the error console looks like after I click on a link:* **HTML1114: Codepage utf-8 from (HTTP header) overrides conflicting codepage iso-8859-1 from (META tag) ** **start.showabout;jsessionid=1a4um0obrqkoj1a9azzoceuogx** **HTML1113: Document mode restart from Quirks to IE9 Standards ** **start** **HTML1114: Codepage utf-8 from (HTTP header) overrides conflicting codepage iso-8859-1 from (META tag) ** **start *Previously, a separate zone was attached to each link and the AjaxResponseRenderer was used to render the selected zone. Clicking on the link using this style resulted in the following exception: *Exception = org.apache.tapestry5.ioc.internal.OperationException: Page must be specified before initializing for partial page render. [at context:Start.tml, line 102] Cause = org.apache.tapestry5.runtime.ComponentEventException: Page must be specified before initializing for partial page render. [at context:Start.tml, line 102]* Hopefully this provides some clue as to what's happening. On 8/19/2013 4:15 PM, Thiago H de Paula Figueiredo wrote: On Mon, 19 Aug 2013 16:15:47 -0300, Jonathan Martin jmar...@aer.com wrote: Tapestry version 5.3.6 Hmm, it should have an up-to-date version. Have you checked the browser error console for JavaScript errors? On 8/19/2013 2:22 PM, Thiago H de Paula Figueiredo wrote: Hi! Whch Tapestry version? Old ones use an old version of Prototype that didn't support IE9 and IE10 yet. Your code and template look ok. On Mon, 19 Aug 2013 12:07:25 -0300, Jonathan Martin jmar...@aer.com wrote: Greetings, I'm having issues with the zone refresh from an AJAX request in Internet Explorer 9 and 10 (it works fine in IE8, firefox, and chrome). I will click on the link and the new content will appear in the zone for about a half-second, then revert back to the original content. Request.isXHR() is returning false, indicating that a non-AJAX request is occurring, which should not be the case. Is there a way to fix what I have or do these versions of Internet Explorer require a different approach to updating a zone and/or AJAX requests? I've included the relevant tml and java code below. Thanks in advance. -Jonathan Martin *** tml file *** div a t:type=actionlink t:id=showAbout zone=storefrontZone About /a /div div a t:type=actionlink t:id=showTechPapers zone=storefrontZone Papers and Presentations /a /div t:zone t:id=storefrontZone t:update=show t:delegate to=selectedBlock / t:block t:id=aboutBlock span t:id=about / /t:block t:block t:id=techPapersBlock span t:id=techPapers / /t:block /t:zone *** end of tml *** *** java file *** @Inject private Block _aboutBlock; @Inject private Block _techPapersBlock; @Persist private StoreFrontBlocks _selectedBlockEnum; void setupRender(){ _selectedBlockEnum = StoreFrontBlocks.ABOUT; } public Object getSelectedBlock() { Object result = null; switch (_selectedBlockEnum) { case ABOUT: result = _aboutBlock; break; case TECH_PAPERS: result = _techPapersBlock; break; default: break; } return result; } Object onActionFromShowAbout() { _selectedBlockEnum = StoreFrontBlocks.ABOUT; return _request.isXHR() ? _storefrontZone.getBody() : null; } Object onActionFromShowTechPapers() { _selectedBlockEnum = StoreFrontBlocks.TECH_PAPERS; return _request.isXHR() ? _storefrontZone.getBody() : null; } private enum StoreFrontBlocks { TECH_PAPERS, ABOUT } *** end of java *** - 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: custom logout+logout confirmation page with Tynamo
On Tue, Aug 20, 2013 at 5:43 AM, Will N. llcool_wil...@yahoo.fr wrote: since there is no such a configuration(as far as i know) like configuration.override(**SecuritySymbols.SUCCESS_URL, ***); in the case of a succesfull logout, i figured out that i must use a custom logout to achieve that. example: t:security.authenticated t:actionlink t:id=logoutLink id=logoutLinkmy custom logout/t:actionlink /t:security.authenticated and then add a Object onActionFromLogoutLink() in my java file. this work perfect and I am redirected to the logout confirmation page as wished. But on my page, I can still see the autogenerated logout link of tynamo, so i have 2 logout links now! how can I prvent the tynamo logoutlink to be shown? You mean you are using the Tynamo provided login component? Well, quite simply, you could not use it. If you still want to use it, of course you can make it's appearance conditional the same way you just made the appearance of logout link conditional: t:security.authenticated t:actionlink t:id=logoutLink id=logoutLinkmy custom logout/t:actionlink p:else t:tynamo.login .../ /p:else /t:security.authenticated Kalle