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

Naik, Chinmay cnaik at paypal.com
Wed Jan 16 20:05:17 UTC 2013


Hi Gabriel

Thanks a lot for your recommendations. I will definitely consider submitting back my code for review when I am done.

Thanks,
Chinmay Naik

From: Gabriel Hurley <Gabriel.Hurley at nebula.com<mailto:Gabriel.Hurley at nebula.com>>
Reply-To: OpenStack Development Mailing List <openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>>
Date: Tue, 15 Jan 2013 20:11:54 +0000
To: OpenStack Development Mailing List <openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>>
Cc: Ivan Kolodyazhny <ikolodyazhny at mirantis.com<mailto:ikolodyazhny at mirantis.com>>
Subject: Re: [openstack-dev] [horizon] problem using BatchAction and LinkAction functionality together

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

_______________________________________________ OpenStack-dev mailing list OpenStack-dev at lists.openstack.org<mailto:OpenStack-dev at lists.openstack.org> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130116/29e78b1a/attachment.html>


More information about the OpenStack-dev mailing list