11-23-2007 06:52 AM
….
<managed-bean>
<description>
The bean that backs up the New User Wizard
</description>
<managed-bean-name>NewUserWizard</managed-bean-name>
<managed-bean-class>my.custom.UserWizard</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
…..
private Boolean myProp = null;
static final QName PROP_MYPROP = QName.createQName(
NamespaceService.CONTENT_MODEL_1_0_URI, "myProp");
super.init();
this.myProp=false;
super.populate();
// set values for edit mode
Map<String, Object> props = getPerson().getProperties();
this.myProp = (Boolean) props.get("myProp");
String outcome = super.finish();
if (outcome == null)
return null;
outcome = FINISH_OUTCOME;
UserTransaction tx = null;
try {
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
// update the existing node in the repository
if(this.editMode){
NodeRef nodeRef = getPerson().getNodeRef();
this.nodeService.setProperty(nodeRef, PROP_MYPROP, this.myProp);
}else{
NodeRef person =this.personService.getPerson(this.getUserName());
this.nodeService.setProperty(person, PROP_MYPROP, this.myProp);
}
// commit the transaction
tx.commit();
// reset the richlist component so it rebinds to the users list
invalidateUserList();
} catch (Throwable e) {
// rollback the transaction
try {
if (tx != null) {
tx.rollback();
}
} catch (Exception tex) {
}
//Treat the error
outcome = null;
}
return outcome;
}
<tr>
<td><h:outputText value="My Prop?" />:</td>
<td><h:selectBooleanCheckbox value="#{NewUserWizard.myProp}"/></td>
</tr>
<property name="cm:myProp">
<type>d:boolean</type>
</property>
12-14-2007 05:47 AM
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.