Changeset 4525


Ignore:
Timestamp:
Oct 22, 2013, 2:43:08 PM (9 years ago)
Author:
olle
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/action/directory/ViewActiveDirectory.java

    r4465 r4525  
    731731    {
    732732        String nextButtonName = null;
     733        String stringsource = "default when select == false";
    733734        if (select == null || select)
    734735        {
     
    737738            {
    738739                nextButtonName = getString(fieldName);
     740                // Replace 4-character string "null" with null value
     741                if (nextButtonName != null && nextButtonName.equals("null"))
     742                {
     743                  nextButtonName = null;
     744                }
     745                stringsource = "posted parameters";
    739746            }
    740747            catch (InvalidParameterValue e)
     
    743750            {
    744751                nextButtonName = getSessionAttribute(fieldName);
     752                // Replace 4-character string "null" with null value
     753                if (nextButtonName != null && nextButtonName.equals("null"))
     754                {
     755                  nextButtonName = null;
     756                }
     757               stringsource = "session attribute";
    745758            }
    746759            if (nextButtonName == null || nextButtonName.equals(""))
    747760            {
    748761                nextButtonName = defaultName;
     762                stringsource = "default name";
    749763            }
    750764            // If selection is for directory to move file to, override above
     
    752766            {
    753767                nextButtonName = "Next";
    754             }
     768                stringsource = "default when selectMoveDir == true";
     769            }
     770        }
     771        if (nextButtonName == null)
     772        {
     773            log.debug("fetchNextButtonName(): fieldName = " + fieldName.getName() + " select = " + select + " selectMoveDir = " + selectMoveDir + " defaultName = " + defaultName + " : nextButtonName = " + nextButtonName + " obtained from " + stringsource);
     774        }
     775        else
     776        {
     777             log.debug("fetchNextButtonName(): fieldName = " + fieldName.getName() + " select = " + select + " selectMoveDir = " + selectMoveDir + " defaultName = " + defaultName + " : nextButtonName = \"" + nextButtonName + "\" obtained from " + stringsource);
    755778        }
    756779        return nextButtonName;
Note: See TracChangeset for help on using the changeset viewer.