Question: How to render a tool form with predefined parameters?
gravatar for Evgeny Anatskiy
21 months ago by
Evgeny Anatskiy0 wrote:

The goal is to update the form:

enter image description here

And get the following:

enter image description here

After creating a form:

var toolForm = new ToolForm.View({
    id: tool.get('id'),
    version: tool.get('version')

toolForm.deferred.execute(function() {;

I'm trying to redraw it with non-default parameters (i.e., Cut columns: c3):

var form = toolForm.form;
form.deferred.execute(function(process) {
    me._updateModel(form, process);


_updateModel: function(form, process) {
    var currentState = {
        tool_id: this.toolId,
        tool_version: this.toolVersion,
        inputs: $.extend(true, {},

    currentState.inputs.columnList = 'c3';

        url: Galaxy.root + 'api/tools/' + this.toolId + '/build',
        type: 'POST',
        data: currentState,
        success: function(newModel) {
            window.newModel = newModel;
            form.update(newModel['tool_model'] || newModel);
            form.options.update && form.options.update(newModel);

In the response from the server, I can see the changed parameter, but the field itself (Cut columns) is not refreshed.

The question is: how to refresh all the fields with new parameters so that the form after pressing the Execute button would send correct (updated) parameters?

P.S. I was looking into client/galaxy/scripts/mvc/tool/tool-form-base.js to see how forms are being updated.

tool galaxy • 496 views
ADD COMMENTlink modified 21 months ago by aysam.guerler90 • written 21 months ago by Evgeny Anatskiy0
gravatar for aysam.guerler
21 months ago by
United States
aysam.guerler90 wrote:

One option is to parse the value through the url e.g.

ADD COMMENTlink written 21 months ago by aysam.guerler90
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 167 users visited in the last hour