[JBoss Seam] - Re: @DataModelSelection defaults to first value in model??
by ebu
Hi
I met the same problem, but in slightly different context - i have a CRUD SFSL and it's instance member after creation was overwritten with new value:
| public class ItemEditor implements ItemEditorLocal{
| @DataModelSelection
| private Item item = new Item();
| ...
|
| public void persist() {
| em.persist(this.item);
| ....
| this.item = new Item();
| }
| ...
| }
|
by this i wanted to clean the form which displays current item. But instead i got my form populated with recently entered data. Even after killing all cookies and refreshing the page it was filled. I was completely baffled!
But it appears that most likely the problem is caused by javax.faces.model.ListDataModel - it sets rowIndex to 0 when it has some data and then when injectDataModelSelections is being called on a component the first element in a datamodel is picked up and injected into member annotated with @DataModelSelection... hardly it was expected behaviour...
btw, there is a astounding code in injectDataModelSelection:
| if (null!=null)
| {
| setFieldValue( bean, null, name, wrapper.getWrappedData(dataModelAnn, dataModel) ); //for PAGE scope datamodels (does not work for properties!)
| }
|
i mean null!=null ... what is that?
wbr, eugen.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030399#4030399
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030399
19Â years, 1Â month
[JBoss Seam] - Extending aj4jsf component
by dustismo
Hi,
I am trying to extend the outputPanel of ajax4jsf. So I have a simple class (just for testing sake):
| public class UIAjaxIFOutputPanel extends HtmlOutputLabel {
| @Override
| public void setId(String id)
| System.out.println("SETTING ID: " + id);
| super.setId(id);
| }
| }
|
and in my *.taglib.xml:
| <tag-name>outputPanel</tag-name>
| <component>
| <component-type>net.infofilter.IFOutputPanel</component-type>
| <renderer-type>
| org.ajax4jsf.components.AjaxOutputPanelRenderer
| </renderer-type>
| </component>
| </tag>
|
And in faces-config.xml
| <component>
| <component-type>net.infofilter.IFOutputPanel</component-type> <component-class>net.infofilter.component.UIAjaxIFOutputPanel</component-class>
| </component>
|
When I put the tag onto a page i get:
| 13:53:19,783 WARN [HtmlRenderKitImpl] Unsupported component-family/renderer-type: javax.faces.Output/org.ajax4jsf.components.AjaxOutputPanelRenderer
| 13:53:19,783 INFO [[/Infofilter3-Site]] No Renderer found for component {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /home.xhtml][Class: net.infofilter.component.UIAjaxIFOutputPanel,Id: _id69]} (component-family=javax.faces.Output, renderer-type=org.ajax4jsf.components.AjaxOutputPanelRenderer)
| 13:53:19,783 WARN [UIComponentBase] No Renderer found for component {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /home.xhtml][Class: net.infofilter.component.UIAjaxIFOutputPanel,Id: _id69]} (component-family=javax.faces.Output, renderer-type=org.ajax4jsf.components.AjaxOutputPanelRenderer)
| 13:53:19,784 WARN [HtmlRenderKitImpl] Unsupported component-family/renderer-type: javax.faces.Output/org.ajax4jsf.components.AjaxOutputPanelRenderer
| 13:53:19,784 INFO [[/Infofilter3-Site]] No Renderer found for component {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /home.xhtml][Class: net.infofilter.component.UIAjaxIFOutputPanel,Id: _id69]} (component-family=javax.faces.Output, renderer-type=org.ajax4jsf.components.AjaxOutputPanelRenderer)
| 13:53:19,784 WARN [UIComponentBase] No Renderer found for component {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /home.xhtml][Class: net.infofilter.component.UIAjaxIFOutputPanel,Id: _id69]} (component-family=javax.faces.Output, renderer-type=org.ajax4jsf.components.AjaxOutputPanelRenderer)
| 13:53:19,784 WARN [HtmlRenderKitImpl] Unsupported component-family/renderer-type: javax.faces.Output/org.ajax4jsf.components.AjaxOutputPanelRenderer
| 13:53:19,784 INFO [[/Infofilter3-Site]] No Renderer found for component {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /home.xhtml][Class: net.infofilter.component.UIAjaxIFOutputPanel,Id: _id69]} (component-family=javax.faces.Output, renderer-type=org.ajax4jsf.components.AjaxOutputPanelRenderer)
| 13:53:19,784 WARN [UIComponentBase] No Renderer found for component {Component-Path : [Class: org.ajax4jsf.framework.ajax.AjaxViewRoot,ViewId: /home.xhtml][Class: net.infofilter.component.UIAjaxIFOutputPanel,Id: _id69]} (component-family=javax.faces.Output, renderer-type=org.ajax4jsf.components.AjaxOutputPanelRenderer)
|
I suspect this is a classloading problem, no? If so, what do I need to do to make this work? The project was generated using the latest seam-gen from cvs (includes richfaces and ajax4jsf support)
thanks for any help,
Dustin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030376#4030376
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030376
19Â years, 1Â month