[richfaces-issues] [JBoss JIRA] Closed: (RF-652) broken behavior when mixing maps in expressions inside subTable

Aleksej Yanul (JIRA) jira-events at lists.jboss.org
Mon Mar 31 02:49:40 EDT 2008


     [ http://jira.jboss.com/jira/browse/RF-652?page=all ]

Aleksej Yanul closed RF-652.
----------------------------


> broken behavior when mixing maps in expressions inside subTable
> ---------------------------------------------------------------
>
>                 Key: RF-652
>                 URL: http://jira.jboss.com/jira/browse/RF-652
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.1.0
>            Reporter: John Mazzitelli
>         Assigned To: Aleksej Yanul
>             Fix For: 3.1.0
>
>         Attachments: AutoDiscoveryQueueUIBean.java, AutoDiscoverySessionUIBean.java, queue.xhtml
>
>
> I am trying to build a UI that has a dataTable/subTable where each row in both data and sub tables have boolean checkboxes.  I also have a "+" and "-" command buttons on the dataTable rows that allow me to expand and collapse the subtables independently.  I also try to maintain the state of the boolean checkboxes.
> The scenario is this: I have a list of "platforms" and on each platform is a list of "servers".  So, for example, platform #1 has 3 servers, platform #2 has 2 server, platform #3 has 4 servers.  The dataType has one row per platform and each platform row has a subTable for its servers - one row in the subtable per server on that platform.
> When I go to my queue.xhtml as attached, it all works except that my checkboxes in the server subTable rows are not stored in session.  But, you will notice that everything else works fine - I can click the "+++" links to expand platforms (i.e. shows/renders the subTables).  I can click the "---" links to collapse the subTables (i.e. hides the subTables).  Also notice that the state of the platform checkboxes are remembered (they are stored in the session UI Bean). However, notice that server checkboxes are not remembered.  This is because the expression is incorrect for the server's boolean checkbox - I put "{AutoDiscoverySessionUIBean.selectedResources[serverItem.id]}" - notice I forgot the "#" sign - this is line 45 of queue.xhtml.
> OK, so let's add that back in - thus making the value attribute for the "checkbox_server" selectBooleanCheckbox component a valid expression (#{AutoDiscoverySessionUIBean.selectedResources[serverItem.id]} on line 45).  Now redeploy and notice everything goes to hell - I can expand only the FIRST "+++" link I click, thereafter, nothing works.  If I click the "---" to collapse that first subTable back down, it submits the request but fails to work.  I can't expand anything else.  In my real code, I have other things such as table sorting and pagination, and none of that works either.  Its as if after that first request, any further requests to the server fail.
> Now, if I were to replace the use of a Map there on line 45 with a simple property (that is, let's say I don't use a map expression of "selectedResources[serverItem.id]" but instead write some code that accesses a single property - like "foo") it works again.  I can expand and collapse the platform rows at will.  Of course, this doesn't do what I want because I lose the ability to track the state of the boolean checkbox.
> So, for some reason, using a Map expression in this subTable's boolean checkbox causes all kinds of weird problems to appear.
> I stripped out most of my code and will provide you with replication code that is down to the most minimum code that you need to see this problem. It is very small - a xhtml and two .java classes (a request scoped UI Bean and a session scoped UI Bean). I will attach my .xhtml as well as my request-scoped UI bean (AutoDiscoveryQueueUIBean) and my session-scoped UI Bean (AutoDiscoverySessionUIBean) to this issue.  The configurations you need is:
>    <!-- queue.xhtml -->
>    <managed-bean>
>       <managed-bean-name>AutoDiscoveryQueueUIBean</managed-bean-name>
>       <managed-bean-class>org.jboss.on.server.ui.discovery.AutoDiscoveryQueueUIBean</managed-bean-class>
>       <managed-bean-scope>request</managed-bean-scope>
>    </managed-bean>
>    <managed-bean>
>       <managed-bean-name>AutoDiscoverySessionUIBean</managed-bean-name>
>       <managed-bean-class>org.jboss.on.server.ui.discovery.AutoDiscoverySessionUIBean</managed-bean-class>
>       <managed-bean-scope>session</managed-bean-scope>
>    </managed-bean>
>    <navigation-rule>
>       <from-view-id>/queue.xhtml</from-view-id>
>       <navigation-case>
>          <from-outcome>success</from-outcome>
>          <to-view-id>/queue.xhtml</to-view-id>
>          <redirect/>
>       </navigation-case>
>    </navigation-rule>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list