[openstack-dev] [horizon] problem using BatchAction and LinkAction functionality together

Gabriel Hurley Gabriel.Hurley at nebula.com
Tue Jan 15 20:11:54 UTC 2013


It is possible, but there's nothing built-in to make it easy. It sounds like what you're asking for is a way to select a set of resources from the table, and then click a button that allows you to perform a set of changes on all of them that require some user input. That's certainly a valid use case.

There are a few ways I could see doing it to provide a decent UX:


1.       Set up your table action to submit the set of IDs and redirect to a different view which took those IDs as inputs and allowed manipulation from there in a form (with the IDs as hidden inputs) which would then be submitted and carry out the final action.

2.       Hack it together in javascript so that your script catches the form's submit event and instead fetches a modal, gets those inputs, and ultimately combines the original selected IDs with the new inputs to form the final submission.

3.       Build a new action subclass in Python that did what you want, creating a two-stage action that opens a modal when called with only the IDs and does the processing if the additional data is present.

Any of the above are likely to be viable strategies if you're willing to do the coding. If you manage to get it to a point you're happy with please consider submitting a patch back to Horizon in case others wish to do the same thing in the future.


-          Gabriel

From: Naik, Chinmay [mailto:cnaik at paypal.com]
Sent: Tuesday, January 15, 2013 10:47 AM
To: OpenStack Development Mailing List
Cc: Ivan Kolodyazhny
Subject: [openstack-dev] [horizon] problem using BatchAction and LinkAction functionality together

Hi All
I am currently using essex release and wondering if there is a way I can have a single button on the horizon UI page that can do two things simultaneously

  1.  Create a pop form and ask for user input
  2.  Read the selected rows in batch from a table on the page where the button is located (for ex: batch of instances selected on the instances and volumes page)
I also need to know how I can combine inputs from both and act on them in one common function like action () of BatchAction class or handle () in forms.py.

Greatly appreciate any help.

Thanks,
Chinmay Naik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130115/0a061f14/attachment.html>


More information about the OpenStack-dev mailing list