-
1. Re: <ui:define> and injection
schlafsack Jan 15, 2008 8:46 AM (in response to schlafsack)I've found that this behaviour is dependent on the order of the <ui:insert> tags in the template. Everything works if query is <ui:insert>'ed before results but I get the exception if results is before query:
<div id="container"> <div><ui:insert name="results" /></div> <div><ui:insert name="query" /></div> </div>
I guess this makes sense, results IS loaded before query is declared, but for some reason I thought the injection happened in a later phase. -
2. Re: <ui:define> and injection
pmuir Jan 17, 2008 9:47 AM (in response to schlafsack)How are you creating the query object for injection, its not marked @AutoCreate or @In(create=true). N.b. All EL requests are create=true by default.
-
3. Re: <ui:define> and injection
schlafsack Jan 17, 2008 10:03 AM (in response to schlafsack)I was expecting the EL in the search widget (query.xhtml) to have created it when restoring the view after the post back. It appears that this happens as I expect if the widget is inserted into the same define tag or (as I've hacked it at the moment) if I simply put a comment with some EL in before the results list:
<!-- #{query.expression} --> <ui:define name="results"> <h:outputText value="Results are #{search.results}"/> </ui:define>
Is it the case that if you are relying on EL to create your instances, then the order of the elements in the page is important?
i.e. if A is injected into B then the element EL that creates A MUST come before the element EL that creates B -
4. Re: <ui:define> and injection
schlafsack Jan 17, 2008 10:05 AM (in response to schlafsack)NB: In my case, the order of the elements in the template is important because they are involved in a CSS based three column layout.
-
5. Re: <ui:define> and injection
pmuir Jan 17, 2008 12:29 PM (in response to schlafsack)I'm not quite sure of your application architecture, but a PAGE scope component thats available in restore won't be available in render (you are in a different page scope by then).
Is it the case that if you are relying on EL to create your instances, then the order of the elements in the page is important?
Of course. *Something* needs to tell Seam to create the component, be it the component (@AutoCreate), the EL, or the @In(create=true).