have you looked at selectOneRow in the sandbox?

http://www.irian.at/myfaces-sandbox/selectOneRow.jsf

Also, Jenia4Faces has radio/checkbox table components as well.


On 9/18/06, Shawn Recinto <[EMAIL PROTECTED]> wrote:




Hey guys,

I running into an issue when using a dataTable (tomahawk or core) with
selectOneMenu and selectBooleanCheckbox, for some reason its values are
getting "defaulted" or "lost" i.e. on a selectOneMenu bound to a value
object from a collection in the backing bean, where I have verified that the
value is set correctly up until the point it started rendering the table,
some render process sets the value to empty string, similar with the
selectBooleanCheckbox except the value always gets set to false.  I
purposely set the values to "true" in the UI and placed an exception for the
check box for anything that set it to false and here is the sample stack
trace I get.  This occurs on the rendering phase of the life cycle i.e.
Response phase



com.ies.common.error.IESRuntimeException: This should not
be false

        at
com.ies.scholar.vo.form.FormInstanceVO.setAccessable(FormInstanceVO.java:300)

        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.java:406)

        at
org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:173)

        at
com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java:201)

        at
com.sun.el.parser.AstValue.setValue(AstValue.java:113)

        at
com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)

        at
com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)

        at
com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)

        at
javax.faces.component.UIInput.updateModel(UIInput.java:269)

        at
javax.faces.component.UIInput.processUpdates(UIInput.java:206)

        at
javax.faces.component.UIData.process(UIData.java:733)

        at
javax.faces.component.UIData.processColumnChildren(UIData.java:714)

        at
javax.faces.component.UIData.processUpdates(UIData.java:622)

        at
org.apache.myfaces.component.html.ext.HtmlDataTableHack.processUpdates(HtmlDataTableHack.java:133)

        at
org.apache.myfaces.component.html.ext.HtmlDataTable.processUpdates(HtmlDataTable.java:379)

        at
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)

        at
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)

        at
javax.faces.component.UIForm.processUpdates(UIForm.java:87)

        at
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)

        at
javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:157)

        at
org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(LifecycleImpl.java:302)

        at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:81)

        at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at
com.ies.common.ui.common.filter.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:43)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

        at java.lang.Thread.run(Thread.java:595)



This stack trace represents the custom exception I threw when something from
the component when through its processUpdates cycle.



Here is some sample code:



"from the JSF page"

<t:dataTable id="centerInstanceList"

var="centerForm"

      value="#{ formBean.formInstances}"

      styleClass="detailsGrid"

      headerClass="detailsHeader"

      rowClasses="detailsOnRow,detailsOffRow"

      rowCountVar="rowCount"

      rowIndexVar="rowIndex">

      …

      <t:column   style="width:10%">

<f:facet name="header">

<h:outputText value="#{messages.form_center_list_empDoc}"
/>

</f:facet>

            <t:selectOneMenu value="#{centerForm.docuId}">

                  <f:selectItems value="#{formBean.documentSelectItems}" />

            </t:selectOneMenu>

      </t:column>

      …

      <t:column   style="width:5%">

<f:facet name="header">

<h:outputText value="#{messages.form_center_list_Sta}" />

</f:facet>

<t:selectBooleanCheckbox value="#{centerForm.accessable}"/>

</t:column>

</t:dataTable>





My FormInstanceVO is a pojo except for my debug exception code snippets
(from backing bean formBean.formInstances)



public Boolean getAccessable() {

                        return this.accessable;

            }



public void setAccessable(Boolean accessable) {

                        if(Boolean.FALSE.equals(accessable)) {

                                    IESRuntimeException e =
new IESRuntimeException("This should not be false");

                                    e.printStackTrace();

                                    throw e;

                        }

                        this.accessable = accessable;

            }





An interesting thing to note is that if I change any of these it a
<h:inputText /> or an <h:outputText /> it correctly display the values that
are in the VOs



Could someone help me figure out what I am missing? Why would the dataTable
override the values that were preset in the value objects for a
selectBooleanCheckbox or selectOneMenu?



I am using MyFaces 1.3

Facelets 1.1.11

hibernate-3.2.0.cr2

Spring Framework 1.2.8



Running on apache-tomcat-5.5.17



TIA



Regards,

Shawn Recinto

Reply via email to