[JBoss Seam] - convertEnum - ClassCastException
by w17chm4n
Can anybody tell me why I`m getting this:
| java.lang.ClassCastException: com.blstream.inquisitor.ejb3.entities.Question
I`m trying to make checkManyCheckbox working
View
| <h:form>
| <h:selectManyCheckbox>
| <ui:repeat var="cat" value="#{questionCategoryList}">
| <fieldset>
| <legend><h:outputText value="Category: #{cat.categoryName}" /></legend>
| <h:selectManyCheckbox value="${pollQuestionsList}">
| <s:selectItems var="question" value="#{cat.questionList}" label="#{question.question}"/>
| <s:convertEnum />
| </h:selectManyCheckbox>
| </fieldset>
| </ui:repeat>
| </h:selectManyCheckbox>
| <h:commandButton type="submit" value="Submit" action="#{PollController.addPoll}"/>
| </h:form>
|
PollController
| @Stateful
| @Scope(ScopeType.SESSION)
| @Name("PollController")
| public class PollControllerBean implements PollController {
|
| @Logger
| Log log;
|
| @In(create = true)
| private Poll poll;
|
| @In(required = false)
| private List<Question> pollQuestionsList;
|
| public PollControllerBean() {
| }
|
| public void addPoll() {
| log.info(pollQuestionsList.toString());
| }
|
| public void removePoll() {
| }
|
| @Remove @Destroy
| public void destroy() {}
| }
|
Question entity
| @Entity
| @Scope(ScopeType.CONVERSATION)
| @Name("question")
| @Table(name="Questions")
| public class Question implements Serializable {
|
| @Id @GeneratedValue
| private Long id;
|
| @NotNull @Length(min=5, max=100)
| private String question;
|
| @NotNull @OneToOne
| private QuestionType questionType;
|
| @ManyToOne
| private QuestionCategory category;
|
| @OneToOne
| private Picture picture;
|
| @NotNull
| private int questionValue;
|
| @NotNull @Temporal(value = TemporalType.TIMESTAMP)
| private Date created;
|
| @OneToMany
| private List<Answer> answers;
|
| @ManyToMany
| private List<Poll> pools;
|
| @ManyToMany
| private List<Test> tests;
|
| @Override
| public boolean equals(Object obj) {
| if (!(obj instanceof QuestionCategory) || this.id == null) {
| return false;
| }
|
| return this.id.equals(((QuestionCategory)obj).getId());
| }
|
| public Question() {
| }
|
| public Question(String question, QuestionCategory category) {
| this.question = question;
| this.category = category;
| this.questionValue = 0;
| }
|
| public Question(String question, QuestionCategory category, int questionValue) {
| this.question = question;
| this.category = category;
| this.questionValue = questionValue;
| }
|
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
| public String getQuestion() {
| return question;
| }
|
| public void setQuestion(String question) {
| this.question = question;
| }
|
| public QuestionCategory getCategory() {
| return category;
| }
|
| public void setCategory(QuestionCategory category) {
| this.category = category;
| }
|
| public int getQuestionValue() {
| return questionValue;
| }
|
| public void setQuestionValue(int questionValue) {
| this.questionValue = questionValue;
| }
|
| public List<Poll> getPools() {
| return pools;
| }
|
| public void setPools(List<Poll> pools) {
| this.pools = pools;
| }
|
| public List<Test> getTests() {
| return tests;
| }
|
| public void setTests(List<Test> tests) {
| this.tests = tests;
| }
|
| public Date getCreated() {
| return created;
| }
|
| public void setCreated(Date created) {
| this.created = created;
| }
|
| public Picture getPicture() {
| return picture;
| }
|
| public void setPicture(Picture picture) {
| this.picture = picture;
| }
|
| public QuestionType getQuestionType() {
| return questionType;
| }
|
| public void setQuestionType(QuestionType questionType) {
| this.questionType = questionType;
| }
|
| public List<Answer> getAnswers() {
| return answers;
| }
|
| public void setAnswers(List<Answer> answers) {
| this.answers = answers;
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104934#4104934
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104934
18 years, 8 months
[JBoss Seam] - How to manage page via new popup window?
by Stateless Bean
Here is my structure in page folder
/Universum <- project
/Universum/tutorial <- tutorial
On main page I got index.html
and link to open new popuped window
| <a href="#" id="rollover5" onclick="window.open('/Universum/tutorial/tutorial.seam', 'aaa', 'menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,fullscreen=no,channelmode=no,width=800,height=600').focus(); return false" title="StarGate Universum #{messages['mainPage.title.faq']}" />
|
to open new popup and file
/Universum/tutorial/tutorial.seam
and here I get problem. How to declare link to my page in new window, but from new window?!
/Universum/tutorial/tutorial.xhtml - template
/Universum/tutorial/page.xhtml = page
/Universum/tutorial/page.seam is visible from main page, but not from popup
/Universum/tutorial/page.xhtml is visible from main page, but popup is not opened but browser want to download this file.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104933#4104933
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104933
18 years, 8 months