JBoss Rich Faces SVN: r11090 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/inplaceInput and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-11-11 13:41:36 -0500 (Tue, 11 Nov 2008)
New Revision: 11090
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
Log:
tests for inplaceinput
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-11-11 17:46:12 UTC (rev 11089)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-11-11 18:41:36 UTC (rev 11090)
@@ -21,6 +21,8 @@
private String newText = "";
+ private String iiValue = "test";
+
/**
* Gets value of text field.
* @return value of text field
@@ -64,4 +66,20 @@
public void setNewText(String newText) {
this.newText = newText;
}
+
+ /**
+ * @return the iiValue
+ */
+ public String getIiValue() {
+ return iiValue;
+ }
+
+ /**
+ * @param iiValue the iiValue to set
+ */
+ public void setIiValue(String iiValue) {
+ this.iiValue = iiValue;
+ }
+
+
}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml 2008-11-11 18:41:36 UTC (rev 11090)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testBasicBehaviour</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tbb">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceInput id="ii_tbb" value="#{inplaceInputBean.iiValue}">
+ </rich:inplaceInput>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml 2008-11-11 17:46:12 UTC (rev 11089)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml 2008-11-11 18:41:36 UTC (rev 11090)
@@ -14,7 +14,7 @@
<tr>
<td></td>
<td>
- <rich:inplaceInput id="ii_tja" value="test" showControls="true">
+ <rich:inplaceInput id="ii_tja" value="#{inplaceInputBean.iiValue}" showControls="true">
</rich:inplaceInput>
<button id="okButton_tja" onclick="#{rich:component('ii_tja')}.save();return false;">ok</button>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml 2008-11-11 18:41:36 UTC (rev 11090)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testRenderedAttribute</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tra">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceInput id="ii_tra" value="#{inplaceInputBean.iiValue}" rendered="false">
+ </rich:inplaceInput>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-11 17:46:12 UTC (rev 11089)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-11 18:41:36 UTC (rev 11090)
@@ -85,6 +85,14 @@
private static final String JS_API_ID_PREFIX = "_tja";
+ private static final String RENDERED_ATTRIBUTE_PAGE = "testRenderedAttribute.xhtml";
+
+ private static final String RENDERED_ATTRIBUTE_ID_PREFIX = "_tra";
+
+ private static final String BASIC_BEHAVIOUR_PAGE = "testBasicBehaviour.xhtml";
+
+ private static final String BASIC_BEHAVIOUR_ID_PREFIX = "_tbb";
+
private String testUrl;
private String formId;
@@ -497,10 +505,10 @@
String iid = inplaceInputId + JS_API_ID_PREFIX;
selenium.runScript("var inplaceinput = ($('" + iid + "')).component;");
- //Assert.assertTrue("test".equals(selenium.getEval("window.inplaceinput.getValue()")));
+ Assert.assertTrue("test".equals(selenium.getEval("window.inplaceinput.getValue()")));
- //selenium.getEval("window.inplaceinput.setValue('', 'JSApi')");
- //Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplaceinput.getValue()")));
+ selenium.getEval("window.inplaceinput.setValue(\"\", {value: \"JSApi\"})");
+ Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplaceinput.getValue()")));
selenium.getEval("window.inplaceinput.edit()");
Map<String, String> expMap = new HashMap<String, String>();
@@ -518,6 +526,32 @@
check("testInplaceInput".equals(getValueById(iid + "value")), CommonUtils.getSuccessfulTestMessage(iid), CommonUtils.getFailedTestMessage(iid));
}
+ /**
+ * InplaceInput is present on the page and shows model value
+ *
+ * @param template - current temlate
+ */
+ @Test
+ public void testBasicBehaviour(Template template) {
+ setTestUrl(BASIC_BEHAVIOUR_PAGE);
+ init(template);
+
+ AssertValueEquals(inplaceInputId + BASIC_BEHAVIOUR_ID_PREFIX + "value", "test");
+ }
+
+ /**
+ * Component with rendered = false is not present on the page
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testRenderedAttribute(Template template) {
+ setTestUrl(RENDERED_ATTRIBUTE_PAGE);
+ init(template);
+
+ AssertNotRendered(inplaceInputId + RENDERED_ATTRIBUTE_ID_PREFIX);
+ }
+
private void typeAndCheck(String iid, String word, String expectedWord) {
typeWord(iid, word);
checkMessage(iid, expectedWord,
16 years, 10 months
JBoss Rich Faces SVN: r11089 - trunk/sandbox/ui/editor/src/main/antlr.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-11 12:46:12 -0500 (Tue, 11 Nov 2008)
New Revision: 11089
Modified:
trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g
Log:
Modified: trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g
===================================================================
--- trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g 2008-11-11 17:31:40 UTC (rev 11088)
+++ trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g 2008-11-11 17:46:12 UTC (rev 11089)
@@ -82,7 +82,9 @@
protected java.util.Set<String> htmlSeamTextElements = new java.util.HashSet(java.util.Arrays.asList(
"del", "sup", "pre","p", "q" ,"h1" ,"h2" ,"h3" ,"h4" ,"ul" ,"ol" ,"li" ,"i" ,"tt" ,"u" ,"a"));
protected java.util.Set<String> simpleHtmlSeamTextElements = new java.util.HashSet(java.util.Arrays.asList(
- "del", "sup", "pre","p", "q" ,"i" ,"tt" ,"u" ,"a"));
+ "del", "sup", "pre","p", "q" ,"i" ,"tt" ,"u"));
+ protected java.util.Set<String> formattedHtmlSeamTextElements = new java.util.HashSet(java.util.Arrays.asList(
+ "ul", "ol", "li", "h1", "h2", "h3", "h4", "a"));
private Sanitizer sanitizer = new DefaultSanitizer();
@@ -147,6 +149,7 @@
return ("h1".equals(name) || "h2".equals(name) || "h3".equals(name) || "h4".equals(name));
}
+
public String createSeamTextHeader(Token token) throws SemanticException {
String name = token.getText();
@@ -165,7 +168,7 @@
return seamHeader.toString();
}
- public void healingHeaderMarkup(java.util.Stack <Token> htmlElementStack) throws TokenStreamException, SemanticException{
+ public void healingHeaderMarkup(java.util.Stack <Token> htmlElementStack) throws TokenStreamException{
int EOF = 1;
int ALPHANUMERICWORD = 4;
int i = 0;
@@ -188,8 +191,29 @@
if (!containText) {
append("<span></span>");
+ append("\n");
}
}
+
+ public String getSeamParagraphMarkup() throws TokenStreamException{
+ int i = 0;
+ Token token;
+ do {
+ i++;
+ token = LT(i);
+ if (token.getType() == ALPHANUMERICWORD) {
+ if("p".equals(token.getText())) {
+ return SEAMTEXT_PARAGRAPH;
+ } else if(isHeader(token)) {
+ return "\n";
+ }
+
+ break;
+ }
+
+ }while(token.getType() != EOF);
+ return "";
+ }
public boolean isList(Token token){
String name = token.getText();
@@ -233,7 +257,7 @@
}
- public String createSimpleSeamText(Token token) throws SemanticException{
+ public String createSimpleSeamText(Token token) throws SemanticException,TokenStreamException{
String name = token.getText().toLowerCase();
StringBuilder seamText = new StringBuilder();
@@ -251,7 +275,7 @@
} else if("pre".equals(name)) {
seamText.append(SEAMTEXT_BACKTICK);
} else if("p".equals(name)) {
- seamText.append(SEAMTEXT_PARAGRAPH);
+ seamText.append(getSeamParagraphMarkup());
} else if("q".equals(name)) {
seamText.append(SEAM_DOUBLEQUOTE);
} else if("blockquote".equals(name)) {
@@ -262,19 +286,7 @@
}
- public boolean isSeamTextElement(Token element){
- String name = element.getText().toLowerCase();
- return htmlSeamTextElements.contains(name);
- }
-
-
- public boolean isSimpleSeamTextElement(Token element){
- String name = element.getText().toLowerCase();
- return simpleHtmlSeamTextElements.contains(name);
- }
-
-
- public String escapeSeamText(Token token, java.util.Stack <Token> parentHtmlTokens) throws TokenStreamException {
+ public String escapeSeamText(Token token, java.util.Stack <Token> parentHtmlTokens) throws TokenStreamException {
StringBuilder result = new StringBuilder();
String tokenName = token.getText();
@@ -301,18 +313,53 @@
result = result.length() != 0 ? result : result.append("\\").append(tokenName);
return result.toString();
}
+
+
+ public boolean isSeamTextElement(Token element){
+ String name = element.getText().toLowerCase();
+ return htmlSeamTextElements.contains(name);
+ }
-
-
+
+ public boolean isSimpleSeamTextElement(Token element){
+ String name = element.getText().toLowerCase();
+ return simpleHtmlSeamTextElements.contains(name);
+ }
+
+ public boolean isFormattedHtmlSeamTextElement(Token element) {
+ String name = element.getText().toLowerCase();
+ return formattedHtmlSeamTextElements.contains(name);
+ }
+
+ public void validateFormattedHtmlSeamText(Token token) {
+
+ Token token;
+ int next = 0;
+
+ do {
+ next++;
+ token = LT(next);
+
+
+
+ } while (token.getType() != EOF);
+
+ }
+
+ public void validateSimpleHtmlSeamText(Token token) {
+ }
}
-startRule: (newline)* (text eof)?
+startRule: (NEWLINE)* (text eof)?
;
-text: ((seamCharacters|plain|html|htmlSpecialChars) (newline)*)+
+text: ((seamCharacters|plain|html|htmlSpecialChars) (NEWLINE)*)+
;
+plain: (word|punctuation|space:SPACE {append(space.getText());})
+ ;
+
word: an:ALPHANUMERICWORD { append( an.getText() ); } | uc:UNICODEWORD { append( uc.getText() ); }
;
@@ -361,33 +408,25 @@
;
space: s:SPACE {
-
- if(!htmlElementStack.isEmpty()) {
- String tokenName = htmlElementStack.peek().getText();
- if(!("ul".equals(tokenName) || "ol".equals(tokenName))) {
+ if(!htmlElementStack.isEmpty()) {
+ Token token = htmlElementStack.peek();
+ if(!isSeamTextElement(token)) {
append(s.getText());
- }
-
- } else {
- append(s.getText());
- }
+ }
+ }
}
;
-newline: n:NEWLINE { append(n.getText());}
-
-
- ;
-
+newline: n:NEWLINE {append(n.getText());}
+ ;
+
newlineOrEof: newline | EOF
;
html: openTag ( space | space attribute )* ( ( beforeBody body closeTagWithBody ) | closeTagWithNoBody)
;
-plain: (word|punctuation|space)
- ;
body: (
@@ -399,20 +438,20 @@
(
seamCharacters|
-
-
- { if(isLink) {
+
+ {
+ if(isLink) {
beginCapture();
- }
-
+ }
+
}
plain
+
{
if(isLink) {
String plain = endCapture();
linkValueCollector.append(plain);
- }
-
+ }
}
|html
@@ -423,7 +462,8 @@
throw new SemanticException(message);
}
}
- |newline: NEWLINE )*)
+ |NEWLINE
+ )*)
;
openTag:
@@ -431,21 +471,21 @@
{
sanitizer.validateHtmlElement(name);
-
-
+
Token token = null;
- if (isSeamTextElement(name) && !isPlainHMTLRequired(name, htmlElementStack)) {
+ if (isFormattedHtmlSeamTextElement(name) && !isPlainHMTLRequired(name, htmlElementStack)) {
if (isListItem(name)) {
append(createSeamTextList(name, htmlElementStack));
} else if (isHeader(name)) {
append(createSeamTextHeader(name));
}
- } else if(!isSimpleSeamTextElement(name)){
- append("<");
- append(name.getText());
-
+ } else if(isSimpleSeamTextElement(name)){
+ createSimpleSeamText(name)
+ } else {
+ append("<");
+ append(name.getText());
}
htmlElementStack.push(name);
@@ -466,18 +506,10 @@
beforeBody: GT {
Token name = htmlElementStack.pop();
- if(isSeamTextElement(name)){
- if(isSimpleSeamTextElement(name)) {
- append(createSimpleSeamText(name));
- } else if( isPlainHMTLRequired(name,htmlElementStack)) {
- append(">");
-
- }
- } else {
+ if(!isSimpleSeamTextElement && !isPlainHMTLRequired(name,htmlElementStack)) {
append(">");
- }
+ }
htmlElementStack.push(name);
-
}
;
exception
@@ -495,35 +527,39 @@
LT SLASH name:ALPHANUMERICWORD GT
{
htmlElementStack.pop();
-
- if(isSeamTextElement(name)){
-
- if(isLink(name)){
+
+ if(isSimpleSeamTextElement(name)) {
+ append(createSimpleSeamText(name));
+ }
+
+ if(isFormattedSeamTextElement) {
+
+ if(isLink(name)){
append(createSeamTextLink(linkHolder,linkValueCollector.toString().trim()));
- } else {
- append(createSimpleSeamText(name));
}
-
- if(!isPlainHMTLRequired(name, htmlElementStack)) {
+ if(!isPlainHMTLRequired(name, htmlElementStack)) {
+
if(isHeader(name)) {
append("\n");
healingHeaderMarkup(htmlElementStack);
}
-
- } else if(isHeader(name)|| isList(name) || isListItem(name)) {
- append("</");
- append(name.getText());
- append(">");
+
+ if(isListItem(name)){
+ append("\n");
+ }
+
+ } else {
+ append("</");
+ append(name.getText());
+ append(">");
}
-
+
} else {
append("</");
append(name.getText());
append(">");
}
-
-
}
;
16 years, 10 months
JBoss Rich Faces SVN: r11088 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/orderingList and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-11-11 12:31:40 -0500 (Tue, 11 Nov 2008)
New Revision: 11088
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/orderingList/orderingListTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
Log:
RF-4892
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java 2008-11-11 17:18:51 UTC (rev 11087)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java 2008-11-11 17:31:40 UTC (rev 11088)
@@ -40,6 +40,7 @@
private Boolean orderControlsVisible;
private Boolean showButtonLabels;
+ private Boolean rendered;
public OrderingListTestBean() {
init();
@@ -54,6 +55,7 @@
selection = new HashSet<Item>();
orderControlsVisible = true;
showButtonLabels = true;
+ setRendered(true);
}
public Object getActionResult() {
@@ -123,6 +125,15 @@
}
+ public void setRendered(Boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public Boolean getRendered() {
+ return rendered;
+ }
+
+
private class ItemConverter implements Converter {
/* (non-Javadoc)
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/orderingList/orderingListTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-11-11 17:18:51 UTC (rev 11087)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-11-11 17:31:40 UTC (rev 11088)
@@ -70,7 +70,22 @@
private String showButtonLabelsId;
+ private String renderedId;
+
/**
+ * component with rendered = false is not present on the page
+ */
+ @Test
+ public void testRendered(Template template) {
+ renderPage(template, initMethod);
+ initFields();
+ Assert.assertTrue(selenium.isElementPresent(orderingListId));
+ clickAjaxCommandAndWait(renderedId);
+ clickAjaxCommandAndWait(submitId);
+ Assert.assertFalse(selenium.isElementPresent(orderingListId));
+ }
+
+ /**
* component is present on the page with data according to value attribute
*/
@Test
@@ -349,6 +364,7 @@
messagesId = formId + "messages";
orderControlsVisibleId = attrFormId + ":orderControlsVisibleId";
showButtonLabelsId = attrFormId + ":showButtonLabelsId";
+ renderedId = attrFormId + ":renderedId";
}
public String getTestUrl() {
16 years, 10 months
JBoss Rich Faces SVN: r11087 - trunk/test-applications/automator/src/main/webapp/component.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-11 12:18:51 -0500 (Tue, 11 Nov 2008)
New Revision: 11087
Modified:
trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp
Log:
change according to js library
Modified: trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp
===================================================================
--- trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp 2008-11-11 17:07:40 UTC (rev 11086)
+++ trunk/test-applications/automator/src/main/webapp/component/comboBox.jsp 2008-11-11 17:18:51 UTC (rev 11087)
@@ -8,32 +8,6 @@
editable combo box element on a page.</div>
<rich:spacer height="30"></rich:spacer>
- <script type="text/javascript">
- var i = 0;
- function showValue() {
- var myMessage = document.getElementById('mainForm:comboBoxSubview:mess');
- if(myMessage != null) {
- myMessageText = myMessage.textContent;
- document.getElementById('mainForm:comboBoxSubview:hiddenInput').value = myMessageText;
- }
- return true;
- }
-
- function onmouseoverCall() {
- var a = document.getElementById('mainForm:comboBoxSubview:onmouseoverID');
- if(a != null) {
- a.textContent = "WORK!" + i++;
- }
- }
-
- function onclickCall() {
- var a = document.getElementById('mainForm:comboBoxSubview:onclickID');
- if(a != null) {
- a.textContent = "WORK!" + i++;
- }
- }
- </script>
-
<h:panelGrid id="comboBoxGrid" columns="1">
<h:messages id="mess" style="color: red" />
<rich:comboBox id="comboBox" binding="#{comboBoxGeneral.comboBox}"
@@ -41,8 +15,21 @@
validator="#{comboBoxGeneral.validate}"
required="#{comboBoxGeneral.required}"
validatorMessage="#{comboBoxGeneral.validatorMessage}"
- onmouseover="onmouseoverCall()" onclick="onclickCall()"
- styleClass="XXXStyleClass">
+ onblur="callOnblur('comboBox')"
+ onmouseover="callOnmouseover('comboBox')"
+ onclick="callOnclick('comboBox')"
+ onchange="callOnchange('comboBox')"
+ ondblclick="callOndblclick('comboBox')"
+ onfocus="callOnfocus('comboBox')"
+ onkeydown="callOnkeydown('comboBox')"
+ onkeypress="callOnkeypress('comboBox')"
+ onkeyup="callOnkeyup('comboBox')"
+ onlistcall="callOnlistcall('comboBox')"
+ onmousedown="callOnmousedown('comboBox')"
+ onmousemove="callOnmousemove('comboBox')"
+ onmouseout="callOnmouseout('comboBox')"
+ onmouseup="callOnmouseup('comboBox')"
+ onselect="callOnselect('comboBox')" >
<f:selectItems value="#{comboBoxGeneral.selectItems}" />
<f:selectItem itemValue="Gosha" itemLabel="Gosha" />
</rich:comboBox>
@@ -64,17 +51,17 @@
<a4j:commandButton value="testStyles"
actionListener="#{comboBoxStyles.testStyles}"
reRender="stylesResult, comboBoxGrid"></a4j:commandButton>
- <h:panelGroup style="display: block; vertical-align: top">
+ <h:panelGroup>
<h:panelGrid id="generalResult"
binding="#{comboBoxGeneral.panelGrid}" columns="2">
</h:panelGrid>
</h:panelGroup>
- <h:panelGroup style="display: block; vertical-align: top">
+ <h:panelGroup>
<h:panelGrid id="handlersResult"
binding="#{comboBoxHandlers.panelGrid}" columns="2">
</h:panelGrid>
</h:panelGroup>
- <h:panelGroup style="display: block; vertical-align: top">
+ <h:panelGroup>
<h:panelGrid id="stylesResult" binding="#{comboBoxStyles.panelGrid}"
columns="2">
</h:panelGrid>
16 years, 10 months
JBoss Rich Faces SVN: r11086 - trunk/test-applications/automator/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-11 12:07:40 -0500 (Tue, 11 Nov 2008)
New Revision: 11086
Modified:
trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml
Log:
+ ComboBoxStyles bean
Modified: trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml 2008-11-11 16:55:45 UTC (rev 11085)
+++ trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml 2008-11-11 17:07:40 UTC (rev 11086)
@@ -23,6 +23,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>comboBoxStyles</managed-bean-name>
+ <managed-bean-class>comboBox.ComboBoxStyles</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>calendarHandlers</managed-bean-name>
<managed-bean-class>calendar.CalendarHandlers</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
16 years, 10 months
JBoss Rich Faces SVN: r11085 - trunk/test-applications/automator/src/main/webapp/component.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-11 11:55:45 -0500 (Tue, 11 Nov 2008)
New Revision: 11085
Modified:
trunk/test-applications/automator/src/main/webapp/component/calendar.jsp
Log:
Modified: trunk/test-applications/automator/src/main/webapp/component/calendar.jsp
===================================================================
--- trunk/test-applications/automator/src/main/webapp/component/calendar.jsp 2008-11-11 16:51:48 UTC (rev 11084)
+++ trunk/test-applications/automator/src/main/webapp/component/calendar.jsp 2008-11-11 16:55:45 UTC (rev 11085)
@@ -2,9 +2,6 @@
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
-<script type="text/javascript">
-
-</script>
<f:subview id="calendarSubview">
<div>The <rich:calendar> component is used for creating
16 years, 10 months
JBoss Rich Faces SVN: r11084 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-11-11 11:51:48 -0500 (Tue, 11 Nov 2008)
New Revision: 11084
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
Log:
tests for inplaceinput
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml 2008-11-11 16:51:48 UTC (rev 11084)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testJSApi</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tpiv">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceInput id="ii_tja" value="test" showControls="true">
+ </rich:inplaceInput>
+
+ <button id="okButton_tja" onclick="#{rich:component('ii_tja')}.save();return false;">ok</button>
+ <button id="cancelButton_tja" onclick="#{rich:component('ii_tja')}.cancel();return false;">cancel</button>
+
+ </td>
+ <td></td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-11 16:24:44 UTC (rev 11083)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-11 16:51:48 UTC (rev 11084)
@@ -81,6 +81,10 @@
private static final String PROCESSING_INVALID_VALUE_ID_PREFIX = "_tpiv";
+ private static final String JS_API_PAGE = "testJSApi.xhtml";
+
+ private static final String JS_API_ID_PREFIX = "_tja";
+
private String testUrl;
private String formId;
@@ -480,6 +484,40 @@
CommonUtils.getFailedTestMessage(iid));
}
+ /**
+ * Verify JS API of the component
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testJSApi(Template template) {
+ setTestUrl(JS_API_PAGE);
+ init(template);
+
+ String iid = inplaceInputId + JS_API_ID_PREFIX;
+
+ selenium.runScript("var inplaceinput = ($('" + iid + "')).component;");
+ //Assert.assertTrue("test".equals(selenium.getEval("window.inplaceinput.getValue()")));
+
+ //selenium.getEval("window.inplaceinput.setValue('', 'JSApi')");
+ //Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplaceinput.getValue()")));
+
+ selenium.getEval("window.inplaceinput.edit()");
+ Map<String, String> expMap = new HashMap<String, String>();
+ expMap.put("clip", "rect(auto, auto, auto, auto)");
+ assertStyleAttributes(iid + "tempValue", expMap);
+
+ clickById(iid);
+ type(iid + "tempValue", "testInplaceInput");
+ selenium.getEval("window.inplaceinput.save()");
+ check("testInplaceInput".equals(getValueById(iid + "value")), CommonUtils.getSuccessfulTestMessage(iid), CommonUtils.getFailedTestMessage(iid));
+
+ clickById(iid);
+ type(iid + "tempValue", "test");
+ selenium.getEval("window.inplaceinput.cancel()");
+ check("testInplaceInput".equals(getValueById(iid + "value")), CommonUtils.getSuccessfulTestMessage(iid), CommonUtils.getFailedTestMessage(iid));
+ }
+
private void typeAndCheck(String iid, String word, String expectedWord) {
typeWord(iid, word);
checkMessage(iid, expectedWord,
16 years, 10 months
JBoss Rich Faces SVN: r11083 - trunk/test-applications/automator/src/main/java/general.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-11 11:24:44 -0500 (Tue, 11 Nov 2008)
New Revision: 11083
Modified:
trunk/test-applications/automator/src/main/java/general/DrawGrids.java
Log:
Modified: trunk/test-applications/automator/src/main/java/general/DrawGrids.java
===================================================================
--- trunk/test-applications/automator/src/main/java/general/DrawGrids.java 2008-11-11 16:22:22 UTC (rev 11082)
+++ trunk/test-applications/automator/src/main/java/general/DrawGrids.java 2008-11-11 16:24:44 UTC (rev 11083)
@@ -91,4 +91,58 @@
//button.addActionListener(new HandlersAListener());
panelGrid.getChildren().add(button);
}
+
+ /*
+ public static void showEventGrid(HtmlPanelGrid panelGrid, ArrayList<Attribute> events) {
+ panelGrid.getChildren().clear();
+
+ HtmlOutputText attrNameHeader = new HtmlOutputText();
+ attrNameHeader.setValue("Handler");
+ attrNameHeader.setStyle("font-weight: bold; font-size: large");
+
+ HtmlOutputText attrStatusHeader = new HtmlOutputText();
+ attrStatusHeader.setValue("Status");
+ attrStatusHeader.setStyle("font-weight: bold; font-size: large");
+
+ panelGrid.getChildren().add(attrNameHeader);
+ panelGrid.getChildren().add(attrStatusHeader);
+
+ for (Attribute a : events) {
+ HtmlOutputText attrName = new HtmlOutputText();
+ attrName.setValue(a.getName());
+ HtmlOutputText attrStatus = new HtmlOutputText();
+ attrStatus.setValue(a.getStatus());
+ attrStatus.setId(a.getName() + "ID");
+
+ panelGrid.getChildren().add(attrName);
+ panelGrid.getChildren().add(attrStatus);
+ }
+ }
+ */
+
+ public static void showStylesGrid(HtmlPanelGrid panelGrid, ArrayList<Attribute> styles) {
+ panelGrid.getChildren().clear();
+
+ HtmlOutputText attrNameHeader = new HtmlOutputText();
+ attrNameHeader.setValue("Handler");
+ attrNameHeader.setStyle("font-weight: bold; font-size: large");
+
+ HtmlOutputText attrStatusHeader = new HtmlOutputText();
+ attrStatusHeader.setValue("Status");
+ attrStatusHeader.setStyle("font-weight: bold; font-size: large");
+
+ panelGrid.getChildren().add(attrNameHeader);
+ panelGrid.getChildren().add(attrStatusHeader);
+
+ for (Attribute a : styles) {
+ HtmlOutputText attrName = new HtmlOutputText();
+ attrName.setValue(a.getName());
+ HtmlOutputText attrStatus = new HtmlOutputText();
+ attrStatus.setValue(a.getStatus());
+ attrStatus.setId(a.getName() + "ID");
+
+ panelGrid.getChildren().add(attrName);
+ panelGrid.getChildren().add(attrStatus);
+ }
+ }
}
16 years, 10 months
JBoss Rich Faces SVN: r11082 - trunk/test-applications/automator/src/main/java/comboBox.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-11 11:22:22 -0500 (Tue, 11 Nov 2008)
New Revision: 11082
Added:
trunk/test-applications/automator/src/main/java/comboBox/ComboBoxHandlers.java
trunk/test-applications/automator/src/main/java/comboBox/ComboBoxStyles.java
Log:
Added: trunk/test-applications/automator/src/main/java/comboBox/ComboBoxHandlers.java
===================================================================
--- trunk/test-applications/automator/src/main/java/comboBox/ComboBoxHandlers.java (rev 0)
+++ trunk/test-applications/automator/src/main/java/comboBox/ComboBoxHandlers.java 2008-11-11 16:22:22 UTC (rev 11082)
@@ -0,0 +1,37 @@
+package comboBox;
+
+import general.DrawGrids;
+
+import java.util.ArrayList;
+
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.event.ActionEvent;
+
+import parser.Attribute;
+import parser.AttributesList;
+import parser.TLDParser;
+
+public class ComboBoxHandlers {
+
+ private HtmlPanelGrid panelGrid;
+
+ private TLDParser tldParser = new TLDParser("comboBox");
+ private AttributesList attrs = tldParser.getAllAttributes();
+ private ArrayList<Attribute> handlers = attrs.getHandlers();
+
+ public ComboBoxHandlers() {
+
+ }
+
+ public void testHandlers(ActionEvent e) {
+ DrawGrids.showEventGrid(panelGrid, handlers);
+ }
+
+ public HtmlPanelGrid getPanelGrid() {
+ return panelGrid;
+ }
+
+ public void setPanelGrid(HtmlPanelGrid panelGrid) {
+ this.panelGrid = panelGrid;
+ }
+}
Added: trunk/test-applications/automator/src/main/java/comboBox/ComboBoxStyles.java
===================================================================
--- trunk/test-applications/automator/src/main/java/comboBox/ComboBoxStyles.java (rev 0)
+++ trunk/test-applications/automator/src/main/java/comboBox/ComboBoxStyles.java 2008-11-11 16:22:22 UTC (rev 11082)
@@ -0,0 +1,33 @@
+package comboBox;
+
+import general.DrawGrids;
+
+import java.util.ArrayList;
+
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.event.ActionEvent;
+
+import parser.Attribute;
+import parser.AttributesList;
+import parser.TLDParser;
+
+public class ComboBoxStyles {
+
+ private HtmlPanelGrid panelGrid;
+
+ private TLDParser tldParser = new TLDParser("comboBox");
+ private AttributesList attrs = tldParser.getAllAttributes();
+ private ArrayList<Attribute> styles = attrs.getStyles();
+
+ public void testStyles(ActionEvent e) {
+ DrawGrids.showStylesGrid(panelGrid, styles);
+ }
+
+ public HtmlPanelGrid getPanelGrid() {
+ return panelGrid;
+ }
+
+ public void setPanelGrid(HtmlPanelGrid panelGrid) {
+ this.panelGrid = panelGrid;
+ }
+}
16 years, 10 months
JBoss Rich Faces SVN: r11081 - trunk/test-applications/automator/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-11 11:21:33 -0500 (Tue, 11 Nov 2008)
New Revision: 11081
Modified:
trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml
Log:
Modified: trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml 2008-11-11 16:20:47 UTC (rev 11080)
+++ trunk/test-applications/automator/src/main/webapp/WEB-INF/faces-config.xml 2008-11-11 16:21:33 UTC (rev 11081)
@@ -13,6 +13,16 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>comboBoxGeneral</managed-bean-name>
+ <managed-bean-class>comboBox.ComboBoxGeneral</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>comboBoxHandlers</managed-bean-name>
+ <managed-bean-class>comboBox.ComboBoxHandlers</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>calendarHandlers</managed-bean-name>
<managed-bean-class>calendar.CalendarHandlers</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
16 years, 10 months