Search in sources :

Example 1 with AuthorListItemRenderer

use of com.joliciel.jochre.web.DocumentController.AuthorListItemRenderer in project jochre by urieli.

the class UpdateDocumentController method doAfterCompose.

@Override
public void doAfterCompose(Window window) throws Exception {
    super.doAfterCompose(window);
    Session session = Sessions.getCurrent();
    User user = (User) session.getAttribute(LoginController.SESSION_JOCHRE_USER);
    if (user == null)
        Executions.sendRedirect("login.zul");
    DocumentDao documentDao = DocumentDao.getInstance(jochreSession);
    List<Author> authors = documentDao.findAuthors();
    List<Comboitem> authorItems = cmbAuthors.getItems();
    for (Author author : authors) {
        Comboitem item = new Comboitem(author.getFullName());
        item.setValue(author.getId());
        authorItems.add(item);
    }
    lstAuthors.setItemRenderer(new AuthorListItemRenderer());
    winUpdateDocument.addEventListener("onModalOpen", new UpdateDocumentControllerModalListener());
}
Also used : AuthorListItemRenderer(com.joliciel.jochre.web.DocumentController.AuthorListItemRenderer) User(com.joliciel.jochre.security.User) Author(com.joliciel.jochre.doc.Author) Comboitem(org.zkoss.zul.Comboitem) DocumentDao(com.joliciel.jochre.doc.DocumentDao) JochreSession(com.joliciel.jochre.JochreSession) Session(org.zkoss.zk.ui.Session)

Aggregations

JochreSession (com.joliciel.jochre.JochreSession)1 Author (com.joliciel.jochre.doc.Author)1 DocumentDao (com.joliciel.jochre.doc.DocumentDao)1 User (com.joliciel.jochre.security.User)1 AuthorListItemRenderer (com.joliciel.jochre.web.DocumentController.AuthorListItemRenderer)1 Session (org.zkoss.zk.ui.Session)1 Comboitem (org.zkoss.zul.Comboitem)1