Hi

Thanks for your reply.

This is doing the same, as what mine was returning
Your is also returning a full page with all the response.menu from top, the 
Main Page Title etc and putting it in the div.
Also yours is retuning all the links on one line, I would line <br /> 
between each link.

I've been trying to use Html helper with tables, that works without 
bringing back the full page, but I cannot get it to return after each row.
It return all the links, but not returning after each link, just returns 
the text when it reaches end of div, so links are spanned over two lines.
code below. 

def artist():
    rows = db().select(db.media.artist,db.media.id, groupby = 
db.media.artist) 
    
    links = []
   
    for row in rows:
       a = str(row.id)
       b = 'album?id='
       c = b+a 
       l = row.artist
       f = A(l , callback=URL(c), target="album")
   
       links.append(f)

table = TABLE(THEAD(TR(*[B(header) for link in links)))
table["_class"] = "table table-striped table-bordered table-condensed"

return (table)

On Saturday, 21 March 2015 18:19:02 UTC, Garry Smith wrote:
>
> Hi
> I'm trying to return the some links to a div. I have made links with some 
> information from the database and using the A htlm helper.
> The problem I am having is getting the data back correctly, I am getting 
> the links back correctly, but I am being sent a full web page  with the 
> links, which is then put in the div.
>
> *VIEW*
> this is link which is sent to the artist page, which gets all the distinct 
> artist.
>
> {{=A('click' , callback=URL('artist'), target="artist")}}
>
> *CONTROLLER*
>
> This is the controller that makes the links and returns to the div as 
> specified in above link.
>
> def artist():
>     rows = db().select(db.media.artist,db.media.id, groupby = 
> db.media.artist) 
>     
>     links = []
>     
>     for row in rows:
>        a = str(row.id)
>        b = 'album?id='
>        c = b+a 
>        l = row.artist
>        f = A(l , callback=URL(c), target="album")
>        links.append(f)
>     
>     return dict(links=links)
>
> I have tried diffrent ways to solve this, but to no avail, all I want is 
> to return the links to div.
>
> What i am trying to do is rewrite a media player, which I wrote in php a 
> few years ago, but I am having few issues writing a returning links on the 
> sly.
>
> Thanks in advance for any help.
>
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to