[JBoss Seam] - <ui:define> and injection
by schlafsack
I've come up against a problem with using facelets templates and seam injection.
I have the following two classes:
| @Name("query")
| @Scope(value = ScopeType.PAGE)
| public class Query
| {
| ...
| }
|
| @Name("search")
| @Scope(ScopeType.EVENT)
| public class Search
| {
| @In Query query;
| ...
| }
|
I have a search widget (query.xhtml) that binds to the Query class:
| <ui:composition>
| <h:form>
| <h:inputText value="#{query.expression}" />
| <h:commandButton value="Search" />
| </h:form>
| </ui:composition>
|
and a results page that runs the query and displays the results:
| <ui:include src="query.xhtml" />
| <div>
| <h:outputText value="Results are #{search.results}" />
| </div>
|
Everything works fine until I use a ui:define tag to break up my page and use templates:
| <ui:composition template="searchTemplate.xhtml">
|
| <ui:define name="query">
| <ui:include src="query.xhtml" />
| </ui:define>
|
| <ui:define name="results">
| <h:outputText value="Results are #{search.results}"/>
| </ui:define>
|
| </ui:composition>
|
When an element that binds to query and an element that binds to search are in separate <ui:define>'s I get a RequiredException:
RequiredException: @In attribute requires non-null value: search.query
Is this expected behaviour or am I not understanding the lifecycle of the pages properly?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120063#4120063
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120063
18 years, 5 months
[EJB 3.0] - Update exiting BLOB does not work
by CarstenRudat
Hi all,
I have a problem updating a existing or null BLOB. I run jboss-4.2.1.GA (all-config) with its EJB3 implementation and MySQL 5.x with mysql-connector-java-5.0.7-bin.jar-driver.
I have an entity Signature with a unidirectional relationship to Image (which holds the BLOB):
| public class Signature ...
|
| @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER)
| @JoinColumns({
| @JoinColumn(name="image_id_fk", referencedColumnName="id")
| })
| public com.genloop.base.ImageImpl getImage() {
| return this.image;
| }
|
|
| public class Image ...
|
| @Lob
| @Column(name = "image", columnDefinition="MEDIUMBLOB")
| //(a)org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE) -> I tried this
| public java.sql.Blob getImage() {
| return this.image;
| }
|
In a SLSB, I try a entityManager.merge(aSignagure) and all changes of Signature and Image (e.g. a field "fileName") will update to the DB, except. The BLOB.
I have done a little debugging and I saw, that the getImage() was not called after entityManager.merge(). Then I can see something about XYZLoader that (I think so...) fills the entity-bean with the data of the database. This trace calls setImage(Blob) with the old BLOB or (if it was null) with null.
What could I do?
Thanks,
Carsten
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120058#4120058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120058
18 years, 5 months