[jboss-user] [JBoss Seam] - Re: DataModel and DataModelSelection question
w17chm4n
do-not-reply at jboss.com
Thu Oct 11 11:59:36 EDT 2007
I`ve changed to stateful EJB but still it doesn`t inject the questionCategory.
| @Stateful
| @Name("QuestionCategoryController")
| public class QuestionCategoryControllerBean implements QuestionCategoryController {
|
| @Logger
| private Log log;
|
| @In(create = true)
| private QuestionCategoryManager questionCategoryManager;
|
| @DataModelSelection
| @In(required = false)
| @Out(required = false)
| private QuestionCategory questionCategory;
|
| @DataModel
| private List<QuestionCategory> categoryList;
|
| @Out(required = false)
| private List<Question> questionList;
|
| public void addCategory() {
| questionCategory.setCreated(new Date());
| questionCategoryManager.addCategory(this.questionCategory);
| }
|
| public void removeCategory(QuestionCategory questionCategory) { //todo
| log.info("Trying to remove #{questionCategory.categoryName}");
| if(questionCategory == null) {
| log.fatal("questionCategory is NULL !");
| } else {
| questionCategoryManager.removeCategory(questionCategory);
| }
| }
|
| @Factory("categoryList")
| public void getAllQuestionsCategories() {
| setCategoryList(questionCategoryManager.getAllQuestionCategories());
| }
|
| public List<QuestionCategory> getCategoryList() {
| return categoryList;
| }
|
| public void setCategoryList(List<QuestionCategory> categoryList) {
| this.categoryList = categoryList;
| }
|
| public List<Question> getQuestionList() {
| return questionList;
| }
|
| public void setQuestionList(List<Question> questionList) {
| this.questionList = questionList;
| }
|
| @Destroy @Remove
| public void destroy() {}
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094178#4094178
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094178
More information about the jboss-user
mailing list