bug with Galaxy form validation and dynamic_options population of drop-down menus where option values are integers
Hello, If you have a form with an input like this: <param name="input1" type="select" dynamic_options="get_options()" /> And the options dynamically generated have integers as values, e.g. options tuples like this: [ "One", 1, 1 ], [ "Two", 2, 0 ], [ "Three", 3, 0 ] When you try to submit the galaxy form you always get the validation error "An invalid option was selected, please verify". regards, Leandro
Hi Leandro Although we use 'dynamic_options' successfully in many tools, it is still a little mystery to me sometimes - probably due to my non-existing python knowledge. Hence just double checking: Does [ "One",1,True ], [ "Two",2,False ], [ "Three",3,False] work? Regards, Hans On 02/29/2012 04:44 PM, Leandro Hermida wrote:
Hello,
If you have a form with an input like this:
<param name="input1" type="select" dynamic_options="get_options()" />
And the options dynamically generated have integers as values, e.g. options tuples like this:
[ "One", 1, 1 ], [ "Two", 2, 0 ], [ "Three", 3, 0 ]
When you try to submit the galaxy form you always get the validation error "An invalid option was selected, please verify".
regards, Leandro ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Hi Hans! Hey hope you liked the manuscript and hope to get feedback soon, yes it seems with Galaxy when you use the dynamic_options feature to load options into the form it seems to go through different code when processing then statically set options in the tool XML, even though it really shouldn't its just generating form HTML in the end and when you hit submit to process what the user has selected they should be completely decoupled :-/ I'll try your suggestions below today is a public holiday in Neuchatel so will be at work tomorrow. take care, leandro On Thu, Mar 1, 2012 at 10:34 AM, Hans-Rudolf Hotz <hrh@fmi.ch> wrote:
Hi Leandro
Although we use 'dynamic_options' successfully in many tools, it is still a little mystery to me sometimes - probably due to my non-existing python knowledge.
Hence just double checking:
Does [ "One",1,True ], [ "Two",2,False ], [ "Three",3,False] work?
Regards, Hans
On 02/29/2012 04:44 PM, Leandro Hermida wrote:
Hello,
If you have a form with an input like this:
<param name="input1" type="select" dynamic_options="get_options()" />
And the options dynamically generated have integers as values, e.g. options tuples like this:
[ "One", 1, 1 ], [ "Two", 2, 0 ], [ "Three", 3, 0 ]
When you try to submit the galaxy form you always get the validation error "An invalid option was selected, please verify".
regards, Leandro ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Hi all, Thanks Hans for giving a hint as to what we might need to try, we tried pasing True and False for the is selected field and the Galaxy form validation still doesn't like it, turns out it's the option value fields that have to be stringified in your JSON encoder so that you JSON reads: ["One", "1", True ], ["Two", "2", False ], Hope this helps others with the same issue, if you want to pass numbers as the option values make sure to stringify them. regards, Leandro On Thu, Mar 1, 2012 at 10:34 AM, Hans-Rudolf Hotz <hrh@fmi.ch> wrote:
Hi Leandro
Although we use 'dynamic_options' successfully in many tools, it is still a little mystery to me sometimes - probably due to my non-existing python knowledge.
Hence just double checking:
Does [ "One",1,True ], [ "Two",2,False ], [ "Three",3,False] work?
Regards, Hans
On 02/29/2012 04:44 PM, Leandro Hermida wrote:
Hello,
If you have a form with an input like this:
<param name="input1" type="select" dynamic_options="get_options()" />
And the options dynamically generated have integers as values, e.g. options tuples like this:
[ "One", 1, 1 ], [ "Two", 2, 0 ], [ "Three", 3, 0 ]
When you try to submit the galaxy form you always get the validation error "An invalid option was selected, please verify".
regards, Leandro ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
participants (2)
-
Hans-Rudolf Hotz
-
Leandro Hermida