Question: How to render a tool form with predefined parameters?
gravatar for Evgeny Anatskiy
11 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 • 288 views
ADD COMMENTlink modified 11 months ago by aysam.guerler70 • written 11 months ago by Evgeny Anatskiy0
gravatar for aysam.guerler
11 months ago by
United States
aysam.guerler70 wrote:

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

ADD COMMENTlink written 11 months ago by aysam.guerler70
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: 73 users visited in the last hour