[web2py] Re: GRID selectable inside component
O > The issue isn't simply whether there have been changes in the file but >> whether there have been changes in the file that are directly linked to >> changes in the core framework. web2py.js includes code that depends on >> particular HTML classes and data-* attributes generated by web2py HTML >> helpers and widgets, so sometimes changes in the core framework are coupled >> with changes in web2py.js and the two must therefore be upgraded in tandem. >> This is less likely to be the case with other app-specific files. For >> example, you can upgrade appadmin.py and appadmin.html, but the old >> versions should generally continue to work with new versions of the >> framework. It's probably worth upgrading web2py_ajax.html as well. >> > > This just reinforces my point... Perhaps these files (and any others?) > should be managed as part of the framework, and not as part of an > application. > I agree. It's just a matter of figuring out a good mechanism. It's tricky with static assets, as often we want to bundle them. > Ok. I see. However, in a production environment I do not exactly want to > have the welcome app enabled... Which means that this kind of link should > actually NOT work... > Good point. I suppose you could use your web server or routes.py to redirect all "welcome" requests (except those to /static). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
On Wednesday, January 6, 2016 at 5:30:25 PM UTC+1, Anthony wrote: > > >> I guess, this is more-less what I need to do, but this is not perfect, as >> I have several applications that I maintain and updating all of them >> manually is not great. Also - is this the only file that should be updated >> in this way? I am not sure... What about web2py_ajax.html? appadmin.html? >> Others? >> > > The issue isn't simply whether there have been changes in the file but > whether there have been changes in the file that are directly linked to > changes in the core framework. web2py.js includes code that depends on > particular HTML classes and data-* attributes generated by web2py HTML > helpers and widgets, so sometimes changes in the core framework are coupled > with changes in web2py.js and the two must therefore be upgraded in tandem. > This is less likely to be the case with other app-specific files. For > example, you can upgrade appadmin.py and appadmin.html, but the old > versions should generally continue to work with new versions of the > framework. It's probably worth upgrading web2py_ajax.html as well. > This just reinforces my point... Perhaps these files (and any others?) should be managed as part of the framework, and not as part of an application. > > >> >> >>> This is a good point, though -- perhaps we should come up with a way to >>> ensure web2py.js is easily upgraded along with the rest of the framework. >>> For now, though, you could always link to the version of web2py.js that >>> comes with the "welcome" app, as that will always be upgraded with the >>> framework. >>> >>> >> I will try the linking, but not sure how this will work with git >> throughout different filesystems and OSes... (I use Linux on some >> development systems and BSD on some production servers)... git should >> preserve the link, but... >> > > I didn't mean you should create symbolic links to the web2py.js file in > the welcome app -- I meant actually serve that file via its usual URL. So, > in web2py_ajax.html, instead of using URL('static', 'js/web2py.js'), change > it to URL('welcome', 'static', 'js/web2py.js'). > > Ok. I see. However, in a production environment I do not exactly want to have the welcome app enabled... Which means that this kind of link should actually NOT work... Krzysztof. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
> > I guess, this is more-less what I need to do, but this is not perfect, as > I have several applications that I maintain and updating all of them > manually is not great. Also - is this the only file that should be updated > in this way? I am not sure... What about web2py_ajax.html? appadmin.html? > Others? > The issue isn't simply whether there have been changes in the file but whether there have been changes in the file that are directly linked to changes in the core framework. web2py.js includes code that depends on particular HTML classes and data-* attributes generated by web2py HTML helpers and widgets, so sometimes changes in the core framework are coupled with changes in web2py.js and the two must therefore be upgraded in tandem. This is less likely to be the case with other app-specific files. For example, you can upgrade appadmin.py and appadmin.html, but the old versions should generally continue to work with new versions of the framework. It's probably worth upgrading web2py_ajax.html as well. > > >> This is a good point, though -- perhaps we should come up with a way to >> ensure web2py.js is easily upgraded along with the rest of the framework. >> For now, though, you could always link to the version of web2py.js that >> comes with the "welcome" app, as that will always be upgraded with the >> framework. >> >> > I will try the linking, but not sure how this will work with git > throughout different filesystems and OSes... (I use Linux on some > development systems and BSD on some production servers)... git should > preserve the link, but... > I didn't mean you should create symbolic links to the web2py.js file in the welcome app -- I meant actually serve that file via its usual URL. So, in web2py_ajax.html, instead of using URL('static', 'js/web2py.js'), change it to URL('welcome', 'static', 'js/web2py.js'). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
On Wednesday, January 6, 2016 at 1:58:19 PM UTC+1, Anthony wrote: > > > Well, any time you upgrade the framework, you should always upgrade > web2py.js (no need to check whether it has changed -- just do it). > > I guess, this is more-less what I need to do, but this is not perfect, as I have several applications that I maintain and updating all of them manually is not great. Also - is this the only file that should be updated in this way? I am not sure... What about web2py_ajax.html? appadmin.html? Others? > This is a good point, though -- perhaps we should come up with a way to > ensure web2py.js is easily upgraded along with the rest of the framework. > For now, though, you could always link to the version of web2py.js that > comes with the "welcome" app, as that will always be upgraded with the > framework. > > I will try the linking, but not sure how this will work with git throughout different filesystems and OSes... (I use Linux on some development systems and BSD on some production servers)... git should preserve the link, but... Anyway - thanks for your help - it allowed me to pinpoint and fix the problem for now. Krzysztof. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
On Monday, January 4, 2016 at 6:20:42 PM UTC-5, Krzysztof Socha wrote: > > Ok. I think I got it... I started developing my application long time ago > based on a welcome app. I have updated web2py regularly, but I have not > updated original welcome application files that are specific to web2py, > such as web2py.js It appears that there have been changes there as well, > but they are not handled properly by the update procedure... Once I > replaced the web2py.js for my application with a newer version, it works > now fine. > > Perhaps these dependencies should be re-thought? Maybe they should be > moved out of application tree into somewhere else? Framework-wide js > folder, or something... It is not clear how to make sure they are up to > date without manually checking after every web2py update... > Well, any time you upgrade the framework, you should always upgrade web2py.js (no need to check whether it has changed -- just do it). This is a good point, though -- perhaps we should come up with a way to ensure web2py.js is easily upgraded along with the rest of the framework. For now, though, you could always link to the version of web2py.js that comes with the "welcome" app, as that will always be upgraded with the framework. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
Ok. I think I got it... I started developing my application long time ago based on a welcome app. I have updated web2py regularly, but I have not updated original welcome application files that are specific to web2py, such as web2py.js It appears that there have been changes there as well, but they are not handled properly by the update procedure... Once I replaced the web2py.js for my application with a newer version, it works now fine. Perhaps these dependencies should be re-thought? Maybe they should be moved out of application tree into somewhere else? Framework-wide js folder, or something... It is not clear how to make sure they are up to date without manually checking after every web2py update... Anyway - thank you for your support! Cheers, Krzysztof. On Friday, January 1, 2016 at 12:27:22 AM UTC+1, Anthony wrote: > > Oops, got it. Still can't reproduce. > > On Thursday, December 31, 2015 at 5:23:38 PM UTC-5, Krzysztof Socha wrote: >> >> As I wrote: >> >> 2.13.4-stable+timestamp.2015.12.26.04.59.39 >> (Running on nginx/1.4.6, Python 2.7.6) >> >> Strange... I will have to investigate a bit more, than. I will report >> back, what I find. >> >> Krzysztof. >> >> On Thursday, December 31, 2015 at 10:38:10 PM UTC+1, Anthony wrote: >>> >>> Sorry, tried your exact code and it works for me. Which version of >>> web2py? Maybe attach a minimal app that demonstrates the problem. >>> >>> Anthony >>> >>> On Thursday, December 31, 2015 at 3:39:37 PM UTC-5, Krzysztof Socha >>> wrote: Anthony, Thank you for (very) quick reaction! And Happy New Year! ;) Here is an example: I define a grid in the following action: def grid_test(): grid = SQLFORM.grid(db.project, formname='grid_test',selectable=[('Test', lambda ids: 1/0)]) response.view = 'project/grid.load' return dict(grid=grid) ...of course the expected behavior is that the 'Test' action will cause an error (division by zero). Indeed, this happens if I simply put such defined grid as part of regular controller action. However, when I put it in a component: {{=LOAD('project','grid_test.load', ajax=True)}} where the grid.load looks like this: {{=grid}} Pressing the 'Test' button does not cause the error - presumably because the selectable action is not executed at all... I hope this is clear enough. In my code, I actually tried to do a redirect, but the result is exactly the same - the selectable action does not appear to execute... I just tested this on: 2.13.4-stable+timestamp.2015.12.26.04.59.39 (Running on nginx/1.4.6, Python 2.7.6) Krzysztof. On Thursday, December 31, 2015 at 8:41:46 PM UTC+1, Anthony wrote: > > A basic example works for me. Can you show some code that you know > exhibits the problem? > > Anthony > > On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha > wrote: >> >> I noticed a similar thing... I need two grids on a page. As >> documented, it does not work very well to simply put them in one >> controller >> function. Hence, I tried with LOADing a component. This generally works, >> but I cannot get the selectable actions to work. I have defined custom >> selectable actions and they work fine if the gird is not inside a >> component. As soon, as I load it as a component, nothing happens. It >> seems >> that the form is submitted, but the selectable action is not executed. A >> bug somewhere? Or is there another way of doing this? >> >> Krzysztof. >> >> On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart >> wrote: >>> >>> I have a grid inside a component inside a component which has >>> selectable set to run a function that assigns the ids to a session >>> variable. When inside the component it does not work when i click >>> submit I >>> can tell that the page is being reloaded but the callback does not run. >>> I >>> know that the code works because if I go to the .load page directly and >>> try >>> it works as expected. But from the component page it doesnt execute the >>> callback. >>> >>> >>> >>> selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], >>> 'btn btn-info btn-md')] >>> grid2 = SQLFORM.grid(query, selectable=selectable, >>> args=request.args[:1], formname='invgrid', user_signature=False) >>> >>> def selectabletest(ids): >>> session.lambdatest = ids >>> >>> This message is for named person(s) only. It may contain >>> confidential and/or legally privileged information. No confidentiality >>> or >>> privilege is waived or lost should mis-transmission occur. If you >>> receive >>> this message in error, delete it (and all copies) and n
[web2py] Re: GRID selectable inside component
Oops, got it. Still can't reproduce. On Thursday, December 31, 2015 at 5:23:38 PM UTC-5, Krzysztof Socha wrote: > > As I wrote: > > 2.13.4-stable+timestamp.2015.12.26.04.59.39 > (Running on nginx/1.4.6, Python 2.7.6) > > Strange... I will have to investigate a bit more, than. I will report > back, what I find. > > Krzysztof. > > On Thursday, December 31, 2015 at 10:38:10 PM UTC+1, Anthony wrote: >> >> Sorry, tried your exact code and it works for me. Which version of >> web2py? Maybe attach a minimal app that demonstrates the problem. >> >> Anthony >> >> On Thursday, December 31, 2015 at 3:39:37 PM UTC-5, Krzysztof Socha wrote: >>> >>> Anthony, >>> >>> Thank you for (very) quick reaction! And Happy New Year! ;) >>> >>> Here is an example: >>> >>> I define a grid in the following action: >>> def grid_test(): >>> grid = SQLFORM.grid(db.project, formname='grid_test',selectable=[('Test', >>> lambda ids: 1/0)]) >>> response.view = 'project/grid.load' >>> return dict(grid=grid) >>> >>> ...of course the expected behavior is that the 'Test' action will cause >>> an error (division by zero). Indeed, this happens if I simply put such >>> defined grid as part of regular controller action. >>> >>> However, when I put it in a component: >>> >>> {{=LOAD('project','grid_test.load', ajax=True)}} >>> >>> where the grid.load looks like this: >>> >>> {{=grid}} >>> >>> Pressing the 'Test' button does not cause the error - presumably because >>> the selectable action is not executed at all... >>> >>> I hope this is clear enough. In my code, I actually tried to do a >>> redirect, but the result is exactly the same - the selectable action does >>> not appear to execute... I just tested this on: >>> >>> 2.13.4-stable+timestamp.2015.12.26.04.59.39 >>> (Running on nginx/1.4.6, Python 2.7.6) >>> >>> Krzysztof. >>> >>> On Thursday, December 31, 2015 at 8:41:46 PM UTC+1, Anthony wrote: A basic example works for me. Can you show some code that you know exhibits the problem? Anthony On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha wrote: > > I noticed a similar thing... I need two grids on a page. As > documented, it does not work very well to simply put them in one > controller > function. Hence, I tried with LOADing a component. This generally works, > but I cannot get the selectable actions to work. I have defined custom > selectable actions and they work fine if the gird is not inside a > component. As soon, as I load it as a component, nothing happens. It > seems > that the form is submitted, but the selectable action is not executed. A > bug somewhere? Or is there another way of doing this? > > Krzysztof. > > On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart > wrote: >> >> I have a grid inside a component inside a component which has >> selectable set to run a function that assigns the ids to a session >> variable. When inside the component it does not work when i click submit >> I >> can tell that the page is being reloaded but the callback does not run. >> I >> know that the code works because if I go to the .load page directly and >> try >> it works as expected. But from the component page it doesnt execute the >> callback. >> >> >> >> selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], >> 'btn btn-info btn-md')] >> grid2 = SQLFORM.grid(query, selectable=selectable, >> args=request.args[:1], formname='invgrid', user_signature=False) >> >> def selectabletest(ids): >> session.lambdatest = ids >> >> This message is for named person(s) only. It may contain >> confidential and/or legally privileged information. No confidentiality >> or >> privilege is waived or lost should mis-transmission occur. If you >> receive >> this message in error, delete it (and all copies) and notify the sender. >> >> You must not, directly or indirectly,use, disclose, distribute, print, >> or >> copy any part of this message if you are not the intended recipient. GAD >> GROUP TECHNOLOGY, INC. reserves the right to monitor all e-mail >> communications through its networks. >> >> Any views expressed in this message are those of the individual >> sender, except where the message states otherwise and the sender is >> authorized to state them to be the views of any such entity. >> >> This e-mail has been virus and content scanned by GAD GROUP >> TECHNOLOGY, INC. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group
[web2py] Re: GRID selectable inside component
As I wrote: 2.13.4-stable+timestamp.2015.12.26.04.59.39 (Running on nginx/1.4.6, Python 2.7.6) Strange... I will have to investigate a bit more, than. I will report back, what I find. Krzysztof. On Thursday, December 31, 2015 at 10:38:10 PM UTC+1, Anthony wrote: > > Sorry, tried your exact code and it works for me. Which version of web2py? > Maybe attach a minimal app that demonstrates the problem. > > Anthony > > On Thursday, December 31, 2015 at 3:39:37 PM UTC-5, Krzysztof Socha wrote: >> >> Anthony, >> >> Thank you for (very) quick reaction! And Happy New Year! ;) >> >> Here is an example: >> >> I define a grid in the following action: >> def grid_test(): >> grid = SQLFORM.grid(db.project, formname='grid_test',selectable=[('Test', >> lambda ids: 1/0)]) >> response.view = 'project/grid.load' >> return dict(grid=grid) >> >> ...of course the expected behavior is that the 'Test' action will cause >> an error (division by zero). Indeed, this happens if I simply put such >> defined grid as part of regular controller action. >> >> However, when I put it in a component: >> >> {{=LOAD('project','grid_test.load', ajax=True)}} >> >> where the grid.load looks like this: >> >> {{=grid}} >> >> Pressing the 'Test' button does not cause the error - presumably because >> the selectable action is not executed at all... >> >> I hope this is clear enough. In my code, I actually tried to do a >> redirect, but the result is exactly the same - the selectable action does >> not appear to execute... I just tested this on: >> >> 2.13.4-stable+timestamp.2015.12.26.04.59.39 >> (Running on nginx/1.4.6, Python 2.7.6) >> >> Krzysztof. >> >> On Thursday, December 31, 2015 at 8:41:46 PM UTC+1, Anthony wrote: >>> >>> A basic example works for me. Can you show some code that you know >>> exhibits the problem? >>> >>> Anthony >>> >>> On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha >>> wrote: I noticed a similar thing... I need two grids on a page. As documented, it does not work very well to simply put them in one controller function. Hence, I tried with LOADing a component. This generally works, but I cannot get the selectable actions to work. I have defined custom selectable actions and they work fine if the gird is not inside a component. As soon, as I load it as a component, nothing happens. It seems that the form is submitted, but the selectable action is not executed. A bug somewhere? Or is there another way of doing this? Krzysztof. On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart wrote: > > I have a grid inside a component inside a component which has > selectable set to run a function that assigns the ids to a session > variable. When inside the component it does not work when i click submit > I > can tell that the page is being reloaded but the callback does not run. I > know that the code works because if I go to the .load page directly and > try > it works as expected. But from the component page it doesnt execute the > callback. > > > > selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], > 'btn btn-info btn-md')] > grid2 = SQLFORM.grid(query, selectable=selectable, > args=request.args[:1], formname='invgrid', user_signature=False) > > def selectabletest(ids): > session.lambdatest = ids > > This message is for named person(s) only. It may contain confidential > and/or legally privileged information. No confidentiality or privilege > is > waived or lost should mis-transmission occur. If you receive this > message > in error, delete it (and all copies) and notify the sender. You must > not, > directly or indirectly,use, disclose, distribute, print, or copy any part > of this message if you are not the intended recipient. GAD GROUP > TECHNOLOGY, INC. reserves the right to monitor all e-mail communications > through its networks. > > Any views expressed in this message are those of the individual > sender, except where the message states otherwise and the sender is > authorized to state them to be the views of any such entity. > > This e-mail has been virus and content scanned by GAD GROUP > TECHNOLOGY, INC. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
Sorry, tried your exact code and it works for me. Which version of web2py? Maybe attach a minimal app that demonstrates the problem. Anthony On Thursday, December 31, 2015 at 3:39:37 PM UTC-5, Krzysztof Socha wrote: > > Anthony, > > Thank you for (very) quick reaction! And Happy New Year! ;) > > Here is an example: > > I define a grid in the following action: > def grid_test(): > grid = SQLFORM.grid(db.project, formname='grid_test',selectable=[('Test', > lambda ids: 1/0)]) > response.view = 'project/grid.load' > return dict(grid=grid) > > ...of course the expected behavior is that the 'Test' action will cause an > error (division by zero). Indeed, this happens if I simply put such defined > grid as part of regular controller action. > > However, when I put it in a component: > > {{=LOAD('project','grid_test.load', ajax=True)}} > > where the grid.load looks like this: > > {{=grid}} > > Pressing the 'Test' button does not cause the error - presumably because > the selectable action is not executed at all... > > I hope this is clear enough. In my code, I actually tried to do a > redirect, but the result is exactly the same - the selectable action does > not appear to execute... I just tested this on: > > 2.13.4-stable+timestamp.2015.12.26.04.59.39 > (Running on nginx/1.4.6, Python 2.7.6) > > Krzysztof. > > On Thursday, December 31, 2015 at 8:41:46 PM UTC+1, Anthony wrote: >> >> A basic example works for me. Can you show some code that you know >> exhibits the problem? >> >> Anthony >> >> On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha >> wrote: >>> >>> I noticed a similar thing... I need two grids on a page. As documented, >>> it does not work very well to simply put them in one controller function. >>> Hence, I tried with LOADing a component. This generally works, but I cannot >>> get the selectable actions to work. I have defined custom selectable >>> actions and they work fine if the gird is not inside a component. As soon, >>> as I load it as a component, nothing happens. It seems that the form is >>> submitted, but the selectable action is not executed. A bug somewhere? Or >>> is there another way of doing this? >>> >>> Krzysztof. >>> >>> On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart >>> wrote: I have a grid inside a component inside a component which has selectable set to run a function that assigns the ids to a session variable. When inside the component it does not work when i click submit I can tell that the page is being reloaded but the callback does not run. I know that the code works because if I go to the .load page directly and try it works as expected. But from the component page it doesnt execute the callback. selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], 'btn btn-info btn-md')] grid2 = SQLFORM.grid(query, selectable=selectable, args=request.args[:1], formname='invgrid', user_signature=False) def selectabletest(ids): session.lambdatest = ids This message is for named person(s) only. It may contain confidential and/or legally privileged information. No confidentiality or privilege is waived or lost should mis-transmission occur. If you receive this message in error, delete it (and all copies) and notify the sender. You must not, directly or indirectly,use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. GAD GROUP TECHNOLOGY, INC. reserves the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, INC. >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
Anthony, Thank you for (very) quick reaction! And Happy New Year! ;) Here is an example: I define a grid in the following action: def grid_test(): grid = SQLFORM.grid(db.project, formname='grid_test',selectable=[('Test', lambda ids: 1/0)]) response.view = 'project/grid.load' return dict(grid=grid) ...of course the expected behavior is that the 'Test' action will cause an error (division by zero). Indeed, this happens if I simply put such defined grid as part of regular controller action. However, when I put it in a component: {{=LOAD('project','grid_test.load', ajax=True)}} where the grid_test.load looks like this: {{=grid}} Pressing the 'Test' button does not cause the error - presumably because the selectable action is not executed at all... I hope this is clear enough. In my code, I actually tried to do a redirect, but the result is exactly the same - the selectable action does not appear to execute... I just tested this on: 2.13.4-stable+timestamp.2015.12.26.04.59.39 (Running on nginx/1.4.6, Python 2.7.6) Krzysztof. On Thursday, December 31, 2015 at 8:41:46 PM UTC+1, Anthony wrote: > > A basic example works for me. Can you show some code that you know > exhibits the problem? > > Anthony > > On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha wrote: >> >> I noticed a similar thing... I need two grids on a page. As documented, >> it does not work very well to simply put them in one controller function. >> Hence, I tried with LOADing a component. This generally works, but I cannot >> get the selectable actions to work. I have defined custom selectable >> actions and they work fine if the gird is not inside a component. As soon, >> as I load it as a component, nothing happens. It seems that the form is >> submitted, but the selectable action is not executed. A bug somewhere? Or >> is there another way of doing this? >> >> Krzysztof. >> >> On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart >> wrote: >>> >>> I have a grid inside a component inside a component which has selectable >>> set to run a function that assigns the ids to a session variable. When >>> inside the component it does not work when i click submit I can tell that >>> the page is being reloaded but the callback does not run. I know that the >>> code works because if I go to the .load page directly and try it works as >>> expected. But from the component page it doesnt execute the callback. >>> >>> >>> >>> selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], 'btn >>> btn-info btn-md')] >>> grid2 = SQLFORM.grid(query, selectable=selectable, >>> args=request.args[:1], formname='invgrid', user_signature=False) >>> >>> def selectabletest(ids): >>> session.lambdatest = ids >>> >>> This message is for named person(s) only. It may contain confidential >>> and/or legally privileged information. No confidentiality or privilege is >>> waived or lost should mis-transmission occur. If you receive this message >>> in error, delete it (and all copies) and notify the sender. You must not, >>> directly or indirectly,use, disclose, distribute, print, or copy any part >>> of this message if you are not the intended recipient. GAD GROUP >>> TECHNOLOGY, INC. reserves the right to monitor all e-mail communications >>> through its networks. >>> >>> Any views expressed in this message are those of the individual sender, >>> except where the message states otherwise and the sender is authorized to >>> state them to be the views of any such entity. >>> >>> This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, >>> INC. >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
A basic example works for me. Can you show some code that you know exhibits the problem? Anthony On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha wrote: > > I noticed a similar thing... I need two grids on a page. As documented, it > does not work very well to simply put them in one controller function. > Hence, I tried with LOADing a component. This generally works, but I cannot > get the selectable actions to work. I have defined custom selectable > actions and they work fine if the gird is not inside a component. As soon, > as I load it as a component, nothing happens. It seems that the form is > submitted, but the selectable action is not executed. A bug somewhere? Or > is there another way of doing this? > > Krzysztof. > > On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart > wrote: >> >> I have a grid inside a component inside a component which has selectable >> set to run a function that assigns the ids to a session variable. When >> inside the component it does not work when i click submit I can tell that >> the page is being reloaded but the callback does not run. I know that the >> code works because if I go to the .load page directly and try it works as >> expected. But from the component page it doesnt execute the callback. >> >> >> >> selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], 'btn >> btn-info btn-md')] >> grid2 = SQLFORM.grid(query, selectable=selectable, args=request.args[:1], >> formname='invgrid', user_signature=False) >> >> def selectabletest(ids): >> session.lambdatest = ids >> >> This message is for named person(s) only. It may contain confidential >> and/or legally privileged information. No confidentiality or privilege is >> waived or lost should mis-transmission occur. If you receive this message >> in error, delete it (and all copies) and notify the sender. You must not, >> directly or indirectly,use, disclose, distribute, print, or copy any part >> of this message if you are not the intended recipient. GAD GROUP >> TECHNOLOGY, INC. reserves the right to monitor all e-mail communications >> through its networks. >> >> Any views expressed in this message are those of the individual sender, >> except where the message states otherwise and the sender is authorized to >> state them to be the views of any such entity. >> >> This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, >> INC. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: GRID selectable inside component
I noticed a similar thing... I need two grids on a page. As documented, it does not work very well to simply put them in one controller function. Hence, I tried with LOADing a component. This generally works, but I cannot get the selectable actions to work. I have defined custom selectable actions and they work fine if the gird is not inside a component. As soon, as I load it as a component, nothing happens. It seems that the form is submitted, but the selectable action is not executed. A bug somewhere? Or is there another way of doing this? Krzysztof. On Wednesday, October 15, 2014 at 7:46:56 PM UTC+2, LaDarrius Stewart wrote: > > I have a grid inside a component inside a component which has selectable > set to run a function that assigns the ids to a session variable. When > inside the component it does not work when i click submit I can tell that > the page is being reloaded but the callback does not run. I know that the > code works because if I go to the .load page directly and try it works as > expected. But from the component page it doesnt execute the callback. > > > > selectable = [('Create Invoice', lambda ids: [selectabletest(ids)], 'btn > btn-info btn-md')] > grid2 = SQLFORM.grid(query, selectable=selectable, args=request.args[:1], > formname='invgrid', user_signature=False) > > def selectabletest(ids): > session.lambdatest = ids > > This message is for named person(s) only. It may contain confidential > and/or legally privileged information. No confidentiality or privilege is > waived or lost should mis-transmission occur. If you receive this message > in error, delete it (and all copies) and notify the sender. You must not, > directly or indirectly,use, disclose, distribute, print, or copy any part > of this message if you are not the intended recipient. GAD GROUP > TECHNOLOGY, INC. reserves the right to monitor all e-mail communications > through its networks. > > Any views expressed in this message are those of the individual sender, > except where the message states otherwise and the sender is authorized to > state them to be the views of any such entity. > > This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, > INC. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.