[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1061) Support EL expressions in remoting calls
by Shane Bryzak (JIRA)
Support EL expressions in remoting calls
----------------------------------------
Key: JBSEAM-1061
URL: http://jira.jboss.com/jira/browse/JBSEAM-1061
Project: JBoss Seam
Issue Type: Feature Request
Components: Remoting
Reporter: Shane Bryzak
Assigned To: Shane Bryzak
Priority: Minor
It would be really cool to tie in EL expressions directly with Seam remoting. For example, take this method call:
Seam.Component.getInstance("helloAction").sayHello(nameValue, sayHelloCallback);
instead, this could be rewritten (and tied into the page context) like this:
Seam.Remoting.pageContext.set("name", nameValue);
Seam.Remoting.evaluate("#{helloAction.sayHello(name)}", sayHelloCallback);
This is not a perfect example, however it demonstrates the potential of this feature. Plus it makes remoting more consistent with the rest of Seam.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-919) Form validation not working for Hibernate validation annotations when using Facelets composition components
by P B (JIRA)
Form validation not working for Hibernate validation annotations when using Facelets composition components
-----------------------------------------------------------------------------------------------------------
Key: JBSEAM-919
URL: http://jira.jboss.com/jira/browse/JBSEAM-919
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.1.6.GA
Reporter: P B
Attachments: facelets-composition-comp-validation.zip
This was first reported in the ICEfaces forums (http://www.icefaces.org/JForum/posts/list/0/3825.page#17329), but seems to occur without ICEfaces.
The Seam JSF Form validation does not happen for Hibernate annotated validations when using a Facelets composition component. When posting a form containing invalid values the validations that should occur for Seam components referenced in a Facelets composition component do not produce any ui error messages and instead cause the following sort of exception at EntityInsertAction.preInsert() stage:
- Exception
Exception during request processing: validation failed for: org.jboss.seam.example.booking.User
org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:132)
org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:156)
org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:139)
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:44)
org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
org.jboss.tm.TxManager.commit(TxManager.java:240)
Steps to reproduce:
1. drop the test case files in the booking example
the test case defines a simple facelets composition component that shows an h:inputText, and uses it for the user name field on the register.xhtml page.
2. build the booking example
3. start the web app and navigate to the registration page
4. enter form values, leaving an invalid entry in the user name field
5. post the page, and an exception should be produced
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1214) Alternate EL property reference #{entity[fieldName]} doesn't work
by Joshua Davis (JIRA)
Alternate EL property reference #{entity[fieldName]} doesn't work
-----------------------------------------------------------------
Key: JBSEAM-1214
URL: http://jira.jboss.com/jira/browse/JBSEAM-1214
Project: JBoss Seam
Issue Type: Bug
Reporter: Joshua Davis
Fix For: 1.2.1.GA
Validation fails for inputText fields where the value expression is of the form: #{entity[fieldName]}
The problem is in Expressions.java, in the validate() method:
{code}
public InvalidValue[] validate(String propertyExpression, Object value)
{
int dot = propertyExpression.lastIndexOf('.');
int bracket = propertyExpression.lastIndexOf('[');
if (dot<=0 && bracket<=0)
{
return new InvalidValue[0];
}
String componentName;
String propertyName;
if (dot>bracket)
{
componentName = propertyExpression.substring(2, dot);
propertyName = propertyExpression.substring( dot+1, propertyExpression.length()-1 );
}
else
{
componentName = propertyExpression.substring(2, bracket);
propertyName = propertyExpression.substring( bracket+1, propertyExpression.length()-2 );
}
String modelExpression = propertyExpression.substring(0, dot) + '}';
Object modelInstance = createValueBinding(modelExpression).getValue(); //TODO: cache the ValueBinding object!
return getValidator(modelInstance, componentName).getPotentialInvalidValues(propertyName, value);
}
{code}
This line is the problem:
String modelExpression = propertyExpression.substring(0, dot) + '}';
if a dot is not found, 'dot' is -1... boom!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 9 months