🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

[SOLVED] Default value not used?

User: "daniel_thibault"
New Altair Community Member
Updated by Jocelyn
My operator has an Int parameter for which I set a default value (in the getParameterTypes() method):

     type = new ParameterTypeInt(PARAMETER_CHUNK_SIZE,
           I18N.getMessage(I18N.getGUIBundle(), "gui.label.rmx_LTFDataReader.parameter.chunk_size.description"), 1, Integer.MAX_VALUE, false);
     type.setDefaultValue(IndexCachedLTFExampleTable.DEFAULT_BATCH_SIZE);
     types.add(type);
...
But once the operator is instantiated in the GUI, the parameter's edit box remains empty and the GUI displays the problem "The mandatory parameter "exampleset chunk size" is undefined."  What am I doing wrong?

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Nils_Woehler"
    New Altair Community Member
    Hi,

    your right. If you use the constructor you have posted setting the default value with setDefaultValue() will not change the default value.
    This is indeed a bug that I've just fixed. To avoid the problem with your current version I would recommend you to use the ParameterType declartion this way:

    type = new ParameterTypeInt(PARAMETER_CHUNK_SIZE,
                I18N.getMessage(I18N.getGUIBundle(), "gui.label.rmx_LTFDataReader.parameter.chunk_size.description"), 1, Integer.MAX_VALUE, IndexCachedLTFExampleTable.DEFAULT_BATCH_SIZE);
          type.setOptional(false);
          types.add(type);
    Best,
    Nils