>> The project I'm working on has not gone public yet, be we also use js
>> widgets for the UI like Daniel's site, although we use Dojo rather
>> than ExtJs.
>>
>> On Jun 1, 8:55 pm, Jim Steil <[email protected]> wrote:
>> > May I ask how you handle authentication with the Javascript backend?
>> > I'm interested in doing some Flex front-ends but haven't had the time to
>> > dig into the authentication integration with the TG backend.
>>
>> It's actually quite simple Jim. You just have to authenticate against
>> the functions that call for that JSON or save it back to the server.
>> If a particular user doesn't have permission to pull a certain piece
>> of data from the server, the client-side can't really do anything
>> without it.
>
> Does anyone know of any good tutorials for this kind of desing? I'd love
> to check out some simple code.

There is no magic here. You write controllers to return html (A) and
other controllers to return JSON (B). Let's say html (A) is just a
couple of <div> elements and a reference to a static javascript source
(C). The source (C) will contain javascript code that will send http
requests to (B), get the response, process it and, for example, create
UI elements in the <div> elements of (A). Voila la, you just generated
a dynamic UI entirely from javascript client code.

The advantages are clear, controller (A) only returns a bare html
source and doesn't worry about anything else, while controller (B)
only returns JSON that defines your UI. And the client code (C) will
actually render the UI but that is only being done on the client, i.e.
the web browser, where this kind of stuff really belongs. Your
controller code is not polluted with all sorts of UI stuff, it's all
being done on the client using javascript client code.

Cheers,
Daniel

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to