I usually do something similar.

Even to the extreme of my <td> have an extra column.

So My id usually looks like

id="<tablename>_<recordid>_<column>"

And in my controllers I parse this as

tablename, record_id, column = request.vars.id.split('_')

-Thadeus





On Thu, Apr 1, 2010 at 2:24 PM, Keith Edmunds <k...@midnighthax.com> wrote:
> What I want to do: have a list of items displayed; when one is clicked,
> more detail is shown (via an Ajax call) in a defined "detail area".
>
> Problem: the web2py ajax call takes three parameters: a controller action,
> one or more field ids, and a target DIV. My controller action needs to
> identify which row has been clicked on, so I need a hidden field per row
> that holds the row number. Because all field ids need to be unique, I
> actually have to build a dynamic name for the row id (eg,
> "id=row_{{=row.number}}, name=row_{{=row.number}}"), and - even worse - my
> controller action doesn't know the name of the field passed, so it has to
> parse response.vars to find it.
>
> Web2py and Python in general are so well architected that I know there
> must be a better way. Could someone point it out, please?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to