Hi, I am making an sqlform widget that can change the order of a list, for 
example, if I have a field with value
xx = [a,b,c], 
user can interact with this ui to make it 
xx = [c, a, b].

To achieve this, I need to post a list. If I use SELECT, it is easy, but 
you cannot change the order of SELECT value. 
I googled, and found out that if you have multiple post values, they are 
treated as a list. For example, 
DIV(
HIDDEN(_value= 'a', _name='xx'), 
HIDDEN(_value= 'b', _name='xx'), 
HIDDEN(_value= 'c', _name='xx')) will post xx=[a,b,c], and
DIV(
HIDDEN(_value= 'c', _name='xx'), 
HIDDEN(_value= 'a', _name='xx'), 
HIDDEN(_value= 'b', _name='xx')) will post xx=[c,a,b].

The problem happens when SQLFORM accepts the form. I saw that xx=[c,a,b] is 
posted, and found in request.post_vars and request.vars, but it disappears 
after SQLHTML.accepts() is executed. I narrowed down, and found that 
HTML._traverse() function for some reason does not think this is a value.

So I am stuck.

Any idea?

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to