Opened 9 years ago

Closed 9 years ago

#818 closed (fixed)

Extra "null" button sometimes appears when selecting files

Reported by: olle Owned by: olle
Milestone: Proteios SE 2.19.0 Keywords:
Cc:

Description

An extra "null" button somtimes appears when selecting files, e.g. during "Spectrum Search->X!Tandem" and "Hits Import->Non gel based", when a sub-directory is entered at file selection. The extra button appears to the right of the expected buttons and has name "null".

Change History (4)

comment:1 Changed 9 years ago by olle

Status: newassigned

Ticket accepted.

comment:2 Changed 9 years ago by olle

Problem discussion:

  • When the extra "null" button appeared during "Hits Import->Non gel based", after a sub-directory had been entered at file selection, the link coupled to the button was

    <A HREF="javascript:addField('formOfFile','continueSelection','true');submitFormAs('formOfFile','org.proteios.action.hit.ImportHitsNonGelWizardStep1b');"
    >null</A>

    The submit part is the one expected for the "Import" button on the same web page, but with an added parameter continueSelection with value set to true. The latter parameter is coupled to valid parameter VBoolean VCONTINUESELECTION, that was defined in class ViewActiveDirectory in changeset [4465] in Ticket #805 (Support for simplifying ProteomeXchange submission). However, since the feature to continue selecting files of the same type from different directories currently isn't activated for hits import, no button with added parameter continueSelection set to true should appear.
  • The continueSelection parameter value is in controlled by local variable String nextContinueSelectionButtonName, and a button should only appear if the latter string is neither null, nor an empty string. The button name is set by calling fetchNextButtonName(select, selectMoveDir, NextContinueSelectionButtonNameField.VPARAM, null). Private method String fetchNextButtonName(Boolean select, Boolean selectMoveDir, VString fieldName, String defaultName) returns null if argument select is false, otherwise a string is searched in several ways, until a non-null, non-blank value is found:

    1. If argument selectMoveDir is true, string "Next" is returned.
    2. Posted value of valid parameter fieldName.
    3. Session attribute fieldName.
    4. Value of argument defaultName.

    Added debug output revealed that when the posted value of valid parameter fieldName was intended to be null, the four-character string "null" was returned instead, leading to a button being created with name "null".

Suggested solution:

  • Class/file action/directory/ViewActiveDirectory.java in client/servlet/ should be updated in private method String fetchNextButtonName(Boolean select, Boolean selectMoveDir, VString fieldName, String defaultName) to exchange a four-character string "null" for a null value, when obtained from a posted parameter or session attribute value. This has the side effect that no button can be created in this way having the name "null", but this is unlikely to cause any problems.
Last edited 9 years ago by olle (previous) (diff)

comment:3 Changed 9 years ago by olle

(In [4525]) Refs #818. Refs #805. File selection updated to avoid creating extra unwanted buttons, when navigating the directory tree to find files to select:

  1. Class/file action/directory/ViewActiveDirectory.java in client/servlet/ updated in private method String fetchNextButtonName(Boolean select, Boolean selectMoveDir, VString fieldName, String defaultName) to exchange a four-character string "null" for a null value, when obtained from a posted parameter or session attribute value. This has the side effect that no button can be created in this way having the name "null", but this is unlikely to cause any problems.

comment:4 Changed 9 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed as the added update seems to have fixed the problem.

Note: See TracTickets for help on using tickets.