2012-01-19 61 views
1

从UIComponent对象Facelets的代码,我想要生成小面从UIComponent代码, 如:是否有可能产生JSFManagedBean

org.primefaces.component.commandbutton.CommandButton; 

CommandButton btn=new CommandButton(); 
btn.setValue("Click"); 

此代码,下面的标记必须生成

<p:commandButton value="Click" /> 

我需要的是在bean中生成与UIComponent对象相对应的facelet代码,代码必须存储并在以后使用。

是否有可能?

回答

1

使用绑定

<p:commandButton value="Click" binding="#{beanName.btn}" /> 
+0

我需要的是产生对应于UIComponent对象在bean的facelet代码和代码必须是存储并在以后使用。 –

相关问题