-1

I have a rich table panel with many panels containing a jsp file. I have one jsp file like this :

<rich:panel>
    <f:facet name="header">
        <h:outputText value="Traitement" />
    </f:facet>
    <h:panelGroup>
        <table style="width: 95%; border-spacing: 5px">

    <tr>
        <td><h:outputLabel value="Fruit list  : " /></td>
        <td>
          <h:selectOneMenu
                    id="list_fruit" style="width:288px;"
                    value="#{myBean.FruitId}">
                <f:selectItem itemValue="0" itemLabel="" />
                <f:selectItem itemValue = "1" itemLabel = "fruit 1" /> 
                <f:selectItem itemValue = "2" itemLabel = "fruit 2" /> 
                <f:selectItem itemValue = "3" itemLabel = "fruit 3" />
            </h:selectOneMenu>
        </td>
    </tr>
</table>
    </h:panelGroup>
</rich:panel>

My problem is when i select fruit1 or fruit2 or fruit3 and i click in another panel and when i return to this panel, i have the last select present(fruit1 or fruit2 or fruit3). I want to empty user selection when I go to another panel and i return to thius panel, the select choice must have empty. How can i do refresh my jsp page side javascript to delete the last select of fruit and the selection by default must have empty

obela06
  • 307
  • 5
  • 15

1 Answers1

0

The value is held in #{myBean.FruitId}. You have to clear this value.

You can put a a4j:jsFunction or a <p:remoteCommand in your panel and call this function from your javascript onblur, onfocus or onclick method. This way, you can call any bean method and do a value setting as you want. Don't forget to give the remoteCommand a correct update="mypanelid"

Holger
  • 899
  • 2
  • 7
  • 12