[
https://jira.jboss.org/jira/browse/JBSEAM-3454?page=com.atlassian.jira.pl...
]
Francisco Jose Peredo Noguez commented on JBSEAM-3454:
------------------------------------------------------
I think basically the root problem here is that A <f:param name="categoryId"
value=""/> inside a s:link is innefective, but, with temporary conversation
it appears to be effective because it does nothing and the refereced property in the class
stays null, but if a long running conversation starts the <f:param
name="categoryId" value=""/> becomes a debugging nighmare, because
the categoryId is being preserved by the LRC, and the <f:param
name="categoryId" value=""/> that should clear it does nothing,
because org.jboss.seam.navigation.Pages.applyConvertedValidatedValuesToModel is coded to
do nothing if the value fo the f:param is null (and it should set null if the value is
null):
private void applyConvertedValidatedValuesToModel(FacesContext facesContext)
{
String viewId = getViewId(facesContext);
for ( Page page: getPageStack(viewId) )
{
for ( Param pageParameter: page.getParameters() )
{
ValueExpression valueExpression = pageParameter.getValueExpression();
if (valueExpression!=null)
{
Object object = Contexts.getEventContext().get( pageParameter.getName() );
if (object!=null)
{
valueExpression.setValue(object);
}
}
}
}
}
Please remove the if (object!=null).
Recursive Entity causes strange behavior with EntityHome Id when
trying to add child Entities inside a conversation
-------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3454
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3454
Project: Seam
Issue Type: Bug
Components: Framework, Tools
Affects Versions: 2.0.2.SP1
Environment: Jdk 1.6u6, JBoss AS 4.2.2.GA
Reporter: Francisco Jose Peredo Noguez
Priority: Minor
Attachments: SeamRecursionTestCase.zip
Create a Seam 2 project using JBossTools, create an @Entity with a recursive relationship
(lets name it Category), run Seam Generate Entities, run the application.
Create a category using the generated UI.
Save it with name "category 1"
Edit it.
If in Category.xhtml you click "Add category" instead of presenting a clean
form for adding the new children, it will present a form with currently selected category:
"category 1"). This is a bug, but it is not the one I am reporting here.
So, you decide you want to fix it, and for starters you change the code in the Add
category button to this:
<s:button
value="Add category"
view="/CategoryEdit.xhtml">
<f:param name="categoryId" value=""/>
<f:param name="categoryFrom" value="Category"/>
</s:button>
note that the value for the categoryId is now empty (it used to have the
#{categoryHome.instance.id} value). After making that change you run the application again
and:
Edit "category1"
in Category.xhtml you click "Add category" and you get what you would expect,
an empty form to add the child category (of course many more changes are needed to make it
possible to really add a child category, but that is not the issue here)
In layout/menu.xhtml you have a link to the CategoryList that looks like this:
<s:link view="/CategoryList.xhtml"
value="Category List"
propagation="none"/>
well, lets say you decide to add another one (just for the sake of experimenting) that
looks like this:
<s:link view="/CategoryList.xhtml"
value="Category List Propagation Begin"
propagation="begin"/>
And then you Edit "category1"
in Category.xhtml you click "Add category" and.... here comes the bug... the
form is not empty, the <f:param name="categoryId" value=""/>
plain just gets ignored.
Why? I think it that the fact that now everything is running a long running conversation
shouldn't screw up this... that is the bug I am reporting here.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira