Have you tried anything yet?

A skeleton solution/recommendation:
- If I assume correctly that the values are the HTML INPUT values,
then use the selected event on the jQueryUI objects
- for the above event, the handler adds the selected rooms to a stored
collection (Array perhaps) in client-side script
- when the form is submitted (stop the event)/when you call the
controller use $.post(CONTROLLER_URL, {'rooms': roomArray}, function
HANDLER))

On the server side, request.vars.rooms will be the list of selected
rooms, ready for you to do whatever might be required.

On Jan 27, 11:34 am, Ialejandro <ialejandr...@gmail.com> wrote:
> Hi! I'm playing with web2py, and I'm making a booking system,
>
> I have a model as follow:
>
> db.define_table('room',
>     Field('name','string'),
>     Field('location','string'))
>
> I'm showing the rooms as a list with jqueryUI selectable (http://
> jqueryui.com/demos/selectable/display-grid.html), so every room is
> shown as a square, I need that one user can select multiple rooms, and
> book them, so I need to pass the result of which rooms the user
> selected to a controller that make the booking (into the bookings
> model)
>
> but the question is, how do I get the values of the selected rooms to
> the controller and make the index of the list (rooms squares)
> correspond to the ID of each room
>
> sorry if the question is quite confusing, but my mind is the same, I'm
> lost with this.
>
> I don't know if a postback should work, I read something about
> json..... but I don't know.
>
> Thanks!

Reply via email to