Thanks Shannon & Fang Zhou ... and I did exactly that. My webpy app has
been ajax-ed :)...

On Mon, Dec 10, 2012 at 9:10 PM, 方 舟 <[email protected]> wrote:

> Hi Megha,
>
> Try to replace
> return render_plain.schoolpage(jsonpickle.encode(data))
> with
> print jsonpickle.encode(data)
> Best regards,
> Fang Zhou
> On Dec 10, 2012, at 11:32 PM, Megha Vishwanath <[email protected]>
> wrote:
>
> Hi All,
>
> I'm trying to set up a ajax based html page, with a tab view library (not
> jquery though, using barelyfitz.com's js/css that can be extended to
> Ajax).
>
> So this is the basic layout of my page:
> <tab_view.png>
>
> And my existing web.py method, calls on a class called schoolpage and
> writes to a template called school page.
>
> class schoolpage:
>    def get(id):
>       data = getAllData()
>       return render_plain.schoolpage(jsonpickle.encode(data))
>
> This worked fine while my tabs were superficial -i.e, no individual urls/
> ajax, just html-js-css voodoo.
>
> I'm now needed to call on a part of the data based on the tab clicked, so:
>
> class schoolpage:
>    def get(id,tab):
>       if tab == 1:
>          data = getDataForContentPane1()
>       if tab == 2:
>          data = getDataForContentPane2()
>       return render_plain.schoolpage(jsonpickle.encode(data))
>
> But I realised that if I do this, the template schoolpage is getting
> rendered within schoolpage.
>
> So I am wondering, how to design with webpy, html & js.
>
> Should I make the URLs and hence the classes and http request get calls
> completely distinct (and in that case who will call the holding / binding
> template with that some common data) or can the if condition render
> different templates within them? Since I don't write raw html in python,
> like I would in php, I'm having some trouble understanding this.
>
> How would you solve for this?
>
> Really hope someone can point me to suggestions and help with this.
>
> Regards,
> Megha
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" 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/webpy?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "web.py" 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/webpy?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to