[JBoss Seam] - Problems with navigations with null outcomes
by fernando_jmt
Hi.
I am just changing all navigation rules from faces-config.xml to pages.xml.
Then when my action returns a null outcome it does not redisplay the current page.
I have this method in my component:
| @Stateful
| @Name("userManager")
| public class UserManagerAction {
| ...
| public String create() {
| em.persist(user);
| em.flush();
| return "userList";
| } catch (EntityExistsException e) {
| return Outcome.REDISPLAY;
| }
| }
| }
|
And according the documentation (1.1.6) I tried two configuration in my pages.xml:
a) (This is not in the docs, but I saw it in this forum)
|
| <page view-id="/user/new.xhtml" no-conversation-view-id="/user/list.xhtml">
| <navigation from-action="#{userManager.create}">
| <redirect view-id="/user/list.xhtml"/>
| </navigation>
| </page>
|
|
b) (according the book)
| <page view-id="/user/new.xhtml" no-conversation-view-id="/user/list.xhtml">
| <navigation from-action="#{userManager.create}">
| <rule>
| <redirect view-id="/user/list.xhtml"/>
| </rule>
| </navigation>
| </page>
|
In the both cases (a, b) after userManager.create() returns null or Outcome.REDISPLAY the current page is not redisplayed, I always get the list.xhtml page.
Anyone knows why?
Could this be a bug? or is it my fault?
Please help me.
BTW, it could be good idea to add to Outcome class something like:
Outcome.SUCCESS. This because in these cases (using navigations with String returning methods and pages.xml navigations) the outcome sometimes does not matter. I know we can use void methods, but adding error messages and checking those in the navigation rule involves more configuration steps, I think unnecessary for these cases. What do you think?
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018291#4018291
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018291
19Â years, 2Â months
[JBoss Seam] - Re: Seam Gen template error?
by cparham
"saeediqbal1" wrote : Hey Guys while you are at the bug. Can you please report this if its not done already. when running seam generate-entities , i get the following error which refers to the file list.xhtml.ftl line 30 which is
|
| | <#if property.value.typeName == "string">
|
|
| [hibernate] INFO: Hibernate Tools 3.2.0.snapshotb9
| | Feb 17, 2007 11:27:43 AM org.hibernate.connection.DriverManagerConnectionProvider close
| | INFO: cleaning up connection pool: jdbc:mysql:///test
| | [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
| | [hibernate] Feb 17, 2007 11:27:44 AM freemarker.log.JDK14LoggerFactory$JDK14Logger error
| | [hibernate] SEVERE:
| |
| | [hibernate] Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl.
| | [hibernate] The problematic instruction:
| | [hibernate] ----------
| | [hibernate] ==> if property.value.typeName == "string" [on line 30, column 1 in view/list.xhtml.ftl]
| | [hibernate] ----------
| |
| | [hibernate] Java backtrace for programmers:
| | [hibernate] ----------
| | [hibernate] freemarker.core.InvalidReferenceException: Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl.
| | ...
| |
|
| Thanks. Any idea what could be the work-around to this? or maybe i should deploy the project before generating entities ?
|
You're not alone. I'm seeing the same error too when running against Oracle or MySQL
Ideas anyone?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018284#4018284
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018284
19Â years, 2Â months
[JBoss Seam] - Re: Null Value in s:link w/IceFaces
by gzoller
Ok, I'm making progress solving the problem.
It turns out that you definitely do need to annotate the list in the backing bean used to populate the <ice:dataTable> with @DataModel. If you don't, even though IceFaces rendering components will see your line-item variable correctly populated, the Seam <s:link> tag won't feed the value back into Seam.
Now my next complication...
Can you successfully nest <ice:dataTable>'s w/Seam?
Here's what I have so far:
Rendering xhtml:
| <ice:dataTable id="departments" width="100%" cellspacing="1"
| value="#{outer}" var="item"
| rowClasses="rowClass1,rowClass2">
| <ice:column>
| <s:link id="viewItem" value="#{item.name}" action="#{mgrBean.selectItem(item)}"/>
|
| <ice:dataTable width="100%" cellspacing="1"
| value="#{inner}" var="bucket"
| rowClasses="rowClass1,rowClass2">
| <ice:column>
| <s:link id="viewBucket" value="#{bucket.name}" action="#{mgrBean.selectBucket(bucket)}"/>
| </ice:column>
| </ice:dataTable>
| </ice:column>
| </ice:dataTable>
|
ManagerBean.java
| @Name("mgrBean")
| public class ManagerBean {
| ...
| @DataModel
| private List<Foo> list;
| ...
| @Create
| public void init() {
| // populate list
| }
|
| public String selectItem(Foo foo) {...}
| public String selectBucket(Bar bar) {...}
| }
|
Foo.java
| @Name("foo")
| public class Foo {
| @DataModel
| private List<Bar> buckets;
| ...
| }
|
So it might render something like this:
| ONE
| A
| B
| TWO
| C
| THREE
| D
| E
|
Here's what happens: The outer table is rendered and clicking on the s:link elements for ONE, TWO, or THREE correctly passes the corresponding (non-null) objects to the backing bean (calling selectItem()).
But clicking on A-E is still passing null to selectBucket() on the backing bean (ManagerBean).
Has anyone nested these before? How about nesting non-IceFaces dataTables?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018276#4018276
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018276
19Â years, 2Â months
[JBoss Seam] - Re: Seam Gen template error?
by saeediqbal1
Hey Guys while you are at the bug. Can you please report this if its not done already. when running seam generate-entities , i get the following error which refers to the file list.xhtml.ftl line 30 which is
| <#if property.value.typeName == "string">
[hibernate] INFO: Hibernate Tools 3.2.0.snapshotb9
| Feb 17, 2007 11:27:43 AM org.hibernate.connection.DriverManagerConnectionProvider close
| INFO: cleaning up connection pool: jdbc:mysql:///test
| [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
| [hibernate] Feb 17, 2007 11:27:44 AM freemarker.log.JDK14LoggerFactory$JDK14Logger error
| [hibernate] SEVERE:
|
| [hibernate] Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl.
| [hibernate] The problematic instruction:
| [hibernate] ----------
| [hibernate] ==> if property.value.typeName == "string" [on line 30, column 1 in view/list.xhtml.ftl]
| [hibernate] ----------
|
| [hibernate] Java backtrace for programmers:
| [hibernate] ----------
| [hibernate] freemarker.core.InvalidReferenceException: Expression property.value.typeName is undefined on line 30, column 6 in view/list.xhtml.ftl.
| [hibernate] at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
| [hibernate] at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:121)
| [hibernate] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
| [hibernate] at freemarker.core.Environment.visit(Environment.java:196)
| [hibernate] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
| [hibernate] at freemarker.core.Environment.visit(Environment.java:196)
| [hibernate] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
| [hibernate] at freemarker.core.Environment.visit(Environment.java:351)
| [hibernate] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
| [hibernate] at freemarker.core.Environment.visit(Environment.java:196)
| [hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
| [hibernate] at freemarker.core.Environment.visit(Environment.java:196)
| [hibernate] at freemarker.core.Environment.process(Environment.java:176)
| [hibernate] at freemarker.template.Template.process(Template.java:231)
| [hibernate] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
| [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
| [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
| [hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
| [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:84)
| [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:73)
| [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:56)
| [hibernate] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:41)
| [hibernate] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
| [hibernate] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
| [hibernate] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:182)
| [hibernate] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
| [hibernate] at org.apache.tools.ant.Task.perform(Task.java:364)
| [hibernate] at org.apache.tools.ant.Target.execute(Target.java:341)
| [hibernate] at org.apache.tools.ant.Target.performTasks(Target.java:369)
| [hibernate] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
| [hibernate] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
| [hibernate] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
| [hibernate] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
| [hibernate] at org.apache.tools.ant.Main.runBuild(Main.java:668)
| [hibernate] at org.apache.tools.ant.Main.startAnt(Main.java:187)
| [hibernate] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
| [hibernate] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Thanks. Any idea what could be the work-around to this? or maybe i should deploy the project before generating entities ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018266#4018266
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018266
19Â years, 2Â months