Skip to content

Instantly share code, notes, and snippets.

View bleathem's full-sized avatar

Brian Leathem bleathem

View GitHub Profile
@EntryPoint
public class PickListApp {
@Inject
private List<String> capitalsList;
@PostConstruct
public void init() {
LogUtil.log("****************** this is a test *************");
List<LIElement> sourceList = new ArrayList<LIElement>(capitalsList.size());
@bleathem
bleathem / gist:3908931
Created October 17, 2012 23:10
Exception running tabs
16:07:00,734 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http--0_0_0_0_0_0_0_0-8080-2) JSF1068: Cannot instantiate component with component-type org.richfaces.TabPanel
16:07:00,736 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Test].[FacesServlet]] (http--0_0_0_0_0_0_0_0-8080-2) Servlet.service() for servlet FacesServlet threw exception: javax.faces.FacesException: Expression Error: Named Object: org.richfaces.TabPanel not found.
at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1910) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1164) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:524) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:168) [jsf-im
@bleathem
bleathem / tab.xhtml
Created September 19, 2012 08:04
tab component with nested a4j:repeat
<h:form id="form">
<rich:tabPanel id="tabPanel">
<rich:tab id="manual_1" title="Manual Tab 1">
Manual Tab 1
</rich:tab>
<a4j:repeat value="#{richBean.names}" var="name" id="repeat" iterationStatusVar="var">
<rich:tab title="#{name}" id="dynamic">
#{name} content
</rich:tab>
</a4j:repeat>
@bleathem
bleathem / AbstractTogglePanel.java
Created September 18, 2012 20:28
AbstractTogglePanel - naive visitor impl
/*
* JBoss, Home of Professional Open Source
* Copyright ${year}, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
@bleathem
bleathem / gist:3508270
Created August 29, 2012 08:00
Graphene Login component
public class LoginComponent implements Component {
@Root
private WebElement driver;
@FindBy(id="loginForm:username")
private WebElement usernameInput;
@FindBy(id="loginForm:password")
private WebElement passwordInput;
@bleathem
bleathem / gist:3503617
Created August 28, 2012 20:13
Graphene component initialisation stacktrace
-------------------------------------------------------------------------------
Test set: org.richfaces.test.graphene.LoginScreenGrapheneComponentTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.939 sec <<< FAILURE!
should_login_successfully(org.richfaces.test.graphene.LoginScreenGrapheneComponentTest) Time elapsed: 0.034 sec <<< ERROR!
java.lang.RuntimeException: The components fields can not be initialised!
at org.jboss.arquillian.graphene.enricher.ComponentObjectsEnricher.setObjectToField(ComponentObjectsEnricher.java:137)
at org.jboss.arquillian.graphene.enricher.ComponentObjectsEnricher.initNotComponentFields(ComponentObjectsEnricher.java:123)
at org.jboss.arquillian.graphene.enricher.ComponentObjectsEnricher.initFieldsAnnotatedByFindBy(ComponentObjectsEnricher.java:85)
at org.jboss.arquillian.graphene.enricher.ComponentObjectsEnricher.enrich(ComponentObjectsEnricher.ja
@bleathem
bleathem / gist:3503105
Created August 28, 2012 19:31
GrapheneTest pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.test.GrapheneTest</groupId>
<artifactId>GrapheneTest</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
(function ($) {
$.widget('rf.orderingList', {
options: {
disabled: false,
color: 'red'
},
_create: function () {
Option 1: no form:
<b:modal>
<f:facet name="header">
...
</f:facet>
some body content here
<f:facet name="footer">
...
</f:facet>
@bleathem
bleathem / gist:2926443
Created June 13, 2012 20:50
Simple CSS media detection
/* portrait screen width */
@media screen and (max-device-width: 480px) {
.portrait {
}
.landscape {
display:none;
}
}