added link to details dialog for manage keyword panels

This commit is contained in:
Emil Siverhall 2012-02-27 16:02:02 +01:00
parent 882b7849d2
commit b79ac663ec
2 changed files with 26 additions and 3 deletions
src/main/java/se/su/dsv/scipro/admin/panels/match

@ -17,7 +17,7 @@
</thead> </thead>
<tbody> <tbody>
<tr wicket:id="keywordsDataView"> <tr wicket:id="keywordsDataView">
<td wicket:id="name"></td> <td><a href="#" wicket:id="detailsLink"><span wicket:id="name"></span></a></td>
<td wicket:id="type"></td> <td wicket:id="type"></td>
<td><a href="#" wicket:id="activeLink"> <td><a href="#" wicket:id="activeLink">
<img wicket:id="activeIcon" /></a></td> <img wicket:id="activeIcon" /></a></td>

@ -1,5 +1,7 @@
package se.su.dsv.scipro.admin.panels.match; package se.su.dsv.scipro.admin.panels.match;
import java.util.List;
import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.WebMarkupContainer;
@ -15,8 +17,10 @@ import org.apache.wicket.spring.injection.annot.SpringBean;
import org.odlabs.wiquery.ui.dialog.Dialog; import org.odlabs.wiquery.ui.dialog.Dialog;
import se.su.dsv.scipro.components.LazyDeleteAjaxLink; import se.su.dsv.scipro.components.LazyDeleteAjaxLink;
import se.su.dsv.scipro.data.dataobjects.Employee;
import se.su.dsv.scipro.icons.ImageObject; import se.su.dsv.scipro.icons.ImageObject;
import se.su.dsv.scipro.match.dao.interfaces.KeywordDao; import se.su.dsv.scipro.match.dao.interfaces.KeywordDao;
import se.su.dsv.scipro.match.dao.interfaces.SupervisorDao;
import se.su.dsv.scipro.match.dataobject.Keyword; import se.su.dsv.scipro.match.dataobject.Keyword;
import se.su.dsv.scipro.match.dataobject.KeywordType; import se.su.dsv.scipro.match.dataobject.KeywordType;
import se.su.dsv.scipro.match.dataprovider.KeywordsDataProvider; import se.su.dsv.scipro.match.dataprovider.KeywordsDataProvider;
@ -27,6 +31,8 @@ public class ManageKeywordPanel extends Panel {
@SpringBean @SpringBean
private KeywordDao keywordDao; private KeywordDao keywordDao;
@SpringBean
private SupervisorDao supervisorDao;
private KeywordsDataProvider keywordsDataProvider; private KeywordsDataProvider keywordsDataProvider;
@ -70,7 +76,7 @@ public class ManageKeywordPanel extends Panel {
@Override @Override
protected void populateItem(final Item<Keyword> item) { protected void populateItem(final Item<Keyword> item) {
item.setOutputMarkupId(true); item.setOutputMarkupId(true);
Keyword keyword = item.getModelObject(); final Keyword keyword = item.getModelObject();
final ImageObject editIcon = new ImageObject("editIcon", ImageObject.SIXTEEN + ImageObject.EDIT); final ImageObject editIcon = new ImageObject("editIcon", ImageObject.SIXTEEN + ImageObject.EDIT);
@ -110,7 +116,24 @@ public class ManageKeywordPanel extends Panel {
} }
}; };
item.add(new Label("name", new Model<String>(keyword.getKeyword()))); final AjaxLink<Void> keywordDetailsLink = new AjaxLink<Void>("detailsLink") {
private static final long serialVersionUID = 1340379052190115333L;
@Override
public void onClick(AjaxRequestTarget target) {
target.addComponent(dialog);
dialog.setWidth(400);
dialog.setHeight(580);
dialog.setTitle(keyword.getKeyword());
dialog.replace(new KeywordDetailsPanel("dialogContent", keyword));
dialog.open(target);
}
};
keywordDetailsLink.add(new Label("name", new Model<String>(keyword.getKeyword())));
item.add(keywordDetailsLink);
//item.add(new Label("name", new Model<String>(keyword.getKeyword())));
item.add(new Label("type", new Model<String>(keyword.getType().getName()))); item.add(new Label("type", new Model<String>(keyword.getType().getName())));
item.add(editLink); item.add(editLink);
item.add(activeLink); item.add(activeLink);