Re: [5.3.6] GridDataSource provided row index to getRowValue(int)
No, they're not the same: index 9 startIndex 9 rowsPerPage 5 index-startIndex 0 index%rowsPerPage 4 On Mon, Dec 17, 2012 at 4:17 AM, Muhammad Gelbana wrote: > I did, they are the same. Although modulating tolerates a glitch I'm trying > to understand why is it happening. I have 20 rows per page. The thing is > that, sometimes, the passed index to the getRowValue method is like 0, > while the startindex is 20 ! > > On Mon, Dec 17, 2012 at 12:00 AM, Geoff Callender < > geoff.callender.jumpst...@gmail.com> wrote: > > > On 17/12/2012, at 3:10 AM, Muhammad Gelbana wrote: > > > > > Marvelous ! You deserve a medal or something :D > > > Although I know "jumpstart" is a very resourceful project for tapestry > > > beginners including me, I don't why I keep forgetting about it ! May > be I > > > should have it as my homepage instead of google ehehe > > > > > > About the getRowValue(int) method: > > > > > > preparedResults.get(index - startIndex); > > > > > > > > > You think this should work too ? > > > > > > preparedResults.get(index % rowsPerPage); > > > > > > > > > I think both would have the same result. > > > > Try it. I think you'll find the answer is no. > > > > > On Sun, Dec 16, 2012 at 2:15 PM, Geoff Callender < > > > geoff.callender.jumpst...@gmail.com> wrote: > > > > > >> Newly added: a working example using GridDataSource here: > > >> > > >> > > >> > > > http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/griddatasources > > >> > > >> Cheers, > > >> > > >> Geoff > > >> > > >> On 15/12/2012, at 2:46 AM, Lance Java wrote: > > >> > > >>> Basically, the prepare() method is used to fetch the rows between > > >> startIndex > > >>> and endIndex in a single batch and cache them. This cache might be a > > list > > >>> with indexes ranging from 0 to (endIndex - startIndex) > > >>> > > >>> getRowValue(int index) is then used to retrieve a single entry from > the > > >>> batch. This might require you to subtract startIndex from index to > get > > a > > >>> suitable index into your cached batch of records. > > >>> > > >>> getAvailableRows() can be a dynamic value over time. Just make sure > you > > >>> return null from getRowValue() if the index is out of range (ie a row > > has > > >>> been deleted). > > >>> > > >>> > > >>> > > >>> -- > > >>> View this message in context: > > >> > > > http://tapestry.1045711.n5.nabble.com/5-3-6-GridDataSource-provided-row-index-to-getRowValue-int-tp5718694p5718727.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 > > >>> > > >> > > >> > > >> - > > >> 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 > > > > > -- Dmitry Gusev AnjLab Team http://anjlab.com
Re: Best way to prevent page to be accessed without context?
Yes, this is correct. On Sun, Dec 16, 2012 at 10:34 PM, bhorvat wrote: > Dmitry Gusev wrote > > +1 for HTTP 404. > > > > But you don't have to use StreamResponse for that, just return new > > org.apache.tapestry5.services.HttpError(404, "Page Not Found"); from > > onActivate. > > I really like this solution. Thanks > > Now my web.xml looks like this > > > > app > org.apache.tapestry5.TapestryFilter > > > app > /* > REQUEST > ERROR > > > Is this ok? > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Best-way-to-prevent-page-to-be-accessed-without-context-tp5718737p5718765.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 > > -- Dmitry Gusev AnjLab Team http://anjlab.com
[5.3.6] Grid JS erorr: cannot call method 'getStorage' of null at $T
I'm testing my my grid if it's operating well but rarely, a JS error rises on the client side, nothing is thrown on the server side though. The error indication is attached as a screenshot. All I do is jumping through the grid's pages randomly. To make sure the custom grid data source works fine. The Grid's inPlace attribute is "true" - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [5.3.6] GridDataSource provided row index to getRowValue(int)
I did, they are the same. Although modulating tolerates a glitch I'm trying to understand why is it happening. I have 20 rows per page. The thing is that, sometimes, the passed index to the getRowValue method is like 0, while the startindex is 20 ! On Mon, Dec 17, 2012 at 12:00 AM, Geoff Callender < geoff.callender.jumpst...@gmail.com> wrote: > On 17/12/2012, at 3:10 AM, Muhammad Gelbana wrote: > > > Marvelous ! You deserve a medal or something :D > > Although I know "jumpstart" is a very resourceful project for tapestry > > beginners including me, I don't why I keep forgetting about it ! May be I > > should have it as my homepage instead of google ehehe > > > > About the getRowValue(int) method: > > > > preparedResults.get(index - startIndex); > > > > > > You think this should work too ? > > > > preparedResults.get(index % rowsPerPage); > > > > > > I think both would have the same result. > > Try it. I think you'll find the answer is no. > > > On Sun, Dec 16, 2012 at 2:15 PM, Geoff Callender < > > geoff.callender.jumpst...@gmail.com> wrote: > > > >> Newly added: a working example using GridDataSource here: > >> > >> > >> > http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/griddatasources > >> > >> Cheers, > >> > >> Geoff > >> > >> On 15/12/2012, at 2:46 AM, Lance Java wrote: > >> > >>> Basically, the prepare() method is used to fetch the rows between > >> startIndex > >>> and endIndex in a single batch and cache them. This cache might be a > list > >>> with indexes ranging from 0 to (endIndex - startIndex) > >>> > >>> getRowValue(int index) is then used to retrieve a single entry from the > >>> batch. This might require you to subtract startIndex from index to get > a > >>> suitable index into your cached batch of records. > >>> > >>> getAvailableRows() can be a dynamic value over time. Just make sure you > >>> return null from getRowValue() if the index is out of range (ie a row > has > >>> been deleted). > >>> > >>> > >>> > >>> -- > >>> View this message in context: > >> > http://tapestry.1045711.n5.nabble.com/5-3-6-GridDataSource-provided-row-index-to-getRowValue-int-tp5718694p5718727.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 > >>> > >> > >> > >> - > >> 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: [5.3.6] GridDataSource provided row index to getRowValue(int)
On 17/12/2012, at 3:10 AM, Muhammad Gelbana wrote: > Marvelous ! You deserve a medal or something :D > Although I know "jumpstart" is a very resourceful project for tapestry > beginners including me, I don't why I keep forgetting about it ! May be I > should have it as my homepage instead of google ehehe > > About the getRowValue(int) method: > > preparedResults.get(index - startIndex); > > > You think this should work too ? > > preparedResults.get(index % rowsPerPage); > > > I think both would have the same result. Try it. I think you'll find the answer is no. > On Sun, Dec 16, 2012 at 2:15 PM, Geoff Callender < > geoff.callender.jumpst...@gmail.com> wrote: > >> Newly added: a working example using GridDataSource here: >> >> >> http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/griddatasources >> >> Cheers, >> >> Geoff >> >> On 15/12/2012, at 2:46 AM, Lance Java wrote: >> >>> Basically, the prepare() method is used to fetch the rows between >> startIndex >>> and endIndex in a single batch and cache them. This cache might be a list >>> with indexes ranging from 0 to (endIndex - startIndex) >>> >>> getRowValue(int index) is then used to retrieve a single entry from the >>> batch. This might require you to subtract startIndex from index to get a >>> suitable index into your cached batch of records. >>> >>> getAvailableRows() can be a dynamic value over time. Just make sure you >>> return null from getRowValue() if the index is out of range (ie a row has >>> been deleted). >>> >>> >>> >>> -- >>> View this message in context: >> http://tapestry.1045711.n5.nabble.com/5-3-6-GridDataSource-provided-row-index-to-getRowValue-int-tp5718694p5718727.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 >>> >> >> >> - >> 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: [5.3.6] Listening to native tapestry ajax events
Sorry, I shouldn't have suggested subclassing. The preferred way to extend and/or override a Tapestry component's functionality is to "wrap" it. If you can't achieve what you want with wrapping then maybe create your own component by copying DateField? It might not be much work. As for your last question, I'll repeat it: "A question to the developers, why isn't tapestry's components events bubbled by default ? Performance issues ?". On 17/12/2012, at 3:13 AM, Muhammad Gelbana wrote: > I should try extedning the datefield component but I have a question, is it > just about my component class "extending" tapestry's component class and > that's it ? No other wiring needed ? > > Just a plain java "extends" and referring to my component instead ? > > A question to the developers, why isn't tapestry's components events > bubbled by default ? Performance issues ? > > On Sun, Dec 16, 2012 at 5:42 AM, Geoff Callender > wrote: > >>> This may help: >>> >>> http://localhost:8080/jumpstart/examples/component/eventbubbling >> >> Wrong. I meant this: >> >> >> http://jumpstart.doublenegative.com.au/jumpstart/examples/component/eventbubbling >> >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Best way to prevent page to be accessed without context?
Dmitry Gusev wrote > +1 for HTTP 404. > > But you don't have to use StreamResponse for that, just return new > org.apache.tapestry5.services.HttpError(404, "Page Not Found"); from > onActivate. I really like this solution. Thanks Now my web.xml looks like this app org.apache.tapestry5.TapestryFilter app /* REQUEST ERROR Is this ok? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Best-way-to-prevent-page-to-be-accessed-without-context-tp5718737p5718765.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
Re: Best way to prevent page to be accessed without context?
+1 for HTTP 404. But you don't have to use StreamResponse for that, just return new org.apache.tapestry5.services.HttpError(404, "Page Not Found"); from onActivate. Note: If you deploy your app on tomcat, you should also add ERROR dispatcher to the tapestry filter mapping in web.xml (if you don't do this you may get strange NPEs instead of HTTP 404): app /* REQUEST ERROR On Sun, Dec 16, 2012 at 9:05 PM, trsvax wrote: > Maybe, but they could come from anywhere including just typing in the URL > (ie > no where). The only way that might work sometimes is get the referring URL > from the request and send them back there. > > You could also return a 404 "Page not found" with a StreamResponse and that > might make the most sense. > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Best-way-to-prevent-page-to-be-accessed-without-context-tp5718737p5718763.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 > > -- Dmitry Gusev AnjLab Team http://anjlab.com
Re: Best way to prevent page to be accessed without context?
Maybe, but they could come from anywhere including just typing in the URL (ie no where). The only way that might work sometimes is get the referring URL from the request and send them back there. You could also return a 404 "Page not found" with a StreamResponse and that might make the most sense. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Best-way-to-prevent-page-to-be-accessed-without-context-tp5718737p5718763.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
Re: [5.3.6] Listening to native tapestry ajax events
I should try extedning the datefield component but I have a question, is it just about my component class "extending" tapestry's component class and that's it ? No other wiring needed ? Just a plain java "extends" and referring to my component instead ? A question to the developers, why isn't tapestry's components events bubbled by default ? Performance issues ? On Sun, Dec 16, 2012 at 5:42 AM, Geoff Callender wrote: > > This may help: > > > > http://localhost:8080/jumpstart/examples/component/eventbubbling > > Wrong. I meant this: > > > http://jumpstart.doublenegative.com.au/jumpstart/examples/component/eventbubbling > >
Re: [5.3.6] GridDataSource provided row index to getRowValue(int)
Marvelous ! You deserve a medal or something :D Although I know "jumpstart" is a very resourceful project for tapestry beginners including me, I don't why I keep forgetting about it ! May be I should have it as my homepage instead of google ehehe About the getRowValue(int) method: preparedResults.get(index - startIndex); You think this should work too ? preparedResults.get(index % rowsPerPage); I think both would have the same result. On Sun, Dec 16, 2012 at 2:15 PM, Geoff Callender < geoff.callender.jumpst...@gmail.com> wrote: > Newly added: a working example using GridDataSource here: > > > http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/griddatasources > > Cheers, > > Geoff > > On 15/12/2012, at 2:46 AM, Lance Java wrote: > > > Basically, the prepare() method is used to fetch the rows between > startIndex > > and endIndex in a single batch and cache them. This cache might be a list > > with indexes ranging from 0 to (endIndex - startIndex) > > > > getRowValue(int index) is then used to retrieve a single entry from the > > batch. This might require you to subtract startIndex from index to get a > > suitable index into your cached batch of records. > > > > getAvailableRows() can be a dynamic value over time. Just make sure you > > return null from getRowValue() if the index is out of range (ie a row has > > been deleted). > > > > > > > > -- > > View this message in context: > http://tapestry.1045711.n5.nabble.com/5-3-6-GridDataSource-provided-row-index-to-getRowValue-int-tp5718694p5718727.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 > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: [5.3.6] GridDataSource provided row index to getRowValue(int)
Newly added: a working example using GridDataSource here: http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/griddatasources Cheers, Geoff On 15/12/2012, at 2:46 AM, Lance Java wrote: > Basically, the prepare() method is used to fetch the rows between startIndex > and endIndex in a single batch and cache them. This cache might be a list > with indexes ranging from 0 to (endIndex - startIndex) > > getRowValue(int index) is then used to retrieve a single entry from the > batch. This might require you to subtract startIndex from index to get a > suitable index into your cached batch of records. > > getAvailableRows() can be a dynamic value over time. Just make sure you > return null from getRowValue() if the index is out of range (ie a row has > been deleted). > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/5-3-6-GridDataSource-provided-row-index-to-getRowValue-int-tp5718694p5718727.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 > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org