title: Guidewire : Refresh List view when the button is clicked
body: <p>The Listview(partial page) is not getting refreshed when I click the button. It keeps on adding the rows whenever the buttons are clicked.</p>
  <p>Below are the functions for adding the drivers.</p>
  <pre><code>function getDriversFromPolicy_CA7()  : CA7CommAutoDriver[] {
      var drivers = this.Policy.LatestPeriod.CA7Line.Drivers // **this** Contingency Entity
      var excludeDrivers = this.ExcludeDrivers_CA7.toList() // Contingency entity has a ExcludeDrivers_CA7 array
      if(excludeDrivers.Empty) {
        drivers?.each(\driver -&gt; this.addToExcludeDrivers_CA7(driver) )
      } else {
        drivers.each(\driver -&gt; {
          if (excludeDrivers.where(\elt -&gt; elt.LicenseNumber == driver.LicenseNumber).toList().Count == 0) {
            this.addToExcludeDrivers_CA7(driver)
          }
        })
      }
  
      return this.ExcludeDrivers_CA7
    }
  
    function getDriversFromTransaction_CA7() : CA7CommAutoDriver[] {
      var drivers = this.PolicyPeriod.CA7Line.Drivers.toList()
      var excludeDrivers = this.ExcludeDrivers_CA7.toList()
      if(this.ExcludeDrivers_CA7.IsEmpty) {
        drivers?.each(\driver -&gt; this.addToExcludeDrivers_CA7(driver) )
      } else {
  //      this.ExcludeDrivers_CA7.toList().retainAll(drivers.toList())
        drivers.each(\driver -&gt; {
          if (excludeDrivers.where(\elt -&gt; elt.LicenseNumber == driver.LicenseNumber).toList().Count == 0) {
            this.addToExcludeDrivers_CA7(driver)
          }
        })
      }
      return this.ExcludeDrivers_CA7
    }
  
    function removeDrivers_CA7(driver : CA7CommAutoDriver) {
      this.removeFromExcludeDrivers_CA7(driver)
    }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cccPa.png" rel="nofollow noreferrer">pcf screenshot for reference</a></p>
  <p><a href="https://i.stack.imgur.com/9i7hP.png" rel="nofollow noreferrer">UI screenshot for reference</a></p>