How to manage button list with dyanmic list of choices

In an existing code, I have a jsp page that shows a research page with some buttons (with dyanmic list of choices). here is its jsp code :

And here is the jsp code of to this part of page :

<div class="col-md-4">
  <div id="ega-list-div" class="form-group">
    <label  class="col-sm-4">EGA</label>
    <s:select id="ega-list" multiple="true" cssClass="form-control col-sm-6" list="listEga" listValue="libelle" listKey="idTechnique" name="egas" />
  </div>
</div>

<div class="col-md-4">
  <div id="statut-list-div" class="form-group">
    <label  class="col-sm-4">Statut</label>
    <s:select id="statut-list" multiple="true" cssClass="form-control col-sm-6" list="listStatut" name="statuts" />
    <s:select id="statut-listDisco" multiple="true" cssClass="form-control col-sm-6" list="listStatutDisco" name="statutsDisco" style="display:none" />
  </div>
</div>

<div class="col-md-4">
  <div class="form-group">
    <label  class="col-sm-4">City</label>
    <s:textfield id="city-list" name="city" cssClass="form-control col-sm-6"/>
  </div>
</div>

And here is the js code associated to this part of code :

    // multi select ega
    $('#ega-list').multipleSelect({
        selectAllText: "All egas",
        allSelected:"All egas"
    });

    // multi select of statut
    $('#statut-list').multipleSelect({
        selectAllText: "All status"
    });

allSelectBoxChecked = function() {
    $('#ega-list').multipleSelect('checkAll');
    $('#statut-list').multipleSelect('checkAll');
};

I want to modify my page to resolve two problems :

  • The option displayed for the null values : In a button list, if I don't choose any option (among the dynamic list), the criterion of the research is not applied. So, for me, it's equivalent to the "all" options. So, I want to display "All" as a text if the user doesn't choose anything.

  • The selected option is no longer displayed after the click : If I choose an option in a list and I click in the research button, it refresh the page and display the results (in the same page). The problem is that we don't keep the selected option and you can't guess where are the current criterion of research...