Sorry. I`ll try better.
I have this page:
| <?xml version="1.0" encoding="iso-8859-15"?>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:t="http://myfaces.apache.org/tomahawk"
| xmlns:s="http://jboss.com/products/seam/taglib">
| <body>
| <ui:composition template="templates/layout.xhtml">
| <ui:define name="tabs">
| <div class="tab enabled">
| <div class="tab_l"></div>
| <a
href="categorys.jsf">#{msgs.allCategories}</a>
| <div class="tab_r"></div>
| </div>
| <div class="tabs_separator"></div>
| <div class="tab disabled">
| <div class="tab_l"></div>
| Grupi muutmine
| <div class="tab_r"></div>
| </div>
| <div class="tabs_separator"></div>
| <div class="tab choosed">
| <div class="tab_l"></div>
| Grupi loomine
| <div class="tab_r"></div>
| </div>
| <div class="tabs_separator"></div>
| </ui:define>
|
| <ui:define name="body">
| <h1><span class="heading"></span>ANDMED</h1>
| <div id="andmed">
| <h:form>
| <s:validateAll>
| <span class="errors"><h:message for="name"/></span>
| <h:outputLabel for="name" value="Grupi nimi"/>
| <h:inputText id="name" value="#{category.name}"
styleClass="field"/>
| <div class="separator"></div>
|
| <span class="errors"><h:message for="head"/></span>
| <h:outputLabel for="head" value="Tüvikategooria"/>
| <h:outputText id="head" value="#{category.head.name}"
styleClass="field"/>
| <div class="separator"></div>
|
| <span class="errors"><h:message for="showed"/></span>
| <h:outputLabel for="showed" value="Avalik"/>
| <h:selectOneRadio id="showed"
value="#{category.showed}" styleClass="field">
| <f:selectItem itemValue="true" itemLabel="Jah"/>
| <f:selectItem itemValue="false" itemLabel="Ei"/>
| </h:selectOneRadio>
| <div class="separator"></div>
|
| <s:link view="/haldus/mcategory.xhtml" id="submit"
value="Loo grupp" action="#{cateditor.create}"
| buttonClass="button" linkStyle="button"/>
| </s:validateAll>
|
| <s:link propagation="end" id="submit" value="Loobu"
| view="/haldus/categorys.xhtml"
linkStyle="button" buttonClass="button"/>
| <div class="separator"></div>
| </h:form>
| </div>
| </ui:define>
| </ui:composition>
|
| </body>
| </html>
|
and this bean:
| package ee.digizone.ejb;
|
| import java.io.Serializable;
| import java.util.List;
| import java.util.Map;
| import java.util.TreeMap;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.Conversational;
| import org.jboss.seam.annotations.Create;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.End;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.RequestParameter;
| import org.jboss.seam.annotations.Scope;
|
|
| import ee.digizone.entity.Category;
| import org.jboss.logging.Logger;
|
| @Stateful
| @Name("cateditor")
| @Conversational(ifNotBegunOutcome="categorys")
| public class CategoryEditorBean implements CategoryEditor,Serializable {
|
| @In(create=true,value="digizoneDatabase")
| EntityManager em;
|
| @Out(required=false)
| @In(required=false)
| private Category category;
|
| Logger logger = Logger.getLogger(CategoryEditorBean.class);
|
| @RequestParameter
| int catid;
|
| Map<String,Category> categoryMap;
| List<Category> categories;
|
| @Create
| public void loadData() {
| categories = em.createQuery("from Category c")
| .setHint("org.hibernate.cacheable", true)
| .getResultList();
| Map<String,Category> results = new TreeMap<String,Category>();
|
| for (Category category: categories) {
| results.put(category.getName(),category);
| }
|
| categoryMap = results;
| }
|
| public void create() {
| em.persist(category);
| }
| public void save() {
| em.refresh(category);
| }
| @Begin(join=true)
| public void selectCreate() {
| category = new Category();
| category.setHead(em.find(Category.class,catid));
| }
| @Begin(join=true)
| public void selectModify() {
| category = em.find(Category.class,catid);
| }
|
| @End
| public String delete() {
| category = em.find(Category.class,catid);
| em.remove(category);
| return null;
| }
|
| public Map<String,Category> getCategories() {
| return categoryMap;
| }
| public Category getCategory() {
| return this.category;
| }
|
| @Destroy @Remove
| public void destroy() {}
| }
|
What I wan`t is that when user hits page ccategory.jsf when no conversation is
active ,he would be directed to categorys page. Currently it just gaves me
error: could not set cateditor.catid.
Hope this one is better, I know five languages, but english is not in them...
so be merciful to me.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945284#3945284
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945284
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user