Author: adubovsky
Date: 2008-11-21 04:42:06 -0500 (Fri, 21 Nov 2008)
New Revision: 11286
Modified:
trunk/test-applications/automator/src/main/java/comboBox/ComboBoxGeneral.java
trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp
Log:
Modified: trunk/test-applications/automator/src/main/java/comboBox/ComboBoxGeneral.java
===================================================================
---
trunk/test-applications/automator/src/main/java/comboBox/ComboBoxGeneral.java 2008-11-21
00:59:48 UTC (rev 11285)
+++
trunk/test-applications/automator/src/main/java/comboBox/ComboBoxGeneral.java 2008-11-21
09:42:06 UTC (rev 11286)
@@ -8,6 +8,7 @@
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import javax.faces.validator.ValidatorException;
import org.richfaces.component.html.HtmlComboBox;
@@ -29,9 +30,12 @@
private String align;
private String validatorMessage;
- private String statusValidator = "FAILED";
+ private boolean statusValidator = false;
private String phaseValidator = "UNDEFINED";
private String validatorMessageTest = "";
+
+ private boolean statusValueChangeListener = false;
+ private String phaseValueChangeListener = "UNDEFINED";
private TLDParser tldParser = new TLDParser("comboBox");
private AttributesList attrs = tldParser.getAllAttributes();
@@ -54,13 +58,49 @@
this.alignCheck();
this.validatorMessageCheck();
this.bindingCheck();
+ this.valueChangeListenerCheck();
DrawGrids.showResultGrid(panelGrid, generalAttrs);
}
+
+ public void valueChangeListener(ValueChangeEvent e) {
+ System.out.println("valueChangeListener work!!!!!!!!!!!!!!");
+
+ statusValueChangeListener = true;
+ phaseValueChangeListener = PhaseTracker.currentPhase.toString();
+ }
+
+ public void valueChangeListenerCheck() {
+ int index = generalAttrs.indexOf(new Attribute("valueChangeListener"));
+ if (index == -1) {
+ generalAttrs
+ .add(new Attribute(
+ "valueChangeListener",
+ "",
+ "", Status.IMPLEMENTED));
+ } else {
+ Attribute attr = generalAttrs.get(index);
+ if (statusValueChangeListener) {
+ if ((phaseValueChangeListener.equals("PROCESS_VALIDATIONS 3"))
+ && (!immediate)
+ || (phaseValueChangeListener.equals("APPLY_REQUEST_VALUES 2"))
+ && (immediate)) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ attr
+ .setDescription("ValueChangeListener was triggered on incorrect
phase");
+ }
+ } else {
+ attr.setStatus(Status.FAILED);
+ attr.setDescription("ValueChangeListener was not triggered");
+ }
+ }
+ }
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
- statusValidator = "PASSED";
+ statusValidator = true;
phaseValidator = PhaseTracker.currentPhase.toString();
String selectedItem = null;
@@ -82,7 +122,7 @@
"", Status.IMPLEMENTED));
} else {
Attribute attr = generalAttrs.get(index);
- if (statusValidator.equals("PASSED")) {
+ if (statusValidator) {
if ((phaseValidator.equals("PROCESS_VALIDATIONS 3"))
&& (!immediate)
|| (phaseValidator.equals("APPLY_REQUEST_VALUES 2"))
Modified: trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp
===================================================================
--- trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp 2008-11-21
00:59:48 UTC (rev 11285)
+++ trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp 2008-11-21
09:42:06 UTC (rev 11286)
@@ -28,10 +28,13 @@
onmousemove="callOnmousemove('comboBox')"
onmouseout="callOnmouseout('comboBox')"
onmouseup="callOnmouseup('comboBox')"
- onselect="callOnselect('comboBox')">
+ onselect="callOnselect('comboBox')"
+ valueChangeListener="#{comboBoxGeneral.valueChangeListener}">
+
<f:selectItems value="#{comboBoxGeneral.selectItems}" />
<f:selectItem itemValue="Gosha" itemLabel="Gosha" />
</rich:comboBox>
+
<h:inputHidden id="hiddenInput"
value="#{comboBoxGeneral.validatorMessageTest}" />
</h:panelGrid>
Show replies by date