/** * Returns the currently selected value of the select widget.<p> * * If a value is found in the given parameter, this is used. Otherwise * the default value of the select options are used. If there is neither a parameter value * nor a default value, <code>null</code> is returned.<p> * * @param cms the current users OpenCms context * @param selectOptions the available select options * @param currentValue the current value that is selected * * @return the currently selected value of the select widget */ protected String getSelectedValue(CmsObject cms, List selectOptions, String currentValue) { String paramValue = currentValue; if (CmsStringUtil.isEmpty(paramValue)) { CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(selectOptions); if (option != null) { paramValue = option.getValue(); } } return paramValue; } }
/** * Returns the currently selected value of the select widget.<p> * * If a value is found in the given parameter, this is used. Otherwise * the default value of the select options are used. If there is neither a parameter value * nor a default value, <code>null</code> is returned.<p> * * @param cms the current users OpenCms context * @param selectOptions the available select options * @param currentValue the current value that is selected * * @return the currently selected value of the select widget */ protected String getSelectedValue(CmsObject cms, List<CmsSelectWidgetOption> selectOptions, String currentValue) { String paramValue = currentValue; if (CmsStringUtil.isEmpty(paramValue)) { CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(selectOptions); if (option != null) { paramValue = option.getValue(); } } return paramValue; } }
/** * Returns the currently selected value of the select widget.<p> * * If a value is found in the given parameter, this is used. Otherwise * the default value of the select options are used. If there is neither a parameter value * nor a default value, <code>null</code> is returned.<p> * * @param cms the current users OpenCms context * @param param the widget parameter of this dialog * * @return the currently selected value of the select widget */ protected String getSelectedValue(CmsObject cms, I_CmsWidgetParameter param) { String paramValue = param.getStringValue(cms); if (CmsStringUtil.isEmpty(paramValue)) { CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(m_selectOptions); if (option != null) { paramValue = option.getValue(); } } return paramValue; }
/** * Returns the currently selected value of the select widget.<p> * * If a value is found in the given parameter, this is used. Otherwise * the default value of the select options are used. If there is neither a parameter value * nor a default value, <code>null</code> is returned.<p> * * @param cms the current users OpenCms context * @param param the widget parameter of this dialog * * @return the currently selected value of the select widget */ protected String getSelectedValue(CmsObject cms, I_CmsWidgetParameter param) { String paramValue = param.getStringValue(cms); if (CmsStringUtil.isEmpty(paramValue)) { CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(m_selectOptions); if (option != null) { paramValue = option.getValue(); } } return paramValue; }