what you have below seems pretty reasonable. if it is more then just links
changing i would swap a different fragment in, but it looks like overkill
for your case.

-igor

On 4/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I have a table which contains a list of users. At the end of each row
there
is an delete/undo link. When the user clicks delete I want to hide the row
and replace it with only the undo link. What would be the best way to do
this? Thanks for your time.

            view = new ListView("rows", data) {
                  public void populateItem(ListItem listItem) {
                        UserType value = (UserType
)listItem.getModelObject();
                        listItem.add(new
ModalWindowPanel("userSearchPanel", value));

                        listItem.add(new CheckBox("admin", new Model(new
Boolean(value.isAdmin()))));
                        listItem.add(new
DeleteUndoPanel("deleteUndoPanel",
listItem.getModel()));
                  }
            };


            private class DeleteUndoPanel extends Panel {


            public DeleteUndoPanel(String id, final IModel model) {
                  super(id, model);
                  setOutputMarkupId(true);
                  final UserType type = (UserType)this.getModelObject();

                  undoItem = new AjaxLink("undoItem") {

                        @Override
                              public boolean isVisible() {
                        ....
                         }

                        public void onClick(AjaxRequestTarget target) {
                              type.setDelete(false);
                              target.addComponent(DeleteUndoPanel.this);
                        }
                  };
                  ..
                  deleteItem = new AjaxLink("deleteItem") {


********************
NOTICE OF CONFIDENTIALITY
This communication including any information transmitted with it is
intended only for the use of the addressees and is confidential.
If you are not an intended recipient or responsible for delivering
the message to an intended recipient, any review, disclosure,
conversion to hard copy, dissemination, reproduction or other use
of any part of this communication is strictly prohibited, as is the
taking or omitting of any action in reliance upon this communication.
If you receive this communication in error or without authorization
please notify us immediately by return e-mail or otherwise and
permanently delete the entire communication from any computer,
disk drive, or other storage medium.

If the above disclaimer is not properly readable, it can be found at
www.td.com/legal

AVERTISSEMENT DE CONFIDENTIALITE
Ce courriel, ainsi que tout renseignement ci-inclus, destiné uniquement
aux destinataires susmentionnés,  est confidentiel.  Si vous
n'êtes pas le destinataire prévu ou un agent responsable de la
livraison de ce courriel, tout examen, divulgation, copie, impression,
reproduction, distribution, ou autre utilisation d'une partie de ce
courriel est strictement interdit de même que toute intervention ou
abstraction à cet égard.  Si vous avez reçu ce message par erreur ou
sans autorisation, veuillez en aviser immédiatement l'expéditeur par
retour de courriel ou par un autre moyen et supprimer immédiatement
cette communication entière de tout système électronique.

Si l'avis de non-responsabilité ci-dessus n'est pas lisible, vous
pouvez le consulter à www.td.com/francais/legale
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to