[Fwd: [seam-dev] In list.xhtml.ftl, what is the point of the foreach for the create button if Pages.applyConvertedValidatedValuesToMode cannot deal with nulls in parameters?]
by Francisco Jose Peredo
So? Am I right whe I say that the foreach for the create button in
list.xhtml.ftl button is unnecesary? Maybe it was necessary in the past?
Maybe the reason it was there was to try (unsuccessfully in my opinion)
to prevent parameter propagation?
Maybe this loop should be replaced by includePageParams="false" ?
Regards,
Francisco
-------- Mensaje original --------
Asunto: [seam-dev] In list.xhtml.ftl, what is the point of the foreach
for the create button if Pages.applyConvertedValidatedValuesToMode
cannot deal with nulls in parameters?
Fecha: Mon, 08 Dec 2008 10:52:56 -0600
De: Francisco Jose Peredo <franciscoperedo(a)tabasco.gob.mx>
A: seam-dev(a)lists.jboss.org
Hi!
The code for the create button in list.xhtml.ftl looks like this:
<s:div styleClass="actionButtons" rendered="${'#'}{empty from}">
<s:button view="/${editPageName}.xhtml"
id="create"
propagation="none"
value="Create ${componentName}">
<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in
pojo.identifierProperty.value.propertyIterator>
<#assign cidName = componentName + componentProperty.name?cap_first>
<f:param name="${cidName}"/>
</#foreach>
<#else>
<f:param name="${idName}"/>
</#if>
</s:button>
</s:div>
That generates a <f:param name="${idName}"/> for the primarykey(s). Why
is that done? My best guess is that it is to clear the value
of the primary key for the new object that is going to be created.
But the <f:param name="${idName}"/> actually does nothing, because in
seam it is impossible to set a parameter to null. This f:params are
AFAIK expected to set the method generated in EntityHome.java.ftl:
public void set${idName}(${idType} id)
{
setId(id);
}
But that set is never going to be called for <f:param name="${idName}"/>
because the id value is null! And there is code to prevent
set${idName}(${idType} id) from being called if the value for the id is
going to be null in Pages.applyConvertedValidatedValuesToMode:
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) //<--- HERE IS THE PROBLEM
{
valueExpression.setValue(object);
}*
}
}
}
}
Of course, it gives the impression it works, but that is just because
our EntityHome is recently created and the value for the Id is initially
null. But if we place our EntityHome inside a LRC, and try to use after
a previous creation set the value of the Id, we will see that the Id is
not reset to null by the <f:param name="${idName}"/>
A workaround I use when the id is Integer is this the -1 value:
<f:param name="${idName}" value="-1"/>
public void set${idName}(${idType} id)
{
if(id<0){
setId(null);
}else{
setId(id);
}
}
But that, as it was commented in another null related discussion, a
really ugly way to deal with stuff we want to be "undefined". So what
can be done to fix this in Seam/seam-gen? (And of course offer a
solution that can be used as a "best practice" for dealing with this
even in applications that do not use seam-gen).
I propose removing the if (object!=null) from
applyConvertedValidatedValuesToModel (and maybe other methods in Pages
that avoid dealing with nulls in the same limited way? like perhaps
convertAndValidateStringValuesInPageContext? and
getStringValuesFromModel? and storeRequestStringValuesInPageContext? and
possibly others...).
Now, if ignoring null values for page parameters in this way is not a
bug, but a feature, then I propose removing the foreach for the create
button list.xhtml.ftl, because it just creates the false impression
that <f:param name="${idName}"/> actually does something.
I already created a related JIRA a while ago
(https://jira.jboss.org/jira/browse/JBSEAM-3693) but guess I was not
able to correctly explain this problem, I hope to have better luck this
time.
Regards,
Francisco Peredo
--
Dirección Informática de Servicios Financieros
Dirección General de Modernización e Innovación Gubernamental
Secretaría de Administración y Finanzas
Paseo de la Sierra 435 col. Reforma
C.P. 86086, Villahermosa, Tabasco.
Tel. 52 + 993 + 310 40 00 Ext. 7127
http://saf.tabasco.gob.mx/
IMPORTANTE: Esta transmisión electrónica, incluyendo sus anexos, archivos insertados o "attachments", puede constituir información confidencial o reservada, en los términos de la Ley de Acceso a la Información Pública del Estado de Tabasco, y estar protegida por el derecho fundamental a la privacidad. Se prohibe el uso de esta información por cualquier persona distinta al receptor intencional o previsto. Si usted ha recibibido esta transmisión electrónica por error, por favor responda inmediatamente al emisor y borre esta información de su sistema. El uso, diseminación, distribución o reproducción de esta transmisión electrónica por receptores no intencionados o no previstos por el emisor, no está autorizada y puede considerarse ilícita en los términos de la legislación penal y civil vigente.
--
Dirección Informática de Servicios Financieros
Dirección General de Modernización e Innovación Gubernamental
Secretaría de Administración y Finanzas
Paseo de la Sierra 435 col. Reforma
C.P. 86086, Villahermosa, Tabasco.
Tel. 52 + 993 + 310 40 00 Ext. 7127
http://saf.tabasco.gob.mx/
IMPORTANTE: Esta transmisión electrónica, incluyendo sus anexos, archivos insertados o "attachments", puede constituir información confidencial o reservada, en los términos de la Ley de Acceso a la Información Pública del Estado de Tabasco, y estar protegida por el derecho fundamental a la privacidad. Se prohibe el uso de esta información por cualquier persona distinta al receptor intencional o previsto. Si usted ha recibibido esta transmisión electrónica por error, por favor responda inmediatamente al emisor y borre esta información de su sistema. El uso, diseminación, distribución o reproducción de esta transmisión electrónica por receptores no intencionados o no previstos por el emisor, no está autorizada y puede considerarse ilícita en los términos de la legislación penal y civil vigente.
_______________________________________________
seam-dev mailing list
seam-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/seam-dev
16 years
Seam 2.1.1.CR2 release testing status
by Jay Balunas
Overall the testing for Seam 2.1.1.CR2 has gone well. Jozef and I
have both found some minor issues that can be address in a later
release. Again the selenium tests has speed up some of the testing -
can't wait for more.
The remaining tests (see below) should be completed by mid-morning EST
on Monday of the 8th if not before. We should shoot for release no
later than that afternoon if it works with Norman. Then we should
plan on a Wednesday morning EST tagging for GA if it is feasible in
order to get GA out by Friday.
-Jay
Remaining
-----------
50% of the JBDS testing
- Discussing a hot deploy issue JBIDE-2713 with Max and Rob
- Jozef and I both seem to be having issues with the hibernate
console - looking into further
- EAR project created, entities generated, new form, new action
with out a problem
- except for known issue with application.xml and
<ejb>jboss-seam.jar</ejb>
- WAR project testing still needed
AS 5 GA testing
- Jozef will be executing the selenium tests on AS 5 GA
Waived testing for this release
-----------
JDK6 JBDS testing
Portal Bridge Testing - will be done for GA
Detailed document review of changes
Glassfish testing as this was recently done for interop updates
16 years
Library version diff between CR1 and CR2
by Jozef Hartinger
Hi all,
please review library difference since Seam 2.1.1.CR1
< /lib,commons-logging.jar,1.1,,
> /lib,commons-logging.jar,1.1.1,,
< /lib,richfaces-api.jar,3.2.2.GA,,
< /lib,richfaces-impl.jar,3.2.2.GA,,
< /lib,richfaces-ui.jar,3.2.2.GA,,
> /lib,richfaces-api.jar,3.2.2.SR1,,
> /lib,richfaces-impl.jar,3.2.2.SR1,,
> /lib,richfaces-ui.jar,3.2.2.SR1,,
These three libraries are required for functional tests:
> /src/test/ftest/lib,selenium-java-client-driver.jar,-,No version
found in manifest,
> /src/test/ftest/lib,selenium-server-standalone.jar,-,No version found
in manifest,
> /src/test/ftest/lib,testng-5.8-jdk15.jar,5.8-200803291025,,
16 years
Seam 2.1.1.CR1 release testing status
by Jay Balunas
Jozef and I have been focused on 2.1.1.CR1 release testing, and so far
it has gone smoothly and there have been no blockers found. This is
the first release that we have used the selenium based functional
tests. This made most of the example testing very simple, and has
firmed our belief that we need to get full coverage asap!!
Remaining testing prior to release:
* Windows spot check
* Portal Bridge integration
* Advanced seam-gen testing - need some guidance from Dan
These should be completed by mid-morning EST.
Testing Results:
Testing has been done on a mixture of OS X, and Linux using JDK5 and
JDK6. As covered in the release-process.txt. A couple of small
issues have been found plus the known performance issues scheduled for
Seam 2.1.1.CR2 ( JBSEAM-3712 ). Jira's have not yet been entered for
minor issues as they are being looked into further and should be in
tomorrow morning.
itext example
- has duplicate menu item "swing component"
- has what looks like debug stdout logging
ui example - unable to select country in the main form. It is unclear
when or how this becomes activated. This may not be new, but simply
confusing on how and when this is activated.
seambay - categories do not load when adding new item on jboss
embedded - other configures function correctly.
gwt - On linux with JDK5 the example would not run - no exception but
getting 404. On OS x with JDK6 the example functioned correctly
Seam-gen - there are errors being displayed when the tests are
running in seam-gen generated projects however tests pass.
JBDS-generated ear project has to be workarounded to run correctly -
jboss-seam.jar line has to be removed from MANIFEST file. This is a
known issue with JBoss Tools.
Excel - What is the "Repeat and inline value" supposed to create -
this should be explained better. Also the output is not a very useful
excel table. See attached repeat.xsl.
Progress bar - On OS x with JDK 6 progress bar showed 1% the action
complete. Tried with both Safari, and Firefox
16 years
Seam 2.1.1.CR2 testing status
by Jozef Hartinger
I have just finished initial testing steps. I 've found these two issues:
JBSEAM-3803 - just a typo in configuration file that causes validation
to fail
JBSEAM-3802 - recent pages.xml schema changes are in conflict with
seamspace example
16 years
Seam 2.1.1.CR2
by Pete Muir
All,
We are aiming for a code freeze for 2.1.1.CR2 for midday Thursday
(EST), and then move quickly to the GA.
If you've got anything you want in for 2.1.1.GA, make sure it is in by
the 2.1.1.CR2 code freeze :-)
Best,
Pete
16 years
Seam 2.1.1.CR2 code freeze and release
by Pete Muir
Norman, all the issues are done for 2.1.1.CR2 so can you start the
release process :-)
All, please don't make any commits to trunk until Norman gives the all
clear.
Thanks,
Pete
16 years
automatic loading of persistence units in JBoss AS 5
by Dan Allen
One of the changes in JBoss AS 5 that comes as a surprise for many
Seam developers/users familiar with the behavior of JBoss AS 4 is the
automatic loading of persistence units from /META-INF/persistence.xml.
(As expected, we had to change several of the Seam examples to
accommodate this change). This is one of those configuration by
exception features in Java EE 5, with one significant exception. While
the container will locate the /META-INF/persistence.xml file on its
own, a container that goes by the book will only deploy the
persistence unit if a resource reference is declared in the descriptor
file (web.xml or ejb-jar.xml). JBoss AS does not wait for this signal.
In my opinion, there is a problem with the JBoss AS approach. What if
you have persistence units that you don't want to deploy? One use case
is that you have persistence units for different environments and a
configuration file can toggle between them. Another use case is that
you have another library, such as Spring or Seam, which bootstraps the
persistence unit instead. Sure, you could rename the file, but then
you break all the IDE behavior that expects the file to be named
persistence.xml. Personally, I think there should be some way to
disable the behavior in JBoss AS and make it look for the persistence
unit references. I agree to keep the automatic loading as the default,
but it is pretty inconvenient not to be able to disable it.
Anyone else agree? Disagree? Why?
-Dan
--
Dan Allen
Software consultant | Author of Seam in Action
http://mojavelinux.com
http://mojavelinux.com/seaminaction
NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.
16 years