[JBoss Seam] - loosing seam initialization (in particular injection) when u
by cyberanto
Env: Seam2.0.1.CR1/JBoss4.2.0/JBoss Development Studio/Windows XP
I am having a problem with Injection failing to work for components which are programmatically added to the context, e.g.
in the Action Class:
Contexts.getSessionContext().set("catalogModel", newCatalog);
the ModelClass:
@Scope(SESSION)
@Name("catalogModel")
public class CatalogModel {
@Logger private Log log;
@In(create=true)
private SkuDAO skuDao;
etc.
}
log and skuDao are null; Of course, the class has been created using new CatalogModel() ... I have tried to obtain the Objects by Context.get() and Components.instance(), to no avail. Had to new them into existence.
catalogModel and skuDao show up as Seam Components in the server log during startup and e.g. the correct catalogModel is available to the web application. (the object does get set into the Context).
Any hints, suggestions?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126794#4126794
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126794
18 years, 2 months
[JBoss Seam] - <s:conversationPropagation type=
by joeyxxx
This code worked prior to Seam 2.0.1GA. I've tested various combinations of seam and richfaces versions and 2.0.1 seems to be the culprit.
With <s:conversationPropagation type="join" />:
| <a4j:commandButton styleClass="btn" id="contactButton#{accountHolder}" oncomplete="UIControl('contactForm', 'contact', 'identification');" reRender="contactBlock#{accountHolder},uiSec" actionListener="#{accountOpen.submitContactInfo}" value="Continue" >
| <a4j:actionparam name="holder" value="getSuffix()" noEscape="true"/>
| <s:conversationPropagation type="join" />
| </a4j:commandButton>
|
|
Renders the following: Notice that the onclick handler is rendered before the input is rendered and causes a document.getElementById("contactButton1") has no properties javascript error.
| <div id="contactContinueSection1" style="padding: 10px 10px 10px 10px; display: block">
|
| <script language="JavaScript" type="text/javascript">
| //<![CDATA[
| document.getElementById('contactButton1').onclick = new Function("event", "{if (document.getElementById){var form = document.getElementById('contactForm1');var input = document.createElement('input');if (document.all){ input.type = 'hidden';input.name = 'conversationPropagation';input.value = 'join';}else if (document.getElementById) {input.setAttribute('type', 'hidden');input.setAttribute('name', 'conversationPropagation');input.setAttribute('value', 'join');}form.appendChild(input);return true;}}");
| //]]>
| </script>
|
| <input id="contactButton1" name="contactButton1" onclick="A4J.AJAX.Submit('_viewRoot','contactForm1',event,{'parameters':{'holder':getSuffix(),'conversationPropagation':'join','contactButton1':'contactButton1'} ,'actionUrl':'/BaisiPrototype/AE/primary.jspv?javax.portlet.faces.DirectLink=true','oncomplete':function(request,event,data){UIControl('contactForm', 'contact', 'identification');}} );return false;" value="Continue" class="btn" type="button" />
| </div>
|
Without <s:conversationPropagation type="join" />, the onclick handler is rendered as an attribute of the button as ff:
| <div id="contactContinueSection1" style="padding: 10px 10px 10px 10px; display: block"><input id="contactButton1" name="contactButton1" onclick="A4J.AJAX.Submit('_viewRoot','contactForm1',event,{'parameters':{'holder':getSuffix(),'contactButton1':'contactButton1'} ,'actionUrl':'/BaisiPrototype/AE/primary.jspv?javax.portlet.faces.DirectLink=true','oncomplete':function(request,event,data){UIControl('contactForm', 'contact', 'identification');}} );return false;" value="Continue" class="btn" type="button" />
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126787#4126787
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126787
18 years, 2 months