Author: dolander
Date: Tue Feb 22 19:54:34 2005
New Revision: 154946
URL: http://svn.apache.org/viewcvs?view=rev&rev=154946
Log:
UPdated version of the reordering of the select options
moved a few tests into the coretags form tags for a bit better organization
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Controller.jpf
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Results.jsp
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/index.jsp
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Controller.jpf
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Results.jsp
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/index.jsp
Removed:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/selectOrder/
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelect/index.jsp
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelectTypeError/index.jsp
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/xhtml/selectTest.jsp
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java?view=diff&r1=154945&r2=154946
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Select.java
Tue Feb 22 19:54:34 2005
@@ -28,6 +28,7 @@
import org.apache.beehive.netui.tags.rendering.*;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.iterator.IteratorFactory;
+import org.apache.beehive.netui.util.iterator.ArrayIterator;
import org.apache.beehive.netui.util.logging.Logger;
import javax.servlet.ServletRequest;
@@ -165,7 +166,8 @@
// @todo: needs to create DRT tests for: verification of errors,
verirication of data sources matching,
// @todo: verification of formating inside a repeater.
// @todo: on the null tag, we need to default the null value to NULL_VALUE
- // @todo: need to handle null.
+ // @todo: need to handle null, in the options
+ // @todo: should handle no optionDataSource when repeating...
private static final Logger logger = Logger.getInstance(Select.class);
@@ -174,79 +176,91 @@
private InputHiddenTag.State _hiddenState = new InputHiddenTag.State();
private boolean _formatterError = false;
+ private static Object[] NULL_INSTANCE = {null};
+
+
+ /**
+ * This enum defines stages through the possible option values.
+ */
public enum RepeatingStages
{
BEFORE (0),
OPTION (1),
DEFAULT (2),
DATASOURCE (3),
- DATA (4),
- NULL (5),
- DONE (6);
+ NULL (4),
+ DONE (5);
+
+ /**
+ * These are the publically exposed stages, <code>REPEATING_OPTION,
REPEATING_DEFAULT,
+ * REPEATING_DATASOURCE and REPEATING_NULL</code>.
+ */
+ public static final String REPEATING_OPTION = "option";
+ public static final String REPEATING_DEFAULT = "default";
+ public static final String REPEATING_DATASOURCE = "dataSource";
+ public static final String REPEATING_NULL = "null";
public int value;
- RepeatingStages(int val)
+ // prevent construction...
+ private RepeatingStages(int val)
{
value = val;
}
- }
-
- /**
- * Default value of the options <code>value</code> attribute.
- */
- public static final String NULL_VALUE = "netui_null";
-
- /**
- * Constant value of the <code>repeatingType</code> attribute for options
handling the <code>optionsDataSource</code>.
- */
- public static final String REPEATING_OPTION = "Option";
+ /**
+ * Returns the String value that can be used to order the selection.
+ * @return The String Value.
+ */
+ public String toString()
+ {
+ switch (this) {
+ case OPTION: return REPEATING_OPTION;
+ case DEFAULT: return REPEATING_DEFAULT;
+ case DATASOURCE: return REPEATING_DATASOURCE;
+ case NULL: return REPEATING_NULL;
+ default:
+ return "Unknown Stage";
+ }
+ }
- /**
- * Constant value of the <code>repeatingType</code> attribute for options
handling the <code>defaultValue</code>.
- */
- public static final String REPEATING_DEFAULT = "Default";
+ /**
+ * Given a String value defined above, return the enum value for it.
+ * @param value a String value matching one of the public Strings
defined for the class.
+ * @return the matching RepeatingStages or null.
+ */
+ public static RepeatingStages parseString(String value)
+ {
+ if (REPEATING_OPTION.equals(value))
+ return OPTION;
+ if (REPEATING_DEFAULT.equals(value))
+ return DEFAULT;
+ if (REPEATING_DATASOURCE.equals(value))
+ return DATASOURCE;
+ if (REPEATING_NULL.equals(value))
+ return NULL;
+ return null;
+ }
+ }
/**
- * Constant value of the <code>repeatingType</code> attribute for options
handling the <code>dataSource</code>.
+ * This defines the default order of processing the options when repeating.
*/
- public static final String REPEATING_DATASOURCE = "DataSource";
+ private static final RepeatingStages[] DEFAULT_ORDER =
{RepeatingStages.BEFORE,
+
RepeatingStages.OPTION,
+
RepeatingStages.DATASOURCE,
+
RepeatingStages.DEFAULT,
+
RepeatingStages.NULL};
/**
- * Constant value of the <code>repeatingType</code> attribute for options
handling the <code>optionsDataSource,
- * defaultValue and dataSource</code>.
+ * Default value of the options <code>value</code> attribute.
*/
- public static final String REPEATING_DATA = "Data";
+ public static final String NULL_VALUE = "netui_null";
/**
* Constant value of the <code>repeatingType</code> attribute for options
handling the <code>null</code> option.
*/
- public static final String REPEATING_NULL = "Null";
-
- /**
- * <code>int</code> value returned by <code>getRepeatingStage</code> when
the <code>optionsDataSource</code>
- * is being processed.
- */
- public static final int STAGE_OPTION = 1;
-
- /**
- * <code>int</code> value returned by <code>getRepeatingStage</code> when
the <code>dataSource</code>
- * is being processed.
- */
- public static final int STAGE_DATASOURCE = 2;
-
- /**
- * <code>int</code> value returned by <code>getRepeatingStage</code> when
the <code>defaultValue</code>
- * is being processed.
- */
- public static final int STAGE_DEFAULT = 3;
-
- /**
- * <code>int</code> value returned by <code>getRepeatingStage</code> when
the <code>null</code> option
- * is being processed.
- */
- public static final int STAGE_NULL = 4;
+ //public static final String REPEATING_NULL = "Null";
private static final String SELECT_KEY = "select_key";
private static final String OLDVALUE_SUFFIX = "OldValue";
@@ -256,6 +270,9 @@
private RepeatingStages _repCurStage = RepeatingStages.BEFORE; // The
current stage defined by the stage constants above
private boolean _repeater; // Boolean flag indicating if this is
a repeater or not
private Object _repCurItem; // The current item access by the
IDataAccessProvider
+ private Iterator _repeaterIterator; // The iterator being used to output
the options.
+ private RepeatingStages[] _order = DEFAULT_ORDER;
+
private Object _dynamicOptions; // The interator (or map) for the
options data source, repeating this is current var
private String _saveBody;
@@ -277,10 +294,7 @@
l.add(new IndexedNameInterceptor());
l.add(new PrefixNameInterceptor(SELECT_KEY));
_internalNamingChain = Collections.unmodifiableList(l);
- }
- static
- {
org.apache.beehive.netui.pageflow.ProcessPopulate.registerPrefixHandler(SELECT_KEY,
new SelectPrefixHandler());
}
@@ -453,8 +467,23 @@
* description="Define the order of options for a repeating Select"
*/
public void setRepeatingOrder(String order)
+ throws JspException
{
-
+ String[] options = order.split(",");
+ for (int i=0;i<options.length;i++) {
+ System.err.println("Option:" + options[i]);
+ }
+ RepeatingStages[] stageOrder = new RepeatingStages[options.length+1];
+ stageOrder[0] = RepeatingStages.BEFORE;
+ for (int i=0;i<options.length;i++) {
+ String opt = options[i].trim();
+ stageOrder[i+1] = RepeatingStages.parseString(opt);
+ if (stageOrder[i+1] == null) {
+ String s = Bundle.getString("Tags_SelectBadRepeatingStage",
new Object[] {opt});
+ registerTagError(s, null);
+ }
+ }
+ _order = stageOrder;
}
/**
@@ -626,22 +655,42 @@
return (IDataAccessProvider) findAncestorWithClass(this,
IDataAccessProvider.class);
}
+ /**
+ * Return the enum value of the currently repeating stage.
+ * @return The currently repeating stage.
+ */
public RepeatingStages getRepeatingStage() {
return _repCurStage;
}
+ /**
+ * Boolean indicating that we are processing the optionsDataSource.
+ * @return <code>true</code> if we are processing the optionsDataSource.
+ */
public boolean isOptionStage() {
return _repCurStage == RepeatingStages.OPTION;
}
+
+ /**
+ * Boolean indicating that we are processing the defaultValue.
+ * @return <code>true</code> if we are processing the defaultValue.
+ */
public boolean isDefaultStage() {
return _repCurStage == RepeatingStages.DEFAULT;
}
+
+ /**
+ * Boolean indicating that we are processing the dataSource.
+ * @return <code>true</code> if we are processing the dataSource.
+ */
public boolean isDataSourceStage() {
return _repCurStage == RepeatingStages.DATASOURCE;
}
- public boolean isDataStage() {
- return _repCurStage == RepeatingStages.DATA;
- }
+
+ /**
+ * Boolean indicating that we are processing the defined null value.
+ * @return <code>true</code> if we are processing the defined null value.
+ */
public boolean isNullStage() {
return _repCurStage == RepeatingStages.NULL;
}
@@ -670,21 +719,10 @@
// Walk the options data source
_dynamicOptions = evaluateOptionsDataSource();
if (_repeater) {
- // @todo: need to support nulls...
- if (!(_dynamicOptions instanceof Iterator)) {
- String s = Bundle.getString("Tags_OptionsDSIteratorError");
- registerTagError(s, null);
- return SKIP_BODY;
- }
- Iterator it = (Iterator) _dynamicOptions;
- if (!it.hasNext()) {
- _repCurStage = RepeatingStages.NULL;
+ _repCurStage = _order[0];
+ boolean valid = doRepeaterAfterBody();
+ if (!valid)
return SKIP_BODY;
-
- }
- _repCurItem = it.next();
- _repCurStage = RepeatingStages.OPTION;
-
DataAccessProviderStack.addDataAccessProvider(this, pageContext);
}
@@ -859,6 +897,8 @@
_dynamicOptions = null;
_formatterError = false;
_optRb = null;
+
+ _order = DEFAULT_ORDER;
}
private String getErrorsFromBody()
@@ -898,65 +938,105 @@
return error.toString();
}
+ /**
+ * This method will side affects the <code>_repCurItem</code> to insure
that it
+ * is set to the next item in the iteration set. It will return
<code>true</code>
+ * if there is a next item, and <code>false</code> when we are done with
the iteration
+ * @return returns <code>true</code> when <code>_repCurItem</code>
contains the next item and
+ * <code>false</code> when we are done.
+ * @throws JspException
+ */
private boolean doRepeaterAfterBody()
+ throws JspException
{
- _repIdx++;
- if (isOptionStage()) {
- assert (_dynamicOptions instanceof Iterator);
- while (((Iterator) _dynamicOptions).hasNext()) {
- _repCurItem = ((Iterator) _dynamicOptions).next();
- // @todo: what do we do if there is a null?
- if (_repCurItem != null) {
- _optionList.add(_repCurItem);
- return true;
+ switch (_repCurStage) {
+ case BEFORE:
+ moveNext();
+ return doRepeaterAfterBody();
+ case OPTION:
+ assert (_repeaterIterator instanceof Iterator);
+ while (_repeaterIterator.hasNext()) {
+ _repCurItem = _repeaterIterator.next();
+ if (_repCurItem != null) {
+ _optionList.add(_repCurItem);
+ return true;
+ }
}
- }
-
- // initialize for the next stage which must follow this stage in
the code: (Basically a fall through)
- _repCurStage = RepeatingStages.DATASOURCE;
- if (_match != null) {
- _dynamicOptions = Arrays.asList(_match).iterator();
- }
- }
-
- if (isDataSourceStage()) {
- if (_dynamicOptions != null) {
- assert (_dynamicOptions instanceof Iterator);
- while (((Iterator) _dynamicOptions).hasNext()) {
- _repCurItem = ((Iterator) _dynamicOptions).next();
+ if (!moveNext())
+ return false;
+ return doRepeaterAfterBody();
+
+ case DEFAULT:
+ case DATASOURCE:
+ case NULL:
+ assert (_repeaterIterator instanceof Iterator);
+ while (_repeaterIterator.hasNext()) {
+ _repCurItem = _repeaterIterator.next();
if (!_optionList.contains(_repCurItem)) {
_optionList.add(_repCurItem);
return true;
}
}
- }
-
- // initialize for the next stage which must follow this stage in
the code
- _repCurStage = RepeatingStages.DEFAULT;
- if (_defaultSelections != null) {
- _dynamicOptions = _defaultSelections.iterator();
- }
+ if (!moveNext())
+ return false;
+ return doRepeaterAfterBody();
}
+ return false;
+ }
- if (isDefaultStage()) {
- if (_dynamicOptions != null) {
- assert (_dynamicOptions instanceof Iterator);
- while (((Iterator) _dynamicOptions).hasNext()) {
- _repCurItem = ((Iterator) _dynamicOptions).next();
- if (!_optionList.contains(_repCurItem)) {
- return true;
- }
+ /**
+ * This method will move to the next iteration type. The order of the
+ * iteration is defined by the <code>_order</code> array. The result
+ * is side affecting the _repeaterIterator by initializing it. If there
+ * is nothing further, then we will return false, otherwise we return true.
+ * @return
+ * @throws JspException
+ */
+ private boolean moveNext()
+ throws JspException
+ {
+ // increment the current position, if we are beyond the end of the
array return
+ _repIdx++;
+ if (_repIdx == _order.length)
+ return false;
+
+ // Get the next stage and clear the _repeaterIterator
+ _repCurStage = _order[_repIdx];
+ _repeaterIterator = null;
+
+ // process each type of iteration...
+ // Each will recursively call moveNext, if that stage doesn't support
iteration
+ switch (_repCurStage) {
+ case BEFORE:
+ break;
+ case OPTION:
+ // This produces an error if the optionsDataSource is an
instance of an iterator
+ if (!(_dynamicOptions instanceof Iterator)) {
+ String s = Bundle.getString("Tags_OptionsDSIteratorError");
+ registerTagError(s, null);
+ return false;
}
- }
- // initialize for the next stage which must follow this stage in
the code
- _repCurItem = null;
- if (_nullable) {
- _repCurStage = RepeatingStages.NULL;
- return true;
- }
+ assert(_dynamicOptions instanceof Iterator);
+ _repeaterIterator = (Iterator) _dynamicOptions;
+ break;
+
+ case DEFAULT:
+ if (_defaultSelections != null)
+ _repeaterIterator = _defaultSelections.iterator();
+ break;
+ case DATASOURCE:
+ if (_match != null)
+ _repeaterIterator = Arrays.asList(_match).iterator();
+ break;
+ case NULL:
+ if (_nullable)
+ _repeaterIterator = new ArrayIterator(NULL_INSTANCE);
+ break;
}
- return false;
+
+ // return true when we set the iterator, otherwise move to the next
stage.
+ return (_repeaterIterator != null) ? true : moveNext();
}
/**
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java?view=diff&r1=154945&r2=154946
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/SelectOption.java
Tue Feb 22 19:54:34 2005
@@ -63,7 +63,7 @@
private String _text; // The message text to be displayed to
the user for this tag (if any)
private boolean _disabled; // Is this option disabled?
private String _value; // The server value for this option
- private String _repeatingType; // The type of the repeater.
+ private Select.RepeatingStages _repeatingType; // The type of the
repeater.
private boolean _hasError = false; // Hack to avoid registering the same
error in the SelectOption AND the Select.
/**
@@ -140,15 +140,6 @@
}
/**
- * Gets if this option is disabled or not.
- * @return the disabled state ("true" or "false")
- */
- public String getRepeatingType()
- {
- return _repeatingType;
- }
-
- /**
* If the options is being used inside a repeating Select, this is the
type of the option.
* @param repeatingType - "Options", "Default", "DataSource", "Null",
"Data"
* @netui:attribute required="false" rtexprvalue="true"
@@ -157,7 +148,7 @@
*/
public void setRepeatingType(String repeatingType)
{
- _repeatingType = repeatingType;
+ _repeatingType = Select.RepeatingStages.parseString(repeatingType);
}
/**
@@ -330,14 +321,12 @@
return true;
if (sel.isNullStage())
- return _repeatingType.equals(Select.REPEATING_NULL);
- if (_repeatingType.equals(Select.REPEATING_DATA))
- return true;
- if (sel.isOptionStage() &&
_repeatingType.equals(Select.REPEATING_OPTION))
+ return _repeatingType == Select.RepeatingStages.NULL;
+ if (sel.isOptionStage() && _repeatingType ==
Select.RepeatingStages.OPTION)
return true;
- if (sel.isDataSourceStage() &&
_repeatingType.equals(Select.REPEATING_DATASOURCE))
+ if (sel.isDataSourceStage() && _repeatingType ==
Select.RepeatingStages.DATASOURCE)
return true;
- if (sel.isDefaultStage() &&
_repeatingType.equals(Select.REPEATING_DEFAULT))
+ if (sel.isDefaultStage() && _repeatingType ==
Select.RepeatingStages.DEFAULT)
return true;
return false;
}
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties?view=diff&r1=154945&r2=154946
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
Tue Feb 22 19:54:34 2005
@@ -8,6 +8,7 @@
Tags_NullBadAction=Action was resolved as "", this is probably the result of
an expression bound to a null Object.
Tags_NullAction=The expression {0} results in a null action.
Tags_SelectBadTagValue=Could not set Select with given value {0}.
+Tags_SelectBadRepeatingStage=''{0}'' is an invalid stage for a repeating
Select box. Please use <b>option, default, dataSource or null</b>
Tags_RadioButtonGroupBadTagValue=Could not set RadioButtonGroup with given
value {0}.
Tags_CheckBoxGroupBadTagValue=Could not set CheckBoxGroup with given value {0}.
Tags_FormNoFormBean=Could not find a form bean for this Form tag.
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Controller.jpf?view=auto&rev=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Controller.jpf
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Controller.jpf
Tue Feb 22 19:54:34 2005
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package coretags.select.selectOrder;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+)
+public class Controller extends PageFlowController
+{
+ private Options[] opts;
+ private String[] results1;
+ private String resultsTwo;
+
+ public Options[] getOpts()
+ {
+ return opts;
+ }
+
+ public void setOpts(Options[] opts)
+ {
+ this.opts = opts;
+ }
+
+ public String[] getResults1()
+ {
+ return results1;
+ }
+ public void setResults1(String[] results1)
+ {
+ this.results1 = results1;
+ }
+
+ public String getResultsTwo()
+ {
+ return resultsTwo;
+ }
+
+ public void setResultsTwo(String resultsTwo)
+ {
+ this.resultsTwo = resultsTwo;
+ }
+
+ protected void onCreate()
+ {
+ // initialize the opts
+ opts = new Options[3];
+ opts[0] = new Options("Option One","opt-1", "normal");
+ opts[1] = new Options("Option Two","opt-2", "normal2");
+ opts[2] = new Options("Option Three","opt-3", "normal3");
+ }
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="index" path="index.jsp"
+ */
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(
+ name = "index",
+ path = "index.jsp")
+ })
+ protected Forward begin()
+ {
+ return new Forward("index");
+ }
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="index" path="Results.jsp"
+ */
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(
+ name = "index",
+ path = "Results.jsp")
+ })
+ protected Forward post()
+ {
+ return new Forward("index");
+ }
+
+ public static class Options implements java.io.Serializable {
+ private String _name;
+ private String _optionValue;
+ private String _style;
+
+ public Options(String name, String value, String style) {
+ _name = name;
+ _optionValue = value;
+ _style = style;
+ }
+
+ public void setName(String name) {
+ _name = name;
+ }
+ public String getName() {
+ return _name;
+ }
+
+ public void setOptionValue(String optionValue) {
+ _optionValue = optionValue;
+ }
+ public String getOptionValue() {
+ return _optionValue;
+ }
+
+ public void setStyle(String style) {
+ _style = style;
+ }
+ public String getStyle() {
+ return _style;
+ }
+ }
+}
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Results.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Results.jsp?view=auto&rev=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Results.jsp
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/Results.jsp
Tue Feb 22 19:54:34 2005
@@ -0,0 +1,20 @@
+<[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java"%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
+<html>
+ <head>
+ </head>
+ <body>
+ <h4>Results One</h4>
+ <netui:anchor action="begin">Home</netui:anchor>
+ <ul>
+ <netui-data:repeater dataSource="pageFlow.resultsOne">
+ <li><netui:span value="${container.item}"/></li>
+ </netui-data:repeater>
+ </ul>
+ <br/>
+ Results Two: <netui:span value="${pageFlow.resultsTwo}" />
+ </body>
+</html>
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/index.jsp?view=auto&rev=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/index.jsp
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrder/index.jsp
Tue Feb 22 19:54:34 2005
@@ -0,0 +1,48 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<netui:html>
+ <head>
+ <title>Order Repeating Select</title>
+ <style type="text/css">
+ .normalAttr {color: #cc0099;font-family:Verdana;
font-size:8pt;margin:0,0,0,0;}
+ </style>
+ </head>
+ <netui:body>
+ <h4>Order Repeating SElect</h4>
+ <p style="color:green">This will test some combination of the ordered
repeating options
+ </p>
+ <netui:form action="post">
+ <table>
+ <tr><td>
+ <b>Null, Default, Options -> results1</b><br>
+ <!-- 5 options, default value and null -->
+ <netui:select dataSource="pageFlow.results1" defaultValue="default
Value"
+ optionsDataSource="${pageFlow.opts}" repeater="true" size="5"
+ repeatingOrder="null, default, option"
+ multiple="true" nullable="true">
+ <c:if test="${container.metadata.optionStage}">
+ <netui:selectOption repeatingType="option"
+ value="${container.item.optionValue}"
styleClass="normalAttr">
+ <netui:span value="${container.item.name}" />
+ </netui:selectOption>
+ </c:if>
+ <c:if test="${container.metadata.defaultStage}">
+ <netui:selectOption repeatingType="default"
+ value="${container.item}" styleClass="normalAttr">
+ <netui:span value="${container.item}" />
+ </netui:selectOption>
+ </c:if>
+ <netui:selectOption repeatingType="null" value="null-opt"
+ styleClass="normalAttr">
+ <netui:span value="[Nothing]" />
+ </netui:selectOption>
+ </netui:select>
+ <tr><td><netui:button value="Post" /></td></tr>
+ <table>
+ </netui:form>
+ </netui:body>
+</netui:html>
+
+
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Controller.jpf?view=auto&rev=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Controller.jpf
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Controller.jpf
Tue Feb 22 19:54:34 2005
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package coretags.select.selectOrderError;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+)
+public class Controller extends PageFlowController
+{
+ private Options[] opts;
+ private String[] results1;
+ private String resultsTwo;
+
+ public Options[] getOpts()
+ {
+ return opts;
+ }
+
+ public void setOpts(Options[] opts)
+ {
+ this.opts = opts;
+ }
+
+ public String[] getResults1()
+ {
+ return results1;
+ }
+ public void setResults1(String[] results1)
+ {
+ this.results1 = results1;
+ }
+
+ public String getResultsTwo()
+ {
+ return resultsTwo;
+ }
+
+ public void setResultsTwo(String resultsTwo)
+ {
+ this.resultsTwo = resultsTwo;
+ }
+
+ protected void onCreate()
+ {
+ // initialize the opts
+ opts = new Options[3];
+ opts[0] = new Options("Option One","opt-1", "normal");
+ opts[1] = new Options("Option Two","opt-2", "normal2");
+ opts[2] = new Options("Option Three","opt-3", "normal3");
+ }
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="index" path="index.jsp"
+ */
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(
+ name = "index",
+ path = "index.jsp")
+ })
+ protected Forward begin()
+ {
+ return new Forward("index");
+ }
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="index" path="Results.jsp"
+ */
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(
+ name = "index",
+ path = "Results.jsp")
+ })
+ protected Forward post()
+ {
+ return new Forward("index");
+ }
+
+ public static class Options implements java.io.Serializable {
+ private String _name;
+ private String _optionValue;
+ private String _style;
+
+ public Options(String name, String value, String style) {
+ _name = name;
+ _optionValue = value;
+ _style = style;
+ }
+
+ public void setName(String name) {
+ _name = name;
+ }
+ public String getName() {
+ return _name;
+ }
+
+ public void setOptionValue(String optionValue) {
+ _optionValue = optionValue;
+ }
+ public String getOptionValue() {
+ return _optionValue;
+ }
+
+ public void setStyle(String style) {
+ _style = style;
+ }
+ public String getStyle() {
+ return _style;
+ }
+ }
+}
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Results.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Results.jsp?view=auto&rev=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Results.jsp
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/Results.jsp
Tue Feb 22 19:54:34 2005
@@ -0,0 +1,20 @@
+<[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java"%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
+<html>
+ <head>
+ </head>
+ <body>
+ <h4>Results One</h4>
+ <netui:anchor action="begin">Home</netui:anchor>
+ <ul>
+ <netui-data:repeater dataSource="pageFlow.resultsOne">
+ <li><netui:span value="${container.item}"/></li>
+ </netui-data:repeater>
+ </ul>
+ <br/>
+ Results Two: <netui:span value="${pageFlow.resultsTwo}" />
+ </body>
+</html>
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/index.jsp?view=auto&rev=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/index.jsp
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/select/selectOrderError/index.jsp
Tue Feb 22 19:54:34 2005
@@ -0,0 +1,48 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<netui:html>
+ <head>
+ <title>Order Repeating Select</title>
+ <style type="text/css">
+ .normalAttr {color: #cc0099;font-family:Verdana;
font-size:8pt;margin:0,0,0,0;}
+ </style>
+ </head>
+ <netui:body>
+ <h4>Order Repeating SElect</h4>
+ <p style="color:green">This will test some combination of the ordered
repeating options
+ </p>
+ <netui:form action="post">
+ <table>
+ <tr><td>
+ <b>Null, Default, Options -> results1</b><br>
+ <!-- 5 options, default value and null -->
+ <netui:select dataSource="pageFlow.results1" defaultValue="default
Value"
+ optionsDataSource="${pageFlow.opts}" repeater="true" size="5"
+ repeatingOrder="nulls, TheDefault, option"
+ multiple="true" nullable="true">
+ <c:if test="${container.metadata.optionStage}">
+ <netui:selectOption repeatingType="option"
+ value="${container.item.optionValue}"
styleClass="normalAttr">
+ <netui:span value="${container.item.name}" />
+ </netui:selectOption>
+ </c:if>
+ <c:if test="${container.metadata.defaultStage}">
+ <netui:selectOption repeatingType="default"
+ value="${container.item}" styleClass="normalAttr">
+ <netui:span value="${container.item}" />
+ </netui:selectOption>
+ </c:if>
+ <netui:selectOption repeatingType="null" value="null-opt"
+ styleClass="normalAttr">
+ <netui:span value="[Nothing]" />
+ </netui:selectOption>
+ </netui:select>
+ <tr><td><netui:button value="Post" /></td></tr>
+ <table>
+ </netui:form>
+ </netui:body>
+</netui:html>
+
+
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelect/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelect/index.jsp?view=diff&r1=154945&r2=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelect/index.jsp
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelect/index.jsp
Tue Feb 22 19:54:34 2005
@@ -18,10 +18,10 @@
<tr><td>
<netui:select dataSource="pageFlow.resultsOne"
optionsDataSource="${pageFlow.opts}" repeater="true" size="3"
multiple="true">
- <netui:selectOption repeatingType="Option"
value="${container.item.optionValue}" styleClass="normalAttr">
+ <netui:selectOption repeatingType="option"
value="${container.item.optionValue}" styleClass="normalAttr">
<netui:span value="${container.item.name}" />
</netui:selectOption>
- <netui:selectOption repeatingType="Null" value="null-opt"
styleClass="normalAttr">
+ <netui:selectOption repeatingType="null" value="null-opt"
styleClass="normalAttr">
<netui:span value="[Nothing]" />
</netui:selectOption>
</netui:select>
@@ -30,12 +30,12 @@
<netui:select dataSource="pageFlow.resultsTwo"
optionsDataSource="${pageFlow.opts}" repeater="true"
nullable="true">
<c:if test="${container.metadata.optionStage}">
- <netui:selectOption repeatingType="Option"
value="${container.item.optionValue}" styleClass="normalAttr">
+ <netui:selectOption repeatingType="option"
value="${container.item.optionValue}" styleClass="normalAttr">
<netui:span value="${container.item.name}" />
</netui:selectOption>
</c:if>
<c:if test="${container.metadata.nullStage}">
- <netui:selectOption repeatingType="Null" value="null-opt"
styleClass="normalAttr">
+ <netui:selectOption repeatingType="null" value="null-opt"
styleClass="normalAttr">
<netui:span value="[Nothing]" />
</netui:selectOption>
</c:if>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelectTypeError/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelectTypeError/index.jsp?view=diff&r1=154945&r2=154946
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelectTypeError/index.jsp
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/repeatSelectTypeError/index.jsp
Tue Feb 22 19:54:34 2005
@@ -20,7 +20,7 @@
<netui:selectOption value="${container.item.optionValue}"
styleClass="normalAttr">
<netui:span value="${container.item.name}" />
</netui:selectOption>
- <netui:selectOption repeatingType="Null" value="null-opt"
styleClass="normalAttr">
+ <netui:selectOption repeatingType="null" value="null-opt"
styleClass="normalAttr">
<netui:span value="[Nothing]" />
</netui:selectOption>
</netui:select>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/xhtml/selectTest.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/xhtml/selectTest.jsp?view=diff&r1=154945&r2=154946
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/xhtml/selectTest.jsp
(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/xhtml/selectTest.jsp
Tue Feb 22 19:54:34 2005
@@ -52,10 +52,10 @@
<td>
<netui:select dataSource="actionForm.nullable"
optionsDataSource="${pageFlow.nullSelectOptions}"
size="7" nullable="true"
defaultValue="${pageFlow.selectDefault}" repeater="true">
- <netui:selectOption repeatingType="Option"
value="${container.item}" styleClass="normalAttr" />
- <netui:selectOption repeatingType="DataSource"
value="ds ${container.item}" styleClass="normalAttr2" />
- <netui:selectOption repeatingType="Default"
value="def ${container.item}" styleClass="normalAttr3" />
- <netui:selectOption repeatingType="Null"
value="Null" styleClass="normalAttr4"/>
+ <netui:selectOption repeatingType="option"
value="${container.item}" styleClass="normalAttr" />
+ <netui:selectOption repeatingType="dataSource"
value="ds ${container.item}" styleClass="normalAttr2" />
+ <netui:selectOption repeatingType="default"
value="def ${container.item}" styleClass="normalAttr3" />
+ <netui:selectOption repeatingType="null"
value="Null" styleClass="normalAttr4"/>
</netui:select>
</td>
</tr>