Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

PrimeFaces support

Change-Id: Ib8747d83a5a0d66029fad6d489872640052a3238
  • Loading branch information...
commit 9fba2f924e4255bfc63a1a5b01483f59b8f2d6f2 1 parent ff8d5dc
@kennardconsulting kennardconsulting authored
View
14 ...n/java/org/metawidget/integrationtest/faces/quirks/model/primefaces/PrimeFacesQuirks.java
@@ -18,7 +18,6 @@
import static org.metawidget.inspector.InspectionResultConstants.*;
-import java.awt.Color;
import java.util.Date;
import javax.faces.bean.ManagedBean;
@@ -51,8 +50,6 @@
private Date mDate;
- private Color mColor;
-
//
// Public methods
//
@@ -93,17 +90,6 @@ public void setSlider( int slider ) {
@UiSection( "Section #2" )
@UiComesAfter( "slider" )
- public Color getColor() {
-
- return mColor;
- }
-
- public void setColor( Color color ) {
-
- mColor = color;
- }
-
- @UiComesAfter( "color" )
public void setDate( Date date ) {
mDate = date;
View
26 integration-tests/faces/quirks/primefaces/src/test/webtest/webtest.xml
@@ -28,19 +28,15 @@
<not>
<verifyXPath xpath="contains(/html/body/form/table/tbody/tr/td/div/ul/li[2]/@class, 'ui-state-active')"/>
</not>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/th/label" text="Color:"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/button/@id" text="form:j_id10:primeFacesQuirksColor_button"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/input/@id" text="form:j_id10:primeFacesQuirksColor_input"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/th/label" text="Date:"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/td[1]/span/@id" text="form:j_id10:primeFacesQuirksDate"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/td[1]/span/input/@name" text="form:j_id10:primeFacesQuirksDate_input"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/td[1]/span/input/@type" text="text"/>
- <verifyXPath xpath="contains( /html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/td[1]/span/input/@class, 'hasDatepicker')"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/th/label" text="Date:"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/@id" text="form:j_id10:primeFacesQuirksDate"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/input/@name" text="form:j_id10:primeFacesQuirksDate_input"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/input/@type" text="text"/>
+ <verifyXPath xpath="contains( /html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/input/@class, 'hasDatepicker')"/>
<setInputField name="form:j_id10:primeFacesQuirksName" value="Foo"/>
<setInputField name="form:j_id10:primeFacesQuirksSpinner_input" value="1"/>
<setInputField xpath="/html/body/form/table/tbody/tr/td/div/div/div/table/tbody/tr[3]/td[1]/input" value="2"/>
- <!-- TODO: <forceHiddenInputField name="form:j_id10:primeFacesQuirksColor_input" value="255,0,0"/> -->
<setInputField name="form:j_id10:primeFacesQuirksDate_input" value="09/04/1975"/>
<clickButton label="Save"/>
@@ -58,10 +54,8 @@
<not>
<verifyXPath xpath="contains(/html/body/form/table/tbody/tr/td/div/ul/li[2]/@class, 'ui-state-active')"/>
</not>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/th/label" text="Color:"/>
- <!-- TODO: <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]" text="java.awt.Color[r=255,g=0,b=0]"/>-->
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/th/label" text="Date:"/>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/td[1]" text="(09/04|04/09)/1975" regex="true"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/th/label" text="Date:"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]" text="(09/04|04/09|9/04)/1975" regex="true"/>
<clickButton label="Edit"/>
@@ -82,10 +76,8 @@
<not>
<verifyXPath xpath="contains(/html/body/form/table/tbody/tr/td/div/ul/li[2]/@class, 'ui-state-active')"/>
</not>
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/th/label" text="Color:"/>
- <!-- TODO: <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/input/@value" text="255,0,0"/>-->
- <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/th/label" text="Date:"/>
- <verifyXPath xpath="contains(/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[2]/td[1]/span/input/@value, '/1975')"/>
+ <verifyXPath xpath="/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/th/label" text="Date:"/>
+ <verifyXPath xpath="contains(/html/body/form/table/tbody/tr/td/div/div/div[2]/table/tbody/tr[1]/td[1]/span/input/@value, '/1975')"/>
</steps>
</webtest>
View
15 ...org/metawidget/faces/component/html/widgetbuilder/primefaces/PrimeFacesWidgetBuilder.java
@@ -19,7 +19,6 @@
import static org.metawidget.inspector.InspectionResultConstants.*;
import static org.metawidget.inspector.faces.FacesInspectionResultConstants.*;
-import java.awt.Color;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@@ -29,7 +28,6 @@
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlInputText;
-import javax.faces.component.html.HtmlOutputText;
import javax.faces.context.FacesContext;
import org.metawidget.faces.FacesUtils;
@@ -38,7 +36,6 @@
import org.metawidget.faces.component.html.widgetbuilder.HtmlWidgetBuilder;
import org.metawidget.util.WidgetBuilderUtils;
import org.primefaces.component.calendar.Calendar;
-import org.primefaces.component.colorpicker.ColorPicker;
import org.primefaces.component.commandbutton.CommandButton;
import org.primefaces.component.selectmanycheckbox.SelectManyCheckbox;
import org.primefaces.component.selectonemenu.SelectOneMenu;
@@ -260,15 +257,9 @@ public UIComponent buildWidget( String elementName, Map<String, String> attribut
}
}
- // Colors
-
- if ( Color.class.equals( clazz ) ) {
- if ( readOnly ) {
- return FacesContext.getCurrentInstance().getApplication().createComponent( HtmlOutputText.COMPONENT_TYPE );
- }
-
- return FacesUtils.createComponent( ColorPicker.COMPONENT_TYPE, "org.primefaces.component.ColorPickerRenderer" );
- }
+ // Colors. Note org.primefaces.component.ColorPickerRenderer does *not* support
+ // java.awt.Color (http://forum.primefaces.org/viewtopic.php?t=21593) so it isn't much good
+ // to us here
// Not for PrimeFaces
View
2  pom.xml
@@ -322,7 +322,7 @@
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
- <version>3.0.RC2</version>
+ <version>3.2</version>
</dependency>
<dependency>
<groupId>org.swinglabs</groupId>
Please sign in to comment.
Something went wrong with that request. Please try again.