Hi there,
I have a page with a Gallery.page.xml looking like this:
<?xml version="1.0" encoding="UTF-8"?>
| <page xmlns="http://jboss.com/products/seam/pages"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://jboss.com/products/seam/pageshttp://jboss.com/products/seam/pages-2.0.xsd"
| login-required="true">
|
| <param name="tankId" value="#{tankHome.tankId}" required="true"/>
|
| </page>
|
This works great when you link to the page with things like <s:link view="/Gallery.xhtml" value="Gallery"/>. Basically tankId is populated when you use GET parameters.
Within the Gallery.xhtml page I have a form that allows for picture uploading. When I hit the upload button I get
javax.faces.validator.ValidatorException: value is requiredIf I remove the required="true" attribute from the param it works like a charm. Only thing is I have no way of enforcing that a valid id is being provided. I thought that this stuff gets automatically populated if I stay withinn the same page and the page parameter is set? It work for links but not for JSF form submissions.
I also tried this
<?xml version="1.0" encoding="UTF-8"?>
| <page xmlns="http://jboss.com/products/seam/pages"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://jboss.com/products/seam/pageshttp://jboss.com/products/seam/pages-2.0.xsd"
| login-required="true">
|
| <param name="tankId" value="#{tankHome.tankId}" />
| <restrict>#{tankHome.tankId != null}</restrict>
|
| </page>
but with this I get org.jboss.seam.security.AuthorizationException: Authorization check failed for expression [#{tankHome.tankId != null}]
when I submit the upload form. Again the entire upload thing works fine as long as I don't try to validate/restrict the tankId/tankHome in page.xml.
I wonder if I got some concepts of auto parameter propagation wrong or if this is a bug?
Thanks, Thorsten
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117663#4117663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117663
please report such things with info on how big the projects are and if there some specific files that seem to take extra long!
with respect to validation enable/disable then look in the preferences for Seam Validator - here you can enable/disable specific kinds of validation but if you want it fully disable them just look under Validation where you can enable/disable the Seam validator totally if needed.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117655#4117655
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117655
Problem solved. The error handling in this case could not be accomplished by catching EntityExistsException, since PersistenceExceptions except for NoResultException and NonUniqueException mark the transaction for rollback, causing it to be unavailable for the next iteration of addRootItem(). The existence check had to come first and, if it doesn't exist, Query.getSingleResult() throws NoResultException, which can then be handled properly because it does not cause a transaction rollback.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117653#4117653
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117653