0

I hope I can phrase this without going into so much detail.

I have an IceFaces Dialog that popups up when I pull a report. In this dialog, you have a panelSeries of persons and then a datatable of records tied to them. These records have a dropdown with 2 values - Accept and Dispute. The value of the menu is kept in an entitybean, which is session-based, but the bean itself is request scoped. We are using JSF 2.1 so view-scope isn't a possibility.

The issue is the initial display of the dialog shows all persons and their records as Accept - which is the default. If I select one person and one their records as Dispute, and then continue processing, the dialog is hidden. So far, so good. Now if I click on the order reports button on the main page again, the dialog is shown again. This time, the prior selection is showing Dispute when it should be showing Accept. The value is 'N', which is the itemValue pointing to Accept. Dispute is supposed to be selected when the value is 'Y'. I even threw an outputText with the value and it shows 'N'. Somehow the value and the selectItem are not communicating with each other. What's worse, if you left the Dispute alone and closed the dialog to allow for processing to continue, the backing bean sees Accept in the value (value for that record is 'N'). That messes things up on the back end. The only way to fix this is to parse the parameter values map and if Y, set the correct value. To me, this is a hack. Maybe something I am missing.

How can I force the dialog to reset all dropdowns to whatever is the value attribute? Each time I show the dialog, the values are all reset to 'N' by default, which is Accept. If you want to dispute a record, you have to select it. I have verified the values and all of them are set to 'N' like they should. I think the dialog is messing things up.

Here's a code snippet:

<ice:panelSeries value="#{myBean.onlyInsuredPersonAsList}" var="person">
    <ice:dataTable id="violationses" styleClass="violationsTbl"
        value="#{person.violations}" var="violation"
        width="100%" scrollable="true">
        <h:selectOneMenu id="acceptDispute" styleClass="selectFieldControl"
            value="#{violation.disputedFlag}" required="true">
            <f:selectItem itemLabel="Accept" itemValue="N"/>
            <f:selectItem itemLabel="Dispute" itemValue="Y"/>
        </h:selectOneMenu>
    </ice:dataTable>
</ice:panelSeries>

This is sitting inside an ace:dialog.

First time, Accept is shown for all violations within each person. Close the dialog and then reorder report. The previous disputed values are shown even though the values coming back from #{violation.disputedFlag} shows 'N'.

Big Al
  • 481
  • 1
  • 7
  • 14

0 Answers0