[Catalyst] Jemplate and AJAX woes...

2008-08-12 Thread kakimoto

hi, guys,

I think Ajax is cool. With Jemplate, it sounds good that Javascript
templating is possible.
I tried to go chapter 7 of Jon Rockway's book. 

Looks good. For my system, I just needed something very basic.
===
1) Load up a data input form

2) user selects loan type from a select box ( bearing values: '',
'personal' , 'commercial' ,'misc')
 
3) using the onChange method in javascript, I would then have an AJAX
call (excuse my terminology please) to load another fragment into the
existing form. This is because each loan type will have different
attributes which I have to have as input.  This fragment will be made
out of various input types.

4) User fills up the remaining attribute values (after the specific form
attribute values have been loaded).



Looking at chapter 7(AddressBook Codes of Jon Rockway's book)
===

1) two files, root/src/person_fragment.tt2 and
root/src/search/address_results.tt2 would call address_fragment.tt2

2) address_fragment.tt2 would in turn invoke edit_address.tt2 (under the
root/src/jemplate directory) with view_only set to true.


For what I need to do (in my own little test project), I figured I get
rid of the intermediate file, address_fragment.tt2 and just refer to
edit_address.tt2 directly with view_only set to true.

When i tried my changes out, well,
1) view_source keeps getting set all the time 
2) the javascript does work when I click on Edit in the webpage.


My questions are:
===
1)  roughly, what's wrong with cutting off the intermediate file,
address_fragment.tt2 ?
2) I have been looking (googling) for Jemplates and got no luck really.
Most of the AJAX tutes do not talk about Catalyst enough (what more of
Jemplates)...  Any good tutorials for Jemplates especially in terms of
what I want to achieve (as described above)?
3) I used firebug for debugging but kept getting an error saying
Jemplate.js has to be loaded first before anything. Is that normal?? I
mean, I did everything there was to do as per the sample AddressBook
Codes in chapter 7 of Jon Rockway's book.


SOS and thank you in advance,
 K. akimoto




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Chapter 7[Jon rockway's catalyst book] - AJAX - What's the user id and password for the AddressBook source codes?

2008-08-12 Thread kakimoto

hi guys (especially Jon),

What's the user id and password for the AddressBook source codes from
chapter 7 of the Catalyst Book (by Jon Rockway) ?


thank you

K. Akimoto

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [Announce] Catalyst-Runtime 5.7099_01 - Developer Release

2008-08-12 Thread Charles Bailey
On Mon, Jul 21, 2008 at 5:32 PM, Matt S Trout [EMAIL PROTECTED] wrote:
 On Mon, Jul 21, 2008 at 07:13:37AM -0400, Charles Bailey wrote:
 Agreed.  I've had it on TODO for the past two weeks, but getting
 hammered at dayjob. Will try to do this week.

 We're one more dev release short of shipping. Please try because otherwise
 it'll probably have to wait until 5.80

Patch attached, following a severe tuit drought. I'm sorry I was
unable to turn it around faster, but I hope it's useful for the
future.

The dispatcher change is trivial; most of the size is tests.  These
are modelled closely on existing tests, with the thought that
consistency in the test suite is better than streamlining each case.

-- 
Regards,
Charles Bailey
Lists: bailey _dot_ charles _at_ gmail _dot_ com
Other: bailey _at_ newman _dot_ upenn _dot_ edu


Catalyst_visit.patch
Description: Binary data
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst::*::REST and Javascript

2008-08-12 Thread Mark Trostler
Ya I agree that doc is a little wacky - I tend to craft my own urls  
set the HTTP method appropriately - I stick the JSON-encoded data in a 
'data' request parameter  have my auto sub in my Root controller peel 
it off of there  put it in $c-data so it all looks the same after that.


like:

if (my $data = $c-stash-{raw_params}-{data}) {
$c-req-data(decode_json($data));
}


Mark

Robert Krimen wrote:


On Mon, Aug 11, 2008 at 9:57 PM, Mark Trostler [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


I've had good luck with ExtJS:

http://extjs.com/learn/Manual:RESTful_Web_Services

   Mark

 
Wikipedia demonstrates REST like:


   userResource = new Resource('http://example.com/users/001')
   userResource.delete()

Whereas ExtJS seems to be of form:

   userResource = new Resource('http://example.com/users?id=001')

The difference being that REST-proper encapsulates the id of the user in the
URI path, where as ExtJS includes it as a query parameter.

I like the former technique because it dovetails with Catalyst's 
chaining paradigm nicely.


Looks like best practice for now is to craft URIs manually and feed them 
into your YUI, jQuery, or

ExtJS AJAX routine of choice.

Rob





___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Cat + DBIC + DBD-Pg + mpm_worker -- Solution

2008-08-12 Thread Toby Corkindale
On Tue, Aug 12, 2008 at 02:03:56PM +1000, Toby Corkindale wrote:
 Hi,
 I know the Cat cookbook suggests one should use mod_perl only with the
 preforking MPM.. but I wanted to try with the worker (ie. threaded) MPM 
 anyway.
 
 DBD-Pg had some thread-safety work done years ago, and I meant to be fine..
 However I'm seeing errors like this one:
   Couldn't render template undef error - DBD::Pg::db STORE failed:
   handle 2 is owned by thread 84e5bf0 not current thread 8fe48f8 (handles 
 can't
   be shared between threads and your driver may need a CLONE method added) at
   /usr/lib/perl5/vendor_perl/5.8.8/DBIx/Class/Storage/DBI.pm line 723.
 
 I've checked, and I am running a recent version of DBD-Pg, that does indeed
 have the required CLONE function. (Ver 2.8.6)
 
 Are there any known issues with Cat+DBIC+DBD-Pg here? Or maybe I just have
 screwed something else up..

Following up on this after some more investigation last night..
I was previously using DBIx::Class::Schema::Loader. I swapped to a static
DBIx::Class::Schema setup, and the problem vanished..

I had a google around for anyone else with this issue, and found a japanese
site I can't understand which looks to be mentioning it too, including a fix.
http://d.hatena.ne.jp/holidays-l/20070126/p1

I haven't tried the fix myself, being happy to use a static schema defn. (I
prefer those anyway).. but thought I'd pass it on in case it can be applied to
the mainline version.

Cheers,
Toby

-- 
Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --recv-key B1CCF88E)

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/