Hey guys. I have a ListView that contains a list of employee names. This list
is wrapped in a webMarkupContainer which allows the user to add and delete
names from the listview. All of this works properly. 

I have setup a tooltip that allows the user to hover over the employee name
and it will display more information about the employee like title and phone
number and such. This also works when it is added.

The problem comes in when the user deletes or edits the employee. Say the
user wants to delete an employee from the list. The employee is deleted from
the list but the tooltip for the old employee remains. The same thing
happens if the user wants to change one employee to another.

It seems that the data is getting refreshed but the tooltip is not.

Any clue on what I can do here? I posted this question on Sunday but it did
not show up on the message board so I thought I would post it again.

Here is the code for the ListView



ListView<KeyMemberData> lv = new ListView<KeyMemberData>("rows", kmList) {
                        public void populateItem(final ListItem<KeyMemberData> 
item)
                        {
                                final int index = item.getIndex();
                                item.add(new AttributeModifier("class", true, 
new
AbstractReadOnlyModel<String>()
                    {
                        public String getObject()
                        {
                            return (index % 2 == 1) ? "even" : "odd";
                        }
                    }));
                                item.add(new AttributeModifier("height", true, 
new
Model<String>("20")));
                                //create delete button using a modal and ajax 
link
                                final ModalWindow deletemodal;
                                deletemodal = new ModalWindow("deletemodal");
                                deletemodal.setInitialHeight(100);
                                deletemodal.setInitialWidth(350);
                                deletemodal.setResizable(true);
                                deletemodal.setPageMapName("KeymemberDelete");
                                deletemodal.setCookieName("KeymemberDelete");
                                deletemodal.setTitle("Delete Key Member");
                                deletemodal.setPageCreator(new 
ModalWindow.PageCreator() {
                                public Page createPage() {
                                    return new DeleteRow(item.getIndex(), 
deletemodal, pd,
"keymember");
                                }
                            });
                                deletemodal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
                                public void onClose(AjaxRequestTarget target) {
                                    target.addComponent(listContainer);
                                    if(pd.getKeyMemberList().isEmpty()){
                                        listContainer.setVisible(false);
                                    }
                                }
                            });
                            item.add(new AjaxFallbackLink<Void>("deletelink") {
                                public void onClick(AjaxRequestTarget target) {
                                  deletemodal.show(target);
                                }
                            });
                            
                                item.add(deletemodal);
                                
                                //create modal and ajax link to edit keymembers
                                final ModalWindow editmodal;
                                editmodal = new ModalWindow("editmodal");
                                editmodal.setInitialHeight(300);
                                editmodal.setInitialWidth(700);
                                editmodal.setResizable(true);
                                editmodal.setPageMapName("KeymemberEdit");
                                editmodal.setCookieName("KeymemberEdit");
                                editmodal.setTitle("Update Key Member");
                                editmodal.setPageCreator(new 
ModalWindow.PageCreator() {
                                public Page createPage() {
                                    return new KeyMemberPopup(item.getIndex(), 
"update",
editmodal, pd);
                                }
                            });
                                editmodal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
                                public void onClose(AjaxRequestTarget target) {
                                    target.addComponent(listContainer);
                                }
                            });
                                AjaxFallbackLink<Void> kmlink = new 
AjaxFallbackLink<Void>("kmlink") {
                                public void onClick(AjaxRequestTarget target) {
                                    editmodal.show(target);
                                }
                            };
                            
                            //get key member name
                                KeyMemberData kmd = 
(KeyMemberData)item.getModelObject();
                                Employee emp = kmd.getEmployee();
                                AttributeModifier am1 = new 
AttributeModifier("title", true, new
Model<String>(emp.getLastName()+", "+emp.getFirstName()+" \r\n Title:
"+emp.getPositionTitle()+" \r\n Phone: "+emp.getPhone()+" \r\n Email:
"+emp.getEmailAddress()));
                            AttributeAppender tt = new 
AttributeAppender("class", new
Model<String>("tooltip"), " ");
                                
                                kmlink.add(new Label("kmname", new
PropertyModel<String>(item.getModel(), "name")));
                                kmlink.add(am1);
                                kmlink.add(tt);
                                item.add(kmlink);
                                item.add(editmodal);
                        }
                  };
                  lv.setReuseItems(true);
                  lv.setOutputMarkupId(true);



Thanks

T
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/tooltip-inside-webMarkupContainer-refreshing-tp3036878p3036878.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to