You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa Gomez" <dc...@fixed.com> on 2003/08/22 16:53:06 UTC

Re: Table refreshing (Table component) *Re-ask*

Hi all,

Still not figured out the situation below.
Any ideas yet?
Thx

> Below are two methods which can be used to remove object from a table 
> (on screen and from the DB).
> The first works through a checkbox mechanism and the second is 
> activated on rowlevel by means of a DirectLink.
>
> Q: Why does no. 2 immediately give me a refreshed view whilst no 1 
> doesn't.
> No 1 only does so *after* page fwd and then back again.
>
> So both do their work is just the refresh bit that eludes me.
> Any suggestions?
>
> TIA,
> Fermin DCG
>
> No 1: form based deletion
>  public void formDeleteSubmit(IRequestCycle cycle) {
>    // Get the rows that have the checkbox set and process them row by row
>    for (Iterator iter = m_setSelectedRows.iterator(); iter.hasNext();) {
>       PersistentDCG o = (PersistentDCG) iter.next();
>      // Remove or do what you have to do from a dataSource perspective
>      ((PersistentDCG) o).delete(((Visit) 
> cycle.getEngine().getVisit(cycle)).getUser());
>      // Remove the row from the current TableDataModel
>      ((SimpleListTableDataModel) ((SimpleTableModel) 
> getTableModel()).getDataModel()).removeRow(o);
>      // Remove the row from the temporary map
>      _objectLinkMap.remove(o.toString());
>    }
>    Global.getDb().commit();
>    m_setSelectedRows.clear();
>  }
>
> No 2: row based deletion
>  public void deleteRow(IRequestCycle cycle) {
>    Object[] arrParams = cycle.getServiceParameters();
>    Object o = _objectLinkMap.get(arrParams[0]);
>    // Remove or do what you have to do from a dataSource perspective
>    if (o instanceof PersistentDCG) ((PersistentDCG) o).delete(((Visit) 
> cycle.getEngine().getVisit(cycle)).getUser());
>    // Remove the row from the current TableDataModel
>    ((SimpleListTableDataModel) ((SimpleTableModel) 
> getTableModel()).getDataModel()).removeRow(o);
>    // Remove the row from the temporary map
>    _objectLinkMap.remove(arrParams[0]);
>    Global.getDb().commit();
>  }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>