[help] cascading with multi selection in table

2 posts / 0 new
Last post
atao
Offline
Joined: 10/15/2008
[help] cascading with multi selection in table

Vincent,

I have a table with SINGLE_INTERVAL_SELECTION as "selectionMode" in a view with cascadingModels at true, see below.

When many contracts are selected, I'd like to display all the payslips for these contracts. ATM only the payslips of the first contract selected are displayed.

Can you give me some clues on how to do this.

Regards

Pierre

====================================

  <bean
    id="workers.and.contracts.page"
    parent="splitView">
    <property name="orientation"                   value="HORIZONTAL" />
    <property name="leftTopViewDescriptor"         ref="branch-workers.pane" />
    <property name="rightBottomViewDescriptor">
      <bean parent="splitView">
        <property name="leftTopViewDescriptor"     ref="worker-contracts.pane" />
        <property name="rightBottomViewDescriptor" ref="contract-payslips.pane" />
        <property name="cascadingModels"           value="true" />
      </bean>
    </property>
    <property name="cascadingModels"               value="true" />
    <property
      name="iconImageURL"
      value="classpath:org/popsuite/common/images/employees-48x48.png" />
  </bean>

  <bean
    id="worker-contracts.pane"
    parent="singleSelectionView"
    p:modelDescriptor-ref ="Worker-contracts"
    p:actionMap-ref       ="contractMasterDetailActionMap"
    p:selectionMode       ="SINGLE_INTERVAL_SELECTION"
    p:rowAction-ref       ="contractListEditFrontAction"
    >
    <property name="renderedProperties">
      <list>
        <value>businessId</value>
        <value>job.name</value>
        <value>grossWage</value>
        <value>start</value>
        <value>end</value>
      </list>
    </property>
  </bean>

vvandens
Offline
Joined: 05/29/2008
[help] cascading with multi selection in table

Pierre,

I'm afraid I can't figure out a way of achieving this behaviour using regular cascading model binding.

However, you should be able to build something using the itemSelectionAction on the contracts table. This action could leverage the selected contracts indices to update a transient (computed writable) collection of payslips on the worker (the union of the selected contracts payslips).

You have then to bind the payslips table on the worker computed collection (no cascadingModel any more since both tables will have the Worker as master).

 

HTH,

Vincent