RE: [Catalyst] TT via AJAX

2012-04-27 Thread Roland Philibert
Hi Jason, My ajax action are already set as you say. I still need to forward to a JSON view, which was in my end action. If I dont forward it, I don't get anything back at the client..but if I do then back to square one.. From: Jason Galea [mailto:li...@eightdegrees.com.au] Sent:

Re: [Catalyst] TT via AJAX

2012-04-27 Thread Jason Galea
Hi Roland, you shouldn't need to forward to a JSON view. Calling the status_ok method should set up the response and return the serialized data. Is there anything showing in the error logs? What client are you using to test? there isn't really a space between sub ajaxaction _GET { in your

Re: [Catalyst] Stand-alone Scripts

2012-04-27 Thread Will Crawford
On 27 April 2012 14:25, Glen Diener gdie...@excelii.com wrote: I'm new to Catalyst and have nearly completed the development of my first Catalyst web site. I'm needing to implement scripts to do some off-line database processing and would like to use the DBIx model created and implemented

Re: [Catalyst] Stand-alone Scripts

2012-04-27 Thread Glen Diener
Thanks for the suggestion. The error changed to: DBIx::Class::ResultSet::find(): DBI Connection failed: Can't connect to data source 'ARRAY(0xe8bfa0)' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at

[Catalyst] No data showing

2012-04-27 Thread Kenneth S Mclane
OK, I still can't get -all to work, but this: $c-stash(accounts = [ $c-model('ORANGES::AccountView')-find({account_name = 'GHODB2'}) ]); returns one row, as it should, but there is no data showing in my page. Obviously the query is successful, so the data must exist or it could not match, but

Re: [Catalyst] Stand-alone Scripts

2012-04-27 Thread Will Crawford
On 27 April 2012 15:17, Will Crawford billcrawford1...@gmail.com wrote: or you need to take the [ ... ] out from around your connect info args :) Actually, just the latter should help you ... :) ___ List: Catalyst@lists.scsys.co.uk Listinfo:

Re: [Catalyst] Stand-alone Scripts

2012-04-27 Thread Will Crawford
On 27 April 2012 14:54, Glen Diener gdie...@excelii.com wrote: Thanks for the suggestion. The error changed to: DBIx::Class::ResultSet::find(): DBI Connection failed: Can't connect to data source 'ARRAY(0xe8bfa0)' because I can't work out what driver to use (it doesn't seem to contain a

Re: [Catalyst] No data showing

2012-04-27 Thread Steve
It looks to me like you're returning a list. On 4/27/2012 10:07 AM, Kenneth S Mclane wrote: OK, I still can't get -all to work, but this: $c-stash(accounts = [ $c-model('ORANGES::AccountView')-find({account_name = 'GHODB2'}) ]); returns one row, as it should, but there is no data showing in

Re: [Catalyst] Stand-alone Scripts

2012-04-27 Thread Glen Diener
Thanks! Removing the [ .. ] from around the connection information args worked. I now have: use strict; use warnings; use Data::Dumper; use FindBin qw($Bin); use lib $Bin/../lib; use DealerDemoSite::Schema::DemoDB; my $connect_info_args = { dsn = 'dbi:Pg:dbname=dib', user =

Re: [Catalyst] No data showing

2012-04-27 Thread Jorge Gonzalez
Can we see your template? How are you accesing your data there? Just a matter of style, but if "accounts" is going to hold a list of just one element, why not name it "account" (singular) and stick the row directly in it, instead of a list? That way, in your template

Re: [Catalyst] No data showing

2012-04-27 Thread Kenneth S Mclane
Yes, that is my intention, however I wanted to prove that I was really getting results. If I replace the -all I get the expected hundreds of rows that I want, but no data shows in the page. From: Steve st...@matsch.com To: catalyst@lists.scsys.co.uk Date: 04/27/2012 09:39 AM Subject: Re:

Re: [Catalyst] No data showing

2012-04-27 Thread Kenneth S Mclane
This was a test to make sure I was actually getting data. My intention is to return all rows in pager format. I haven't made it to that part yet. Here is my template code: table width=100% border=1 trthDepartment/ththAccount Code/ththAccount

Re: [Catalyst] No data showing

2012-04-27 Thread Will Crawford
On 27 April 2012 15:50, Kenneth S Mclane ksmcl...@us.ibm.com wrote: This was a test to make sure I was actually getting data. My intention is to return all rows in pager format. I haven't made it to that part yet. Here is my template code: table width=100% border=1

Re: [Catalyst] No data showing

2012-04-27 Thread Stuart Watt
Surely that should be [% account.department_id %], etc. All the best Stuart On 2012-04-27, at 10:50 AM, Kenneth S Mclane wrote: [% accounts.department_id %] ___ List: Catalyst@lists.scsys.co.uk Listinfo:

Re: [Catalyst] No data showing

2012-04-27 Thread Kenneth S Mclane
I swear I tried that and it still didn't work. It does now, thank you. Can you tell me what I need to add to $c-stash(accounts = [ $c-model('ORANGES::AccountView')-all ]); to sort by the account_code in ascending order? It's obviously sort, but the actual syntax is what I'm looking for. Thanks

Re: [Catalyst] No data showing

2012-04-27 Thread Kenneth S Mclane
Yes, William beat you to it. Regards Kenneth McLane 700 Locust St Systems Compliance Services Dubuque, 52001-6838 I1OB USA GTS Services Delivery Phone: +1-563-845-4674 Tie-Line: 946-4674 Mobile: +1-563-940-7147 e-mail: ksmcl...@us.ibm.com Ideas come from everything -- Alfred

RE: [Catalyst] TT via AJAX

2012-04-27 Thread Roland Philibert
Hi Jason, No, nothing there...I'll try to make a simple testcase. Thanks Roland From: Jason Galea [mailto:li...@eightdegrees.com.au] Sent: 27 April 2012 13:29 To: The elegant MVC web framework Subject: Re: [Catalyst] TT via AJAX Hi Roland, you shouldn't need to forward to a JSON

Re: [Catalyst] No data showing

2012-04-27 Thread will trillich
$c-model('ORANGES::AccountView')-search({},{order_by='account_code'})-all() I'd recommend that you look into iterating thru the recordset in the template, instead of rendering all rows of data before it's rendered: my $acct_rs =

Re: [Catalyst] No data showing

2012-04-27 Thread Will Crawford
On 27 April 2012 16:09, Kenneth S Mclane ksmcl...@us.ibm.com wrote: I swear I tried that and it still didn't work. It does now, thank you. Can you tell me what I need to add to $c-stash(accounts = [ $c-model('ORANGES::AccountView')-all ]); to sort by the account_code in ascending order? It's

[Catalyst] Paging problem

2012-04-27 Thread Kenneth S Mclane
ok, I used bits from all over and have this sub now: sub list :Local { my ($self, $c) = @_; my $page = 1; my $rs = $c-model('ORANGES::AccountView')-search_rs(undef, { order_by = 'account_code', rows = 15, page = $page,

Re: [Catalyst] Paging problem

2012-04-27 Thread Denny
On Fri, 2012-04-27 at 14:22 -0500, Kenneth S Mclane wrote: ok, I used bits from all over and have this sub now: [...] my $page = 1; [...] when clicking any link the data doesn't change. That seems reasonable. You need to change the value of $page if you want to move to the next

Re: [Catalyst] Paging problem

2012-04-27 Thread Kenneth S Mclane
ok, I tried this: my ($self, $c, $page) = @_; and my template code is issueing uri's like this: http://localhost:3000/accountview/list?page=4 Do I need to remove this line: my $page = 1; From: Denny 2...@denny.me To: The elegant MVC web framework catalyst@lists.scsys.co.uk Date:

Re: [Catalyst] Paging problem

2012-04-27 Thread Alex Povolotsky
On 04/28/12 00:05, Kenneth S Mclane wrote: ok, I tried this: my ($self, $c, $page) = @_; and my template code is issueing uri's like this: http://localhost:3000/accountview/list?page=4 http://localhost:3000/accountview/list?page=4 Do I need to remove this line: my $page = 1; It

Re: [Catalyst] Paging problem

2012-04-27 Thread Cory Watson
Alex Povolotsky wrote: On 04/28/12 00:05, Kenneth S Mclane wrote: ok, I tried this: my ($self, $c, $page) = @_; and my template code is issueing uri's like this: http://localhost:3000/accountview/list?page=4 http://localhost:3000/accountview/list?page=4 Do I need to remove this line: my

Re: [Catalyst] Paging problem

2012-04-27 Thread Kenneth S Mclane
I removed that line but it makes no difference. I am pretty sure that I need to hook my pager to my accounts in the stash, but I don't know how. Or I need to figure out a different way to do this. From: Alex Povolotsky tark...@over.ru To: The elegant MVC web framework

Re: [Catalyst] Paging problem

2012-04-27 Thread Kenneth S Mclane
That was the clue I needed. There are a few pieces to this that I could not find all in one place. Here is working code for the next poor person trying to get this working: sub list :Local { my ($self, $c, $page) = @_; #needed to add $page to the param array $page =

Re: [Catalyst] Paging problem

2012-04-27 Thread Dimitar Petrov
You can do that also into your template file: [% SET pager = rs.pager %] Cheers On Fri, Apr 27, 2012 at 10:30 PM, Kenneth S Mclane ksmcl...@us.ibm.comwrote: That was the clue I needed. There are a few pieces to this that I could not find all in one place. Here is working code for the next