Tree Picker inside Zone
Hello, I have a tree picker component placed within a modal. I am trying to integrate a search field into my tree picker component. Within this search field, the user can enter the search text for which I would be executing a db query to find the matching nodes. For this search field I have used zone updater mixin( http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/onevent) to pickup the user entered value. Below is the component calling the the tree picker component (Please ignore the irrelevant parameters passed). Below is my .tml code for my tree picker component http://tapestry.apache.org/schema/tapestry_5_4.xsd"; xmlns:p="tapestry:parameter"> ${treeNode.label} ${treeNode.label} on the .java side I have the following event handler public void onSearch(@RequestParameter(value = "param", allowBlank = true) String searchText) { //do required processing //clear the tree expansions //update the tree model if (request.isXHR()) { ajaxResponseRenderer.addRender(treeZone); } } Unfortunately, my tree structure is not being refreshed, whereas in debug mode I can see that all the realtive methods within the treezone are called. The same zone gets perfectly updated when, I fire the other event "nodeSelected". Any ideas where I could be going wrong? Thanks in advance Best Regards Akshay
Re: [T5.4 beta 28] Date and time picker
Hi Stephen, You can try something like this:- @Inject private AjaxResponseRenderer ajaxResponseRenderer; ajaxResponseRenderer.addRender("YOUR ZONE"); ajaxResponseRenderer.addCallback(new JavaScriptCallback() { @Override public void run(JavaScriptSupport javascriptSupport) { javascriptSupport.require("YOUR JS FILE").invoke("function to be invoked"); } }); Best Regards Akshay On Mon, May 4, 2015 at 1:38 AM, Stephen Nutbrown wrote: > I tried adding this to the DateTimeField without much luck: > > @AfterRender > void afterRender(){ > javascriptSupport.require("datetimefield"); > } > > I don't think this has any effect since the js is already loaded once, > and i'm not 100% certain that this is the problem either. > > On 4 May 2015 at 00:35, Stephen Nutbrown wrote: > > Hi, > > > > I have a quick question (and this isn't anything to do with your code, > > which is fantastic) - it's more to do with how Tapestry handles an > > AjaxFormLoop. > > > > I have this component inside an ajax form loop. When I add a new row, > > it will add in a new component (of type DateTimeField). > > > > However, although the DateTimeField from the previous rows works fine, > > the new one doesn't. I get the feeling this is because the javascript > > wants to be re-initialised - we want to run DateTimeField.js again? > > > > I'm struggling a little bit to find out exactly why this is. There are > > no console errors (either to the java output or JS console), so I > > assume the event handler isn't added to the newly added row. > > > > Any ideas on how I would go about doing that? > > > > I noticed something similar going on with Tapestry's DateField, so i'm > > sure this isn't to do with the component. If I refresh the page, the > > newly added row works fine. > > > > Thanks, > > Steve > > > > On 3 May 2015 at 15:59, Stephen Nutbrown wrote: > >> Hi Dimitris, > >> > >> That's extremely kind and generous of you, thank you! I owe you a few > >> beers, if you happen to have a paypal address hooked up to your email > >> account I can send you a little something (Not much as I'm currently a > >> student myself, but just to buy yourself a few beers on me). > >> > >> Cheers, > >> Steve > >> > >> C > >> > >> On 3 May 2015 at 11:28, Dimitris Zenios > wrote: > >>> Sure I will put them here as an attachment so everybody can see it > >>> > >>> You will also need to > >>> 1.Put the datetimepicker library inside META-INF/modules/datetime/. > >>> 2.Put the datetimepicker css inside META-INF/assets/other/css/. > >>> > >>> The example I have attached is using Java 8 LocalDateTime but it can be > >>> adopted in order to use java.util.Date > >>> > >>> Thanks > >>> Dimitris Zenios > >>> > >>> On Fri, May 1, 2015 at 9:41 PM, Stephen Nutbrown > >>> wrote: > >>>> > >>>> Hi Dimitris, > >>>> > >>>> Wow, as it happens that's the exact same one I was having problems > >>>> implementing! > >>>> > >>>> It would be awesome to have some kind of tapestry5 component > >>>> marketplace. Perhaps another thing for another day. > >>>> I feel very cheeky asking, but would you be up for (able to) send me > >>>> the code, i'd be more than happy to pay for a few drinks for you? > >>>> > >>>> Thanks, > >>>> Steve > >>>> > >>>> On 1 May 2015 at 11:24, Dimitris Zenios > wrote: > >>>> > For tapestry 5.4 i have been using this javascript library > >>>> > https://eonasdan.github.io/bootstrap-datetimepicker/ > >>>> > > >>>> > and a custom component extending AbstractField > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > On Fri, May 1, 2015 at 1:15 PM, Stephen Nutbrown < > steves...@gmail.com> > >>>> > wrote: > >>>> > > >>>> >> Hi, > >>>> >> > >>>> >> I have been looking for a date + time picker for Tapestry. I'd > like a > >>>> >> form component which will bind to a java.util.Date object, and asks > >>>> >&
Re: Dynamic Properties addition to the Grid
Yes, I know that we can add n number of properties, but i believe the scenario , you are trying to talk about is to do with the case when we are aware of the "propertynames" before hand. In my case i only come to know about it during runtime. Wii your logic help me in this case.how would we go about capturing the "name property cell" when we are unsure about the name of it ? Can you please show me an example ? Best Regards Akhsay On 30 Mar 2015 16:43, "Dimitris Zenios" wrote: > You can add as many properties you want.You can also add them via add > method of grid in tml file > > On Mon, Mar 30, 2015 at 5:35 PM, akshay wrote: > > > Hi Dimitris, > > > > Thanks, but will it work, when i have list of properties to be added? > > > > I am aware that we can add the property,like the way u have said or we > can > > just have mymodel.add("propertyname") and hijack name cell in the tml for > > further actions. > > > > I havent given a try, just had a view looking into the approach. > > > > Regards > > Akshay > > On 30 Mar 2015 16:26, "Dimitris Zenios" > wrote: > > > > > try myModel.addEmpty("propertyName"); > > > > > > > > > and in the tml class > > > you can do > > > > > > > > > ${value.propertyName} > > > > > > > > > > > > Regards > > > Dimitris Zenios > > > > > > On Mon, Mar 30, 2015 at 4:54 PM, akshay > > wrote: > > > > > > > Hi All, > > > > > > > > > > > > I am trying to add properties to the grid dynamically. Below I have > > > > described, what I try to acheive:- > > > > > > > > @Property > > > > private BeanModel myModel; > > > > @Inject > > > > private BeanModelSource beanModelSource; > > > > > > > > > > > > myModel= beanModelSource.createDisplayModel(A.class, > > > > messages); > > > > > > > > //logic for including and re-ordering existing properties defined in > > > model > > > > class A. > > > > > > > > //some database calls and then we add the new properties based on > > > business > > > > logic > > > > > > > > myModel.add("new propertyName", "valueToBeShown"); > > > > > > > > The method used here is "add(String propertyName, String > expression);" > > > > > > > > For ex:- The new property name can be "status" with the values as > read > > > from > > > > db > > > > > > > > > > > > > > > > I get an exception stating that "Exception generating conduit for > > > > expression 'valueToBeShown': Class mint.abc.model.A does not contain > a > > > > property (or public field) named 'valueToBeShown'. > > > > > > > > I think, I need to use Property Conduit somehow to fix this, I am > > unsure > > > > about the usage of the same . Any help will be appreciated. > > > > > > > > > > > > > > > > > > > > > > > > Best Regards! > > > > Akshay > > > > > > > > > >
Re: Dynamic Properties addition to the Grid
Hi Dimitris, Thanks, but will it work, when i have list of properties to be added? I am aware that we can add the property,like the way u have said or we can just have mymodel.add("propertyname") and hijack name cell in the tml for further actions. I havent given a try, just had a view looking into the approach. Regards Akshay On 30 Mar 2015 16:26, "Dimitris Zenios" wrote: > try myModel.addEmpty("propertyName"); > > > and in the tml class > you can do > > > ${value.propertyName} > > > > Regards > Dimitris Zenios > > On Mon, Mar 30, 2015 at 4:54 PM, akshay wrote: > > > Hi All, > > > > > > I am trying to add properties to the grid dynamically. Below I have > > described, what I try to acheive:- > > > > @Property > > private BeanModel myModel; > > @Inject > > private BeanModelSource beanModelSource; > > > > > > myModel= beanModelSource.createDisplayModel(A.class, > > messages); > > > > //logic for including and re-ordering existing properties defined in > model > > class A. > > > > //some database calls and then we add the new properties based on > business > > logic > > > > myModel.add("new propertyName", "valueToBeShown"); > > > > The method used here is "add(String propertyName, String expression);" > > > > For ex:- The new property name can be "status" with the values as read > from > > db > > > > > > > > I get an exception stating that "Exception generating conduit for > > expression 'valueToBeShown': Class mint.abc.model.A does not contain a > > property (or public field) named 'valueToBeShown'. > > > > I think, I need to use Property Conduit somehow to fix this, I am unsure > > about the usage of the same . Any help will be appreciated. > > > > > > > > > > > > Best Regards! > > Akshay > > >
Dynamic Properties addition to the Grid
Hi All, I am trying to add properties to the grid dynamically. Below I have described, what I try to acheive:- @Property private BeanModel myModel; @Inject private BeanModelSource beanModelSource; myModel= beanModelSource.createDisplayModel(A.class, messages); //logic for including and re-ordering existing properties defined in model class A. //some database calls and then we add the new properties based on business logic myModel.add("new propertyName", "valueToBeShown"); The method used here is "add(String propertyName, String expression);" For ex:- The new property name can be "status" with the values as read from db I get an exception stating that "Exception generating conduit for expression 'valueToBeShown': Class mint.abc.model.A does not contain a property (or public field) named 'valueToBeShown'. I think, I need to use Property Conduit somehow to fix this, I am unsure about the usage of the same . Any help will be appreciated. Best Regards! Akshay
Re: Redirecting to a Page with context
Hi Thiago, Thanks for your response. I already solved the issue using PageRenderLinkSource. Regards Akshay On Mon, Jan 26, 2015 at 1:26 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Sat, 24 Jan 2015 13:10:10 -0200, akshay > wrote: > > Hi, >> > > Hi! > > Can anyone please suggest me a way of redirecting/rendering a page with >> context from my current page. >> > > I'm sorry, I'm not following you. Redirecting and rendering a page are > completely different actions with completely different outcomes. > > >> This what I have been doing:- >> >> @Inject >> private ComponentSource componentSource; >> >> Object onActivate(){ >> return componentResources.getPage(getPageName()); >> //This works fine till the time I have valid logical page name such as >> "/project/index". It fails when I add a context to it such as >> project/details/10871(which is because I believe it expects only the >> logical page name(existing in the package) without the context. >> } >> > > The code above is incorrect and would never work with a context. Anyway, > you seem to be trying to build the URL yourself. Don't do that. Let > Tapestry do that for you. > > You can do way simpler: > > @InjectPage > private YourTargetPage yourTargetPage; > > Object onActivate() { > yourTargetPage.setXXX(...); > yourTargetPage.setYYY(...); > return yourTargetPage; > } > > This supposes YourTargetPage has correctly implemented onActivate() and > onPassivate(). > > You could also @Inject PageRenderLinkSource and use its methods. > > Anyway, check http://tapestry.apache.org/page-navigation.html. It has > everything you need to know about going from one page to another in > Tapestry. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Redirecting to a Page with context
Hi Chris, Well I have already tried using PageRenderLinkSource for getting the link"project/details/10871". Once I get the link I transfrom it to absolute URI and then java.net.URL to render the specific page( which is not tapestry way). The PageRenderLinkSource gives you the link, but we need something to render it(if am not mistaken). I cannot use @InjectPage, as my pages to be rendered are decided dynamically. Best Regards Akshay On Sat, Jan 24, 2015 at 4:15 PM, Chris Poulsen wrote: > PageRenderLinkSource or @InjectPage / set fields / return page / rely on > onPassivate > > On Sat, Jan 24, 2015 at 4:10 PM, akshay wrote: > > > Hi, > > > > Can anyone please suggest me a way of redirecting/rendering a page with > > context from my current page. > > > > This what I have been doing:- > > > > @Inject > > private ComponentSource componentSource; > > > > Object onActivate(){ > > return componentResources.getPage(getPageName()); > > //This works fine till the time I have valid logical page name such as > > "/project/index". It fails when I add a context to it such as > > project/details/10871(which is because I believe it expects only the > > logical page name(existing in the package) without the context. > > } > > > > I am looking for a tapestry solution for this.Has anyone tried > > redirecting/rendering to the page with context. > > > > -- > > Best Regards!! > > Akshay > > > -- Cheers!! Akshay
Redirecting to a Page with context
Hi, Can anyone please suggest me a way of redirecting/rendering a page with context from my current page. This what I have been doing:- @Inject private ComponentSource componentSource; Object onActivate(){ return componentResources.getPage(getPageName()); //This works fine till the time I have valid logical page name such as "/project/index". It fails when I add a context to it such as project/details/10871(which is because I believe it expects only the logical page name(existing in the package) without the context. } I am looking for a tapestry solution for this.Has anyone tried redirecting/rendering to the page with context. -- Best Regards!! Akshay
RE: Correct usage of BeanEditForm to auto generate form, how to ?
HI Deepak, please have a look at the below documentation :- http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html 2. You do not need the constructor explicitly defined I believe. And this is with java, you do not need super in the parameterized constructor, that just calls object's constructor...which is implicit. 3.you can initialize the celebrity class in setup or begin render method of your addcelebrity.java, and everything should be fine. Best regards Akshay -Original Message- From: "Deepak" Sent: 16-12-2014 18:37 To: "Tapestry users" Subject: Re: Correct usage of BeanEditForm to auto generate form, how to ? > > I've started learning Tapestry with ver 5.3.7 from the book by Alexander > Koleshnikov. I'm having problems using BeanEditForm to create a form: > > Render queue error in SetupRender[AddCelebrity:celebrityform.editor]: > Exception instantiating instance of tapestry5.inaction.model.Celebrity > (for > component 'AddCelebrity:celebrityform.editor'): > org.apache.tapestry5.ioc.internal.OperationException: No service > implements > the interface java.lang.String. > > Celebrity.java > --- > public class Celebrity { > private long id; > private String firstName; > private String lastName; > private Date dateOfBirth; > private Occupation occupation; > private String biography; > private boolean birthDateVerified; > public Celebrity() { > } > public Celebrity(String firstName, String lastName, Date dateOfBirth, > Occupation occupation) { > super(); > this.firstName = firstName; > this.lastName = lastName; > this.dateOfBirth = dateOfBirth; > this.occupation = occupation; > } > > // getter and setter methods > } > > > AddCelebrity.tml > --- > > > AddCelebrity.java > - > public class AddCelebrity { > @Persist > @Property > private Celebrity celebrity; > > } > > What am I doing wrong ? > > Thanks, > Deepak >
RE: [5.4-beta-22] Adding forms to a form using ajax
Hi Muhammad, That's what I try to explain in my example, that instead of making the fields driven by select component Ajax, one can use a single form to show or hide them, when the select compinent is changed. I tried using if in my example, may be if u have multiple fields or logic , you can use a block and delegate to them accordingly , keeping eveything in the same single form. Regards Akshay -Original Message- From: "Muhammad Gelbana" Sent: 14-12-2014 21:09 To: "Tapestry users" Subject: Re: [5.4-beta-22] Adding forms to a form using ajax @Thiago I need the server to populate these fields with default values. Also the fields will be unexpected until runtime because the selected element in the Select component is essential to decide which fields to display. These fields are even database driven so the displayed fields cannot be known until the Select component is changed. I really think this is a very reasonable\common requirement. @Akshay May be my question wasn't clear enough. I can do ajax forms, but I'm trying to add fields to the form using ajax. *-* *Muhammad Gelbana* http://www.linkedin.com/in/mgelbana On Sun, Dec 14, 2014 at 9:09 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > > On Sun, 14 Dec 2014 07:22:00 -0200, Muhammad Gelbana > wrote: > > The ajax-form-loop does it but it doesn't fit my scenario. I need to >> display portions of the form based on a Select component changed value. >> And even if I try to do it using the Select component change event, I >> don't >> need to add rows. I just need to update a zone with different form fields. >> > > Cannot you use the easy, simple way of having the whole form, with all > fields rendered and showing or hiding them? > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: [5.4-beta-22] Adding forms to a form using ajax
Hi, Why don't you try something like this. May not to be the best way but should work fine. Juts try removing the extra zone that you try to render from your form and do like below:- x.tml input fields other input fields based on the select field x.java @Property @Persist private boolean flag; void onSelectedFromFilter(){ flag=true; your logic } void onSelectedFromSave(){ proceed with your logic and if you want to hide the extra part just make the flag as false }. This way you are avoiding the extra zone rendering, whereas your current form is still ajax. Best Regards Akshay On Sun, Dec 14, 2014 at 10:22 AM, Muhammad Gelbana wrote: > > The ajax-form-loop does it but it doesn't fit my scenario. I need to > display portions of the form based on a Select component changed value. And > even if I try to do it using the Select component change event, I don't > need to add rows. I just need to update a zone with different form fields. > I even sometimes need to do it using an Event\Action link. Its nothing no > one else tried to do ! > > I appreciate your time. Thank you. > > *-* > *Muhammad Gelbana* > http://www.linkedin.com/in/mgelbana > > On Sat, Dec 13, 2014 at 11:45 AM, Diego Socaceti > wrote: > > > Hi, > > > > have to tried to use the AjaxFormLoop > > > > > http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.html > > > > I just found it in the API docs. > > Unfortunately there are no 5.4 jumpstart examples, but i think you can > > adapt the one from 5.3 > > > > http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1 > > > > > http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloopwithholders1 > > > > > http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formlooptailored1 > > > > > > Kind regards > > > -- Cheers!! Akshay
Re: prevent ajax form submit
Hi Carlos, Ah is just see that i just missed adding the following code :- ajaxResponseRenderer.addRender(zone1).addRender(zone2); This will work for sure :) Answer for your question: Yes we have to bind the form under the zone if you want it to be ajax: Taken from Tapestry doc:- the zone parameter will cause the form submission to be handled as an Ajax request that updates the indicated zone. Often a Form will update the same zone that contains it. Just remove the javascript that you use , as tapestry provides you with an inbuilt solution as above. You donot specifically need to do event.preventDefault(); Try it out. Regards Akshay On Thu, Dec 11, 2014 at 8:27 AM, Carlos Gómez Montiel wrote: > Any last question: > > Have you ALWAYS wrap an ajax form inside a zone like below? > > > > > > > > In my first example the form isn't wrapped but it works fine. I wonder if > it is correct: > > > > > > > > > Thanks in advance > > > 2014-12-11 0:05 GMT-06:00 Carlos Gómez Montiel : > > > George, yes I'm using tapestry-jquery but in the links you wrote is the > > solution: > > > > $("#form1").submit(function(event) { > >event.preventDefault(); > > event.stopImmediatePropagation(); // it prevents the submit hit > > }); > > > > Thank you for your feedback and comments. > > > > > > > > 2014-12-10 23:20 GMT-06:00 George Christman : > > > > hmm I see your using jquery and I know 3.7 uses prototype. Are you using > >> Tapestry-Jquery or bringing in jquery with no conflict? > >> > >> You can write your own mixin to handle this, your not required to have > to > >> use 5.4 to get this to work. > >> > >> Here's an example of how Tapestry-Jquery is getting this to work using > >> jquery in 3.7 > >> > >> http://tapestry5-jquery.com/mixins/docsconfirm > >> > >> > >> > https://github.com/got5/tapestry5-jquery/blob/v3.3.7/src/main/java/org/got5/tapestry5/jquery/mixins/Confirm.java > >> > >> > >> > https://github.com/got5/tapestry5-jquery/blob/v3.3.7/src/main/resources/org/got5/tapestry5/jquery/assets/mixins/confirm/confirm.js > >> > >> On Thu, Dec 11, 2014 at 12:06 AM, Carlos Gómez Montiel < > ibe...@gmail.com> > >> wrote: > >> > >> > Thank you for your answer George: > >> > > >> > > The other more recommended way if it's just a simple confirm box is > to > >> > use the confirm mixin > >> > I'm using tapestry 5.3.7 > >> > > >> > I had change my example with your recomendations: > >> > > >> > .tml > >> > > >> > > >> > $(document).ready(function() { > >> > $("#form1").submit(function() { > >> > return false; > >> > }); > >> > }); > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > .java > >> > @Inject > >> > private AjaxResponseRenderer ajaxResponseRenderer; > >> > @InjectComponent > >> > private Zone zone2; > >> > > >> > void onSelected() { > >> > ajaxResponseRenderer.addRender(zone2); > >> > } > >> > > >> > > >> > But the effect is the same, the ajax post is sent to server. Anyone > can > >> > help me how can I stop the ajax form submit? > >> > > >> > Thanks in advance > >> > > >> > 2014-12-10 22:25 GMT-06:00 George Christman >: > >> > > >> > > Take a look at this page, it will show you the life cycle of the > >> tapestry > >> > > methods. You are returning zone2 in your onSuccess method. and > >> probably > >> > > should use onSelected > >> > > > >> > > > >> > > > >> > > >> > http://jumpstart.doublenegative.com.au/jumpstart7/examples/navigation/whatiscalledandwhen > >> > > > >> > > One way to do it to use an event handler and on the backend return > the > >
Re: prevent ajax form submit
Hi, your structure should look like this: .tml strcuture:- Your Content The .java file structure @InjectComponent private Zone zone1,zone2; @Inject private AjaxResponseRender OnSuccess(){ ajaxResponseRenderer.addRender(zone2) or zone2.getBody(); } Regards Akshay On Wed, Dec 10, 2014 at 11:25 PM, Carlos Gómez Montiel wrote: > Thank you for your answer George. > > > Are you trying to create an ajax form submit? If so, you should be > wrapping the form with the zone > > Yes, I'm trying to create an ajax form submit, I don't understand why I > should be wrapping the form with the zone, what is the reason? as far I > know in my example I'm sending the form via ajax and then refreshing the > zone 'zone1' returning the zone1's body in the onsuccess() event in the > .java > > >As far as the confirm dialog goes, you could either > use a confirm mixin or if you chose to use a zone style approach, on submit > return another zone for your confirm dialog. > > I'm using a mixin for show the confirm dialog (with bootstrap) but don't > found how to prevent the ajax form's submit. Any one can help me with it? > > Thanks in advance > > > > 2014-12-10 7:44 GMT-06:00 George Christman : > > > Are you trying to create an ajax form submit? If so, you should be > wrapping > > the form with the zone. As far as the confirm dialog goes, you could > either > > use a confirm mixin or if you chose to use a zone style approach, on > submit > > return another zone for your confirm dialog. > > > > On Wed, Dec 10, 2014 at 3:47 AM, Carlos Gómez Montiel > > wrote: > > > > > Hi there > > > > > > How can I prevent ajax form's event submit when the user clicks a > submit > > > button? > > > I need to prevent the event for show an confirm dialog before it will > be > > > submited. > > > > > > My form: > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks in advance > > > > > > > > > > > -- > > George Christman > > CEO > > www.CarDaddy.com > > P.O. Box 735 > > Johnstown, New York > > > -- Cheers!! Akshay
RE: Property Values to be modified
Hi Yes,I agree to your point,have tried that also. Infact, the idea to intialize it in the way given below is taken from the Grid component of tapestry,as I am trying to build a customized grid over the tapestry default grid. The value transferred from Component A to B doesn't seem to be a problem...Its the transfer of field value from B to A using the method as given in the mail.Not sure if there is something to do with the binding stuff or I am overlooking something here. Thanks Akshay -Original Message- From: "Chris Poulsen" Sent: 21-11-2014 17:07 To: "Tapestry users" Subject: Re: Property Values to be modified don't initialize the property where you declare it. Use onActivate setupRender or similar to set det default value On Fri, Nov 21, 2014 at 4:06 PM, akshay wrote: > Hi Thiago, > > Yes it should be field, just a typo :). But anyways, below is the > scneario:- > > > I have a component A and Component B > > > Component A{ > > @Component(id = "B", parameters = { "sortAscending=sortAscending"}) > private ComponentB b; > > @Property > private boolean sortAscending=true; > > > } > > > Component B{ > > @Persist > private ComponentA a; > > @Parameter(required = true) > private boolean sortAscending; > > Object setupRender(){ > > > a.updateXXX(sortAscending); > > }} > > When the values is true, which is set by default it works all fine. But > when the value is moved to false, On debug I see that > the value stored by sortAscending in ComponentB is correct but as soon as > it goes within the method a.updateXXX(sortAscending), its > its replaced by true. > > For identifying the reason, I checked that my property conduit value is > always true in component B. I just changed the value of the conduit > properties manually through debugger to false and then made the call to the > above metioned component method and everything worked fine. This leads me > to a conclusion that the conduit field property has something to do > here, if I am not doing something wrong here. > > > Best Regards > Akshay > > On Fri, Nov 21, 2014 at 3:41 PM, Thiago H de Paula Figueiredo < > thiag...@gmail.com> wrote: > > > On Fri, 21 Nov 2014 12:13:51 -0200, akshay > > wrote: > > > > Dear all, > >> > >> I have a strange scenario like below :- > >> > >> I have a component A > >> { > >> @Parameter(required = true) > >> private boolean isXYZ; > >> > >> } > >> > >> > >> On debug, i see two parameters associated to the above field > >> > >> -isXYZ and isXYZ_FieldConduit. > >> > > > > They're not parameters. They're fields. Please use the right vocabulary > or > > people won't understand what you're saying. :) > > > > Somehow, the values of both the fields are loaded differently and are > not > >> in sync. > >> > > > > the _FieldConduit thing is actually a PropertyConduit instance, not the > > field type, so they're supposed to be different. You shouldn't worry > about > > the _FieldConduit thing at all. > > > > Is production mode off? If yes, Tapestry should keep the field updated. > > > > What exactly is the problem you're having? > > > > May be its something which is just against the tapestry way. Not sure, > >> any suggestion will be helpful. > >> > > > > This is actually how Tapestry works on page, component and mixin fields: > > by transforming them. ;) This field, which is a parameter, is only left > on > > class, but any access to it (setting a value or reading it) is done > through > > the PropertyConduit. > > > > -- > > Thiago H. de Paula Figueiredo > > Tapestry, Java and Hibernate consultant and developer > > http://machina.com.br > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > > -- > Cheers!! > Akshay >
Re: Property Values to be modified
Hi Thiago, Yes it should be field, just a typo :). But anyways, below is the scneario:- I have a component A and Component B Component A{ @Component(id = "B", parameters = { "sortAscending=sortAscending"}) private ComponentB b; @Property private boolean sortAscending=true; } Component B{ @Persist private ComponentA a; @Parameter(required = true) private boolean sortAscending; Object setupRender(){ a.updateXXX(sortAscending); }} When the values is true, which is set by default it works all fine. But when the value is moved to false, On debug I see that the value stored by sortAscending in ComponentB is correct but as soon as it goes within the method a.updateXXX(sortAscending), its its replaced by true. For identifying the reason, I checked that my property conduit value is always true in component B. I just changed the value of the conduit properties manually through debugger to false and then made the call to the above metioned component method and everything worked fine. This leads me to a conclusion that the conduit field property has something to do here, if I am not doing something wrong here. Best Regards Akshay On Fri, Nov 21, 2014 at 3:41 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Fri, 21 Nov 2014 12:13:51 -0200, akshay > wrote: > > Dear all, >> >> I have a strange scenario like below :- >> >> I have a component A >> { >> @Parameter(required = true) >> private boolean isXYZ; >> >> } >> >> >> On debug, i see two parameters associated to the above field >> >> -isXYZ and isXYZ_FieldConduit. >> > > They're not parameters. They're fields. Please use the right vocabulary or > people won't understand what you're saying. :) > > Somehow, the values of both the fields are loaded differently and are not >> in sync. >> > > the _FieldConduit thing is actually a PropertyConduit instance, not the > field type, so they're supposed to be different. You shouldn't worry about > the _FieldConduit thing at all. > > Is production mode off? If yes, Tapestry should keep the field updated. > > What exactly is the problem you're having? > > May be its something which is just against the tapestry way. Not sure, >> any suggestion will be helpful. >> > > This is actually how Tapestry works on page, component and mixin fields: > by transforming them. ;) This field, which is a parameter, is only left on > class, but any access to it (setting a value or reading it) is done through > the PropertyConduit. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Property Values to be modified
Dear all, I have a strange scenario like below :- I have a component A { @Parameter(required = true) private boolean isXYZ; } On debug, i see two parameters associated to the above field -isXYZ and isXYZ_FieldConduit. Somehow, the values of both the fields are loaded differently and are not in sync. I want the value of isXYZ_FieldConduit. to be same as the isXYZ ( which should be the default working scenario for the tapestry). Hence, when i used the above parameter to be passed to another component its always passed incorrectlly since the field conduit value is incorrect. Now, I look for a solution where in, I can hijack and change the value of "password_FieldConduit". I see that there exists a class called Transform Field/ClassTransformation which has something to do with it, but I am not sure about its usage or is it really possible to do it. May be its something which is just against the tapestry way. Not sure, any suggestion will be helpful. Regards!! Akshay
Tapestry Editable Grids
Hi, I am trying to implement an editable grid. I have referenced Jump Start example:- http://jumpstart.doublenegative.com.au/jumpstart7/examples/tables/editablegrid1 My code logic- I have to use inplace="true", so that there is an ajax loading of table without the page being reloaded again. But the problem comes, when I try to switch to another page within the table, I get the following error:- component config/Console:preferencesconsole.preferencevalue must be enclosed by a Form component. at org.apache.tapestry5.corelib.base.AbstractField.setup(AbstractField.java:192) at org.apache.tapestry5.corelib.base.AbstractField.setupRender(AbstractField.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:176) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:145). I know that the problem is with the usage of inplace="true", but I need it in my case. Anyone who faced similar issue or has a solution for such a case. Regards And Thanks Akshay
Re: Tapestry Production Mode
Hi Thiago, Thanks for all your responses.I am still stuck with the problem related to the loading of images , when less to css compilation is forced by us. As I told you: In the less file the images are referenced with paths, like @product: url(../images/product.svg)--( though I agree that we can provide it with a prefix, but anyways this convention still use to work for me before). The tapestry considers the images as an asset and translates the given path as :- (/appContext/assets/ctx/6787fbc2/images/product.svg), when I use the tapestry default Less to css compilation But in my case the url path remains the same as "../images/product.svg" in the translated css, and is not treated as an asset. My approach:- xyz.less--which imports other less files containing I am directly using @Inject @Path("context:css/xyz.less") private Asset lessFile; LessResourceTransformer lessResourceTransformer = new LessResourceTransformer() return lessResourceTransformer.transform(lessFile.getResource(), new ResourceDependencies() { @Override public void addDependency(Resource dependency) { } }); I debugged and found out that the images are created as an asset in AbstratAssetFactory class along with the help of few more classes. These classes are called very early in the framework flow, and are complex to re-use. As per my understanding , the Less transformer should by default take care of parsing and creating the url as (/appContext/assets/ctx/6787fbc2/images/product.svg) in the less file. Debugging into the LessResourceTransformer class(which has very less java docs),makes bit tough for me to find out the actual solution to it. Any suggestions from you would be of great help. Best Regards Akshay * On Thu, Oct 9, 2014 at 10:44 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 09 Oct 2014 17:18:04 -0300, akshay > wrote: > > Hi Thaigo, >> >> Well the Url is :- >> >> localhost:8080/WebPortal/config/lessToCss >> > > So the URL should have been "/WebPortal/config/lessToCss". > > To avoid hardcoding, you can do this: > > @Inject > private PageRenderLinkSource pageRenderLinkSource; > ... > String cssUrl = pageRenderLinkSource.createPageRenderLink( > LessToCss.class).toAbsoluteURI(); > javaScriptSupport.importStylesheet(new StylesheetLink(cssUrl)); > > This will always work, as you're delegating the URL creation to Tapestry. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thaigo, Well the Url is :- localhost:8080/WebPortal/config/lessToCss Regards Akshay On Thu, Oct 9, 2014 at 10:12 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 09 Oct 2014 17:10:47 -0300, akshay > wrote: > > Hi Thiago, >> >> >> Yes i see the streamed response generated. >> > > What's its URL? > > > >> Regards >> Akshay >> >> On Thu, Oct 9, 2014 at 10:01 PM, Thiago H de Paula Figueiredo < >> thiag...@gmail.com> wrote: >> >> When you request your page file directly, do you get the transformed CSS? >>> >>> >>> On Thu, 09 Oct 2014 16:40:32 -0300, akshay >>> wrote: >>> >>> Hi Thiago, >>> >>>> >>>> Well I use tapestry 5.4. >>>> >>>> i) WhenvI tried using in tapestry 5.3 way:- >>>> javaScriptSupport.importStylesheet(new >>>> StylesheetLink("/config/lessToCss")); >>>> >>>> By doing this I see an empty lessToCss streamed file loaded.On >>>> debugging I >>>> see that the page itself was never fired. Looks like just a normal >>>> import >>>> happens. >>>> >>>> >>>> ii) Doing it in tapestry 5.4 way:- >>>> @Import(stylesheet="//:config/lessToCss") >>>> >>>> It doesnt even import the file, i dont even see the file getting loaded. >>>> >>>> Its tough time getting this worked :( >>>> >>>> Regards >>>> Akshay >>>> >>>> >>>> >>>> >>>> On Thu, Oct 9, 2014 at 8:59 PM, Thiago H de Paula Figueiredo < >>>> thiag...@gmail.com> wrote: >>>> >>>> On Thu, 09 Oct 2014 12:19:17 -0300, akshay >>>> >>>>> wrote: >>>>> >>>>> Hi Thiago, >>>>> >>>>> >>>>>> >>>>>> Hi! >>>>> >>>>> >>>>> Well, I was trying the implement the solution given by you, but I see >>>>> a >>>>> >>>>>> problem. >>>>>> >>>>>> i) my lessToCSS page is located at the package:- >>>>>> abc.wp.pages.config. >>>>>> >>>>>> ii) First I tried doing this in Tapestry 5.4 way:- >>>>>> @Import(stylesheet="//:config/lessToCss") >>>>>> It doesn't work. >>>>>> >>>>>> >>>>>> Please don't say it doesn't work, as it's almost no information. >>>>> >>>>> @Import with "//:" will only work on 5.4, not on 5.3, which you said >>>>> you're using. >>>>> >>>>> iii) But when I try achieving the same doing this way:- >>>>> >>>>> javaScriptSupport.importStylesheet(new >>>>>> StylesheetLink("../config/lessToCss")); >>>>>> >>>>>> >>>>>> It should have been "/config/lessToCss", which is absolute, without >>>>> the >>>>> "../", which is relative. Tapestry will take care of adjusting the path >>>>> if >>>>> needed. >>>>> >>>>> >>>>> -- >>>>> Thiago H. de Paula Figueiredo >>>>> Tapestry, Java and Hibernate consultant and developer >>>>> http://machina.com.br >>>>> >>>>> - >>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>>>> For additional commands, e-mail: users-h...@tapestry.apache.org >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>> -- >>> Thiago H. de Paula Figueiredo >>> Tapestry, Java and Hibernate consultant and developer >>> http://machina.com.br >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >> >> > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Yes i see the streamed response generated. Regards Akshay On Thu, Oct 9, 2014 at 10:01 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > When you request your page file directly, do you get the transformed CSS? > > > On Thu, 09 Oct 2014 16:40:32 -0300, akshay > wrote: > > Hi Thiago, >> >> Well I use tapestry 5.4. >> >> i) WhenvI tried using in tapestry 5.3 way:- >> javaScriptSupport.importStylesheet(new >> StylesheetLink("/config/lessToCss")); >> >> By doing this I see an empty lessToCss streamed file loaded.On debugging I >> see that the page itself was never fired. Looks like just a normal import >> happens. >> >> >> ii) Doing it in tapestry 5.4 way:- >> @Import(stylesheet="//:config/lessToCss") >> >> It doesnt even import the file, i dont even see the file getting loaded. >> >> Its tough time getting this worked :( >> >> Regards >> Akshay >> >> >> >> >> On Thu, Oct 9, 2014 at 8:59 PM, Thiago H de Paula Figueiredo < >> thiag...@gmail.com> wrote: >> >> On Thu, 09 Oct 2014 12:19:17 -0300, akshay >>> wrote: >>> >>> Hi Thiago, >>> >>>> >>>> >>> Hi! >>> >>> >>> Well, I was trying the implement the solution given by you, but I see a >>>> problem. >>>> >>>> i) my lessToCSS page is located at the package:- >>>> abc.wp.pages.config. >>>> >>>> ii) First I tried doing this in Tapestry 5.4 way:- >>>> @Import(stylesheet="//:config/lessToCss") >>>> It doesn't work. >>>> >>>> >>> Please don't say it doesn't work, as it's almost no information. >>> >>> @Import with "//:" will only work on 5.4, not on 5.3, which you said >>> you're using. >>> >>> iii) But when I try achieving the same doing this way:- >>> >>>> javaScriptSupport.importStylesheet(new >>>> StylesheetLink("../config/lessToCss")); >>>> >>>> >>> It should have been "/config/lessToCss", which is absolute, without the >>> "../", which is relative. Tapestry will take care of adjusting the path >>> if >>> needed. >>> >>> >>> -- >>> Thiago H. de Paula Figueiredo >>> Tapestry, Java and Hibernate consultant and developer >>> http://machina.com.br >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >> >> > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Well I use tapestry 5.4. i) WhenvI tried using in tapestry 5.3 way:- javaScriptSupport.importStylesheet(new StylesheetLink("/config/lessToCss")); By doing this I see an empty lessToCss streamed file loaded.On debugging I see that the page itself was never fired. Looks like just a normal import happens. ii) Doing it in tapestry 5.4 way:- @Import(stylesheet="//:config/lessToCss") It doesnt even import the file, i dont even see the file getting loaded. Its tough time getting this worked :( Regards Akshay On Thu, Oct 9, 2014 at 8:59 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 09 Oct 2014 12:19:17 -0300, akshay > wrote: > > Hi Thiago, >> > > Hi! > > >> Well, I was trying the implement the solution given by you, but I see a >> problem. >> >> i) my lessToCSS page is located at the package:- >> abc.wp.pages.config. >> >> ii) First I tried doing this in Tapestry 5.4 way:- >> @Import(stylesheet="//:config/lessToCss") >> It doesn't work. >> > > Please don't say it doesn't work, as it's almost no information. > > @Import with "//:" will only work on 5.4, not on 5.3, which you said > you're using. > > iii) But when I try achieving the same doing this way:- >> javaScriptSupport.importStylesheet(new >> StylesheetLink("../config/lessToCss")); >> > > It should have been "/config/lessToCss", which is absolute, without the > "../", which is relative. Tapestry will take care of adjusting the path if > needed. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Well, I was trying the implement the solution given by you, but I see a problem. i) my lessToCSS page is located at the package:- abc.wp.pages.config. ii) First I tried doing this in Tapestry 5.4 way:- @Import(stylesheet="//:config/lessToCss") It doesn't work. iii) But when I try achieving the same doing this way:- javaScriptSupport.importStylesheet(new StylesheetLink("../config/lessToCss")); It works fine for few of the pages, obviously because we have static defined page url. So if I, try to access some other page with some different package definition, it is bound to fail. In such cases, I am just thinking what should be the correct approach( I tried using URL , but didn´t get it to work) . Any ideas on this. Regards Akshay
Re: Request Filter and Session State Object
Hi Thiago, Thanks a lot for your concern!!! Just about the time I found the solution, I got your email :) Yes you are right, about the way ApplicationStateManager works. I just debugged and verified it. It becomes bit difficult for someone new , that too when you have to make changes to the tapestry pipeline processes and stuffs like that, since there are so many classes involved. Thanks for all your help!! Regards Akshay On Tue, Oct 7, 2014 at 9:28 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Tue, 07 Oct 2014 16:10:07 -0300, akshay > wrote: > > Hi Thiago, >> > > Hi! > > In the application ,the SSO object is created by the >> contributeApplicationstateManager method(). >> > > No. It's created by the ApplicationStateManager service, using the > contributed ApplicationStateCreator implementations, when it needs to be > created and only then. > > When I debug, I see that the requestHandler method gets called first. >> Since I try to use a SSO object, which is infact not created and only gets >> created post the contributeApplicationstateManager () call. >> > > That's not correct. It's not contributeApplicationStateManager() the > method being called. It's the create() method of the > ApplicationStateCreator instance you contributed to the > ApplicationStateManager service. > > I intend to find a solution, where in I can use the SSO object in my >> requestHandler class. >> > > You can use it any time in any piece of code being executed as part of a > request. I'm sorry, but you're misunderstading how Tapestry works. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > ----- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Request Filter and Session State Object
Hi Thiago, In the application ,the SSO object is created by the contributeApplicationstateManager method(). When I debug, I see that the requestHandler method gets called first. Since I try to use a SSO object, which is infact not created and only gets created post the contributeApplicationstateManager () call. I intend to find a solution, where in I can use the SSO object in my requestHandler class. Regards Akshay On Tue, Oct 7, 2014 at 8:27 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Tue, 07 Oct 2014 14:03:09 -0300, akshay > wrote: > > Hi, >> > > Hi! > > As we know that the contributeRequestHandler(...) is called before the >> contributeApplicationStateManager(...) method. >> > > Why do you say that? I'm not sure that's correct. Anyway, the order here > doesn't make a difference. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, If you were using 5.4, you could @Import(stylesheet="//:yourCss FileFileUrl"); Do you mean the page url?? Because I have Stream response of cssContent. The css file doesnt exist in the workspace. in case I misunderstood, can you highlight an example? Regards Akshay On Tue, Oct 7, 2014 at 5:13 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Tue, 07 Oct 2014 05:53:01 -0300, akshay > wrote: > > Hi Thiago, >> > > Hi! > > > type='text/css'/>. >> >> I already saw the tapestry mailing list about how to override the >> bootstrap.css , but my scenario is bit different as I have a Stream >> Response of css content ( and not a physically present css file). >> >> I need to have a way so that my Streamed css response get loaded after >> the bootstrap.css. >> > > Isn't this happening already? If not, one solution is to @Inject > JavaScriptSupport and use its importStylesheet(new > StylesheetLink("/yourCssFileFileUrl"));. > If you were using 5.4, you could @Import(stylesheet="//: > yourCssFileFileUrl");. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > ----- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Request Filter and Session State Object
Hi, In my App Module, I have these two methods:- public void contributeApplicationStateManager( MappedConfiguration configuration) { ... configuration.add(XZY.class, new ApplicationStateContribution("session", creator)); } The abpve method creates the SSO object. public void contributeRequestHandler(OrderedConfiguration configuration) { configuration.addInstance("RequestFilter", RequestFilter.class, "before:*"); } I want to use my SSO in RequestFilter class. As we know that the contributeRequestHandler(...) is called before the contributeApplicationStateManager(...) method. Do we have a way through which I can access SSO in the request filter class or the request Filter call can take place after the contributeApplicationStateManager() method. Regards!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Thanks for the idea. I have to give a try! whooo :( I see another different problem occurring yesterday, that my streamed css response that is returned from the tapestry page gets overridden by the bootstrap.css. I have something like this in my layout component inside the header tag (which of course is not the best idea). . I already saw the tapestry mailing list about how to override the bootstrap.css , but my scenario is bit different as I have a Stream Response of css content ( and not a physically present css file). I need to have a way so that my Streamed css response get loaded after the bootstrap.css. Any help on this, I was unable to find a relevant documentation for this. Regards Akshay On Mon, Oct 6, 2014 at 11:45 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 06 Oct 2014 06:05:25 -0300, akshay > wrote: > > Hi Thiago, >> > > Hi! > > Yes, of course. I will share the solution, but I have one more >> withstanding >> problem. >> >> In my compiled CSS the image paths are wrong. >> >> In my less file the images are referenced with relative path, like >> >> @product: url(../images/product.svg); >> > > Do your really need relative paths? They usually mess up things when > inside an environment in which URLs may be mapped in a different way as in > the filesystem folders. As you're using some kind of template to generate > the Less file to be compiled, you could pass the prefix to these URLs > instead of using relative paths. > > I can figure out the problem that, in the tapestry way of compilation the >> images are loaded as an assets and tapestry gives the assets the specific >> URLs (as mentioned above) . Since in my case I am using the Less Compiler >> directly, the compiled CSS instead points to the relative path url >> (../images/product.svg). >> > > This could be avoided if you tried to figure out the code inside Tapestry > that deals with Less compilation. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > ----- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Yes, of course. I will share the solution, but I have one more withstanding problem. In my compiled CSS the image paths are wrong. In my less file the images are referenced with relative path, like @product: url(../images/product.svg); and should be (in the compiled CSS) like:- @product: url(/appContext/assets/ctx/6787fbc2/images/product.svg); For compiling the less file to CSS I am doing the following things:- LessResourceTransformer lessResourceTransformer = new LessResourceTransformer(); return lessResourceTransformer.transform(lessFile.getResource(), new ResourceChangeTrackerImpl(new ClasspathURLConverterImpl(),false)); } The ResourceChangeTrackerImpl class is responsible for loading and tracking the assets(images). In the normal flow, this class is injected much before the Less Compiler is called. I can figure out the problem that, in the tapestry way of compilation the images are loaded as an assets and tapestry gives the assets the specific URLs (as mentioned above) . Since in my case I am using the Less Compiler directly, the compiled CSS instead points to the relative path url (../images/product.svg). Any suggestions for this? Regards Akshay On Wed, Oct 1, 2014 at 4:24 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Wed, 01 Oct 2014 11:08:35 -0300, akshay > wrote: > > Hi Thiago, >> > > Hello, Akshay! > > Your idea works.Great!! >> Thanks a lot!!! >> > > Yay! :) > > Is it possible for you to share the solution, so other people with similar > needs can benefit from it? > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Your idea works.Great!! Thanks a lot!!! Regards Akshay On Fri, Sep 26, 2014 at 6:59 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Fri, 26 Sep 2014 12:53:00 -0300, akshay > wrote: > > Hi Thiago, >> > > Hi! > > I believe tapestry 5.4 doesn't have any wro4j related packages. Rather, >> when I debug I see a ResourceTransformer class calling LessCompiler, >> LessToCssCompiler and few other classes. >> > > Yep, 5.3 used wro4j, but 5.4 uses Less4j. Anyway, you can use any of them > directly. What you want to do has different assumptions to the > out-of-the-box Tapestry's Less support. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, I believe tapestry 5.4 doesn't have any wro4j related packages. Rather, when I debug I see a ResourceTransformer class calling LessCompiler, LessToCssCompiler and few other classes. It really looks complicated to directly use and get hold of these classes.(may be i am overlooking something). Regards Akshay On Thu, Sep 25, 2014 at 4:22 PM, akshay wrote: > Hi, > > Is there any way in tapestry 5.4 (*production mode) *where-in, I can > fire the tapestry compiling chain again ( so that my less file are compiled > again). > > I am able to get this done in *development *mode, by adding a request > filter(which picks my dynamic changes on the file), by adding my > RequestHandler in AppModule class:- > > public void contributeRequestHandler( >OrderedConfiguration configuration) { >configuration.addInstance("XYZRequestFilter", >XYZRequestFilter.class, "before:*"); >} > > > But the same approach, doesn't work in production mode( since the caching > mechanism is different). > > Any idea/suggestions would be of great help. > > > Regards, > Akshay > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, No, I give it a try now. Thanks for the response. Will let you know the outcome :) Regards Akshay On Fri, Sep 26, 2014 at 12:00 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 25 Sep 2014 18:53:14 -0300, akshay > wrote: > > Hi Thiago, >> > > Hi! > > I had a servlet before doing this for me , but now with the requirement >> to modify .less files. I converted the Servlet into the Request Filter( >> added that filter into the AppModule class). Doing this yields me the >> desired >> output, but only in development mode(not in production mode). I want to >> achieve the same behavior in production mode. I debugged into the Request >> transfomer class and found that the resources are looked for changes(not >> without a server restart), only in the development mode. >> > > As Lance already said, in production mode, assets are expected to *not* > change, so you need to take another route. In addition, changing the asset > programatically in the filesystem is a bad idea. The Less pipeline doesn't > expect you do that. > > Wondering, how can I get a solution for it. >> > > Have you checked the solution I proposed in my previous e-mail? ;) > > Tapestry uses WRO4J (https://code.google.com/p/wro4j/) for Less > compiling, so you can use easily use it before you generated your Less file. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Tapestry Production Mode
Hi Thiago, Thanks!! Yes I have already done this with css and its pretty simple( much more than modifying .less file). I had a servlet before doing this for me , but now with the requirement to modify .less files. I converted the Servlet into the Request Filter( added that filter into the AppModule class). Doing this yields me the desired output, but only in development mode(not in production mode). I want to achieve the same behavior in production mode. I debugged into the Request transfomer class and found that the resources are looked for changes(not without a server restart), only in the development mode. Wondering, how can I get a solution for it. Regards Akshay On Thu, Sep 25, 2014 at 11:37 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 25 Sep 2014 17:59:33 -0300, akshay > wrote: > > Hi, >> > > Hi! > > I am working on Theming the website and have a requirement where in I can >> directly change the Less variables dynamically(something like color) of >> the menu bar, before they are compiled into the css. >> Do we have any hook around for this? >> > > Without Less, I add a
Re: Tapestry Production Mode
Hi, I am working on Theming the website and have a requirement where in I can directly change the Less variables dynamically(something like color) of the menu bar, before they are compiled into the css. Do we have any hook around for this? Regards Akshay On Thu, Sep 25, 2014 at 8:56 PM, Lance Java wrote: > Went would you want to do that? Css should be considered static. Tapestry > uses far future expire headers for css so that browsers can aggressively > cache them. > On 25 Sep 2014 15:23, "akshay" wrote: > > > Hi, > > > > Is there any way in tapestry 5.4 (*production mode) *where-in, I can > fire > > the tapestry compiling chain again ( so that my less file are compiled > > again). > > > > I am able to get this done in *development *mode, by adding a request > > filter(which picks my dynamic changes on the file), by adding my > > RequestHandler in AppModule class:- > > > > public void contributeRequestHandler( > >OrderedConfiguration configuration) { > >configuration.addInstance("XYZRequestFilter", > >XYZRequestFilter.class, "before:*"); > >} > > > > > > But the same approach, doesn't work in production mode( since the caching > > mechanism is different). > > > > Any idea/suggestions would be of great help. > > > > > > Regards, > > Akshay > > > -- Cheers!! Akshay
Tapestry Production Mode
Hi, Is there any way in tapestry 5.4 (*production mode) *where-in, I can fire the tapestry compiling chain again ( so that my less file are compiled again). I am able to get this done in *development *mode, by adding a request filter(which picks my dynamic changes on the file), by adding my RequestHandler in AppModule class:- public void contributeRequestHandler( OrderedConfiguration configuration) { configuration.addInstance("XYZRequestFilter", XYZRequestFilter.class, "before:*"); } But the same approach, doesn't work in production mode( since the caching mechanism is different). Any idea/suggestions would be of great help. Regards, Akshay
Re: Tapestry Framework Possibilties
Hi Chris, Thanks for your reply. I actually had a look into these few days back. The above solutions are more apt for tapestry 5.3. Since tapestry 5,4 now offers a less compiling chain by default, it would really be a tough time implementing the given solution. I am rather looking for a solution which can help me in forcing a default less compilation on the change of less variables in the .less file. Of course before this, I need to know whether the approached mentioned by are feasible or not. Regards Akshay On Wed, Sep 24, 2014 at 2:08 PM, Chris Mylonas wrote: > I reckon you may want to look in this direction > > https://github.com/lltyk/tapestry-wro4j > https://github.com/cezary-biernacki/t5conduit > > I think I recall some bright sparks talking about it on the list in the > last 2 years. > > The man himself even makes a suggestion http://apache-tapestry- > mailing-list-archives.1045711.n5.nabble.com/5-4-Less-CSS- > Support-td5724746.html > > Bit of google foo will help you find it. tapestry less > > > > > On Wed, 24 Sep 2014 20:52:20 +1000, akshay > wrote: > > Hi, >> >> I would like to know the possibility of the below given approaches(a,b,c), >> which I am trying to add in the tapestry framework: >> >> prerequisite: >> >> - "app.less" in my context path (used in my page layout class with >> ${context:app.less}) >> >> Is it possible to have an app.less file >> >> a) which can >> >> @import "generatedruntime.less"; >> >> The "generatedruntime.less" doesn't exist in the file system and will be >> created and updated at runtime. >> >> b) which can >> >> @import "abc.less"; >> >> where "abc.less" exists in my file system , but can be overridden >> dynamically. Doing so should force the Tapestry Less Compilation chain >> to recompile the less files (at least app.less). >> >> c) which can >> >> @import "${myAssetDomain:test.less}"; >> >> The myAssetDomain is a custom AssetDomain class contributed using the >> conventional way in AppModule class. Doing so should directly call my >> custom assetfactory class, which can then be used to write the values in >> to >> the less file from database and the Tapestry Less Compilation chain to >> recompile the less files (at least app.less). >> >> >> I have tried using the RequestFilter approach, but it doesnt works in >> production mode as expected(only works after the sever restart). >> >> >> Any suggestions would be highly appreciated. >> >> Regards, >> Akshay >> > > > -- > Using Opera's mail client: http://www.opera.com/mail/ > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Tapestry Framework Possibilties
Hi, I would like to know the possibility of the below given approaches(a,b,c), which I am trying to add in the tapestry framework: prerequisite: - "app.less" in my context path (used in my page layout class with ${context:app.less}) Is it possible to have an app.less file a) which can @import "generatedruntime.less"; The "generatedruntime.less" doesn't exist in the file system and will be created and updated at runtime. b) which can @import "abc.less"; where "abc.less" exists in my file system , but can be overridden dynamically. Doing so should force the Tapestry Less Compilation chain to recompile the less files (at least app.less). c) which can @import "${myAssetDomain:test.less}"; The myAssetDomain is a custom AssetDomain class contributed using the conventional way in AppModule class. Doing so should directly call my custom assetfactory class, which can then be used to write the values in to the less file from database and the Tapestry Less Compilation chain to recompile the less files (at least app.less). I have tried using the RequestFilter approach, but it doesnt works in production mode as expected(only works after the sever restart). Any suggestions would be highly appreciated. Regards, Akshay
Re: Problem in using Bootstrap Modal component
Hi Sir, Thanks for your response, I believe post over a forum , expects a more polite response than yours. Coming to the point suggested by you, I tried using the remote option before posting into the forum and it didnt work the way, it is supposed to be. So rather than putting a complex code snippet, I jotted down the naive approach, so that someone can really help me in knowing the feasible solution. Regarding the effort, I tried the possibilities and has asked the question, hoping to get a better response. Thanks and Best Regards Akshay On Tue, Sep 23, 2014 at 6:48 PM, Chris Poulsen wrote: > I doubt there is any magic going on. If your html output is correct then it > should work like advertised. You seem to be talking about the modal remote > option, but that is not used in your pasted code (which is close to > absolutely useless anyway, please put in an effort if you expect others to > try and help you). > > I suggest you read the docs for bootstrap modal, and then make sure that > your html is correct. > > -- > Chris > > On Tue, Sep 23, 2014 at 6:12 PM, akshay wrote: > > > Hi, > > > > I am trying to use bootstrap component modal.js. I intend to change to > > content of the modal( i.e image in my case) for every execution of this > > conditional block given below. But I see that , the content of the modal > > ("${imageUrl}") in the image tag, is only loaded once and I get to see > the > > same image for each and every input field, where this block is executed. > > > > Code snippet :- > > > > > > > data-target="#basicModal">Show Example > > > > > aria-labelledby="basicModal" aria-hidden="true"> > > > > > > > > > > > width="500px"> > > > > > > > > > > > > > > > > I read over the internet that modal loads the content only once, and for > > this didnt find any solution that would fit my need. > > > > Any kind of help would be highly appreciated. > > > > -- > > Cheers!! > > Akshay > > > -- Cheers!! Akshay
Problem in using Bootstrap Modal component
Hi, I am trying to use bootstrap component modal.js. I intend to change to content of the modal( i.e image in my case) for every execution of this conditional block given below. But I see that , the content of the modal ("${imageUrl}") in the image tag, is only loaded once and I get to see the same image for each and every input field, where this block is executed. Code snippet :- Show Example I read over the internet that modal loads the content only once, and for this didnt find any solution that would fit my need. Any kind of help would be highly appreciated. -- Cheers!! Akshay
Re: Loading javascript file in tapestry
Hi, My js file is a colorpicker and it uses these images to display the color options. Being a thirdparty component it, should just work fine without any changes. But that doesnt seems to be the case , and no image is displayed for the picker, since the image is not loaded/resource is not found . So, I try to find a solution where I can embed my images to be loaded along with the js file using this file from tapestry core module. Being very new to javascript , I might be wrong. :) Regards Akshay On Tue, Sep 23, 2014 at 12:16 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 22 Sep 2014 19:11:59 -0300, akshay > wrote: > > Hi, >> > > Hi! > > Thanks for your concern!! >> > > ;) > > Whereas when I remove "dependsOn(img.getFile()))" code snippet, it loads >> fine, but without the image( which is required by the js file to work >> functionally). >> >> I am just trying to find out a way in which I can load the images related >> to the js file using the above configuration, whether its feasible or not >> > > Are you trying to embed the image as part of a JavaScript stack? This > isn't possible because it doesn't make sense. > > How exactly your JavaScript code uses the image? Its URL being used in the > HTML the JS code manipulates? If yes, you don't include the image inside > the JavaScript stack. You just pass to the JS code the image URL. > > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > ----- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Re: Loading javascript file in tapestry
Hi, Thanks for your concern!! Doesnt work here implies that , the javascript fails to be identified and hence its not loaded. Whereas when I remove "dependsOn(img.getFile()))" code snippet, it loads fine, but without the image( which is required by the js file to work functionally). I am just trying to find out a way in which I can load the images related to the js file using the above configuration, whether its feasible or not Regards Akshay On Mon, Sep 22, 2014 at 11:49 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 22 Sep 2014 16:54:03 -0300, akshay > wrote: > > Hello, >> > > Hi! > > configuration.add("xyz", new JavaScriptModuleConfiguration( >> js).exports("variable").dependsOn(img.getFile())); >> > > The dependsOn() method you called above doesn't not do what you think it > does. It says a given RequireJS module depends on another. I'm not even > sure what you're trying to do. Maybe the method you want is > initializeWith(String expression). Are you trying to pass the image bytes > to your JavaScript code? Or just its URL? If the latter, you need to inject > Asset, not Resource, and use its toClientURL() method. > > But it doesnt work. Any help would be highly appreciated. >> > > Define "doesn't work". It's too vague. It says nothing about the result, > so we have no information to help you. > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > ----- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Cheers!! Akshay
Loading javascript file in tapestry
Hello, I am unable to load the images related to my *.js file in the normal way, due to unknown reasons. So, I am trying to find a way in which I can explicity load the image path associated to my *.js file. I intend to use my custom Library class which contributes JavaScript libraries. As of now I am trying to use Tapestry JavaScriptModuleConfiguration class which I add to the static custom configuration MAP. I am trying to do something like this:- @Path(static constant referring to the image path "context:") Resource img; @Path(static constant referring to the js path "context:") Resource js configuration.add("xyz", new JavaScriptModuleConfiguration( js).exports("variable").dependsOn(img.getFile())); But it doesnt work. Any help would be highly appreciated. Regards Akshay
Dynamic updating the .less file
Hi, I am trying to figure out a way, by which I can update the variables defined in the.less files dynamically after a page submit, so that the styling of the page can be altered. I want this modified .less file to be imported into main.less file which gets finally translated to .css file by tapestry. As we know that the .less files are compiled into .css by tapestry, I am not sure how do I put a hook around , so that the tapestry reads and re-compile the .less file again after a page submit. FYI:- I have a servlet in place which writes into .css and load it as a last one, which I believe was much simpler than modifying .less files(as I think that this infrastructure would not work in case of.less files). Any suggestions would be highly appreciable. Regards and Thanks, Akshay