09-13-2007 04:09 AM
09-13-2007 04:54 AM
09-13-2007 05:06 AM
09-13-2007 07:40 AM
public class MyComponentGenerator extends BaseComponentGenerator {
public UIComponent generate(FacesContext context, String id) {
// TODO Auto-generated method stub
UIComponent component = context.getApplication().
createComponent(UISelectOne.COMPONENT_TYPE);
FacesHelper.setupComponentId(context, component, id);
// create the list of choices
UISelectItems itemsComponent = (UISelectItems)context.getApplication().
createComponent("javax.faces.SelectItems");
itemsComponent.setValue(getMyItems());
// add the items as a child component
component.getChildren().add(itemsComponent);
return component;
}
protected SelectItem[] getMyItems()
{
int kval;
SelectItem[] items=new SelectItem[10];
for(kval=0;kval<10;kval++){
items[kval] = new SelectItem("string"+kval,"Choix" + kval);
}
return items;
}
}
Et donc je n'ai plus maintenant qu'à aller chercher la valeur de mes items dans ma base de données.09-18-2007 03:17 AM
09-18-2007 08:38 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<!– *************************************************************** –>
<!– Empty JSF config file to prevent errors being thrown during JSF –>
<!– initialisation. Overwrite this file with your custom version. –>
<!– *************************************************************** –>
<managed-bean>
<description>
Bean Test
</description>
<managed-bean-name>MyComponentGenerator</managed-bean-name>
<managed-bean-class>MyComponentGenerator</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
et <config evaluator="string-compare" condition="Action Wizards">
<subtypes>
<type name="custom:Player" />
</subtypes>
</config>
<config evaluator="string-compare" condition="Content Wizards">
<content-types>
<type name="custom:Player" />
</content-types>
</config>
<config evaluator="node-type" condition="custom:Player">
<property-sheet>
<show-property name="custom:PlayerName" />
</property-sheet>
</config>
<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
<subtypes>
<type name="custom:Team"/>
</subtypes>
</config>
<config evaluator="string-compare" condition="Content Wizards">
<content-types>
<type name="custom:Team" />
</content-types>
</config>
<config evaluator="node-type" condition="custom:Team">
<property-sheet>
<show-property name="custom:TeamName" />
<show-property name="custom:Players" component-generator="MyComponen
tGenerator"/>
</property-sheet>
</config>
Voilà.
08-14-2008 12:53 PM
08-14-2008 03:52 PM
08-14-2008 04:37 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.