Hi!

I've an application similar to the booking-example.
You can select an item from a list and go to a page to edit this item.

I have a stateful bean, from which the list is populated via @DataModel. I get 
back a @DatamodelSelction, which is a simple Bean, no Seam Component. In my 
JSP, I call an action method in another bean, which requests an EntityBean from 
the Database. I want to outject this row, but always get an     
org.jboss.seam.RequiredException: Out attribute requires value for component: 
walzeedit.walze 

Here is my code: 
Entity Bean: 

  | @Entity
  | @Name("walze")
  | @Table(name="WALZEN"
  | , uniqueConstraints = {  }
  | )
  | 
  | public class Walzen  implements java.io.Serializable {
  | 
  | .
  | .
  | .
  | 

List:

  | @Name("walzenuebersicht")
  | @Stateful
  | @Scope(ScopeType.SESSION)
  | @LoggedIn
  | 
  | public class WalzenUebersichtBean 
  |     implements WalzenUebersicht {
  | 
  |     private String hydronummer = null;
  |     private String gruppe = null;
  | 
  |     @In (create=true) 
  |     private EntityManager walzenDatabase;
  |    
  |     @DataModel
  |     private List<WalzenElement> walzenliste;
  |     
  |     @DataModelSelection 
  |     WalzenElement selectedWalze;
  | 
  |     @Out(scope=ScopeType.CONVERSATION,required=false)
  |     Map<WalzenElement, Boolean> walzenSelection;
  | 
  |     @Factory("walzenliste")
  |     public void zeigeWalzen() {
  |             
  | .
  | .
  |     public WalzenElement getSelectedWalze() {
  |             return selectedWalze;
  |     }
  | .
  | .
  | 
  | 

EditBean:

  | @Name("walzeedit")
  | @Stateful
  | @LoggedIn
  | 
  | public class WalzeEditBean 
  |     implements WalzeEdit{
  | 
  |     @In (create=true) 
  |     private EntityManager walzenDatabase;
  |     
  |     @In 
  |     private WalzenUebersicht walzenuebersicht;
  |     
  |     @Out 
  |     private Walzen walze;
  |     
  | .
  | .
  | .
  | 
  |     
  |     @Begin
  |     public String aendern(){
  |             WalzenElement selectedWalze = 
walzenuebersicht.getSelectedWalze();
  |             walze = (Walzen) walzenDatabase.createQuery("SELECT w FROM 
Walzen w WHERE id = :id")
  |             .setParameter("id", selectedWalze.getId())  
  |                     .getSingleResult();
  |             return "editWalze";
  |     }
  |     
  | 

List JSP:

  | .
  | .
  |                                     <t:dataTable id="walzen" var="aktwalze" 
value="#{walzenliste}"
  |                                             styleClass="listtable" 
headerClass="listtablehead"
  |                                             rowClasses="oddrow,evenrow">
  |                                             <t:column 
styleClass="colCenter" style="width:5%;">
  |                                                     
<h:selectBooleanCheckbox value="#{walzenSelection[aktwalze]}" />
  |                                             </t:column>
  |                                             <t:column 
styleClass="colCenter" style="width:5%;">
  |                                                     <h:commandLink 
id="aendern" value="#{aktwalze.id}"
  |                                                             
action="#{walzeedit.aendern}" />
  |                                             </t:column>
  |                                             <t:column styleClass="colLeft" 
style="width:10%;">
  |                                                     <h:outputLabel 
value="#{aktwalze.hydronummer}" />
  |                                             </t:column>
  | .
  | .
  | 

Edit JSP:

  | .
  | .
  |                             <table>
  |                                     <tr>
  |                                             <td style="width: 
23%;"><h:outputLabel value="Walze : " /></td>
  |                                             <td style="width: 
23%;"><h:outputLabel value="#{editWalze.id}" />
  |                                             </td>
  |                                             <td style="width: 4%;"></td>
  |                                             <td style="width: 24%;"></td>
  |                                             <td style="width: 24%;"></td>
  |                                     </tr>
  |                                     <tr>
  |                                             <td style="width: 
24%;"><h:outputLabel value="Hydronummer" /></td>
  |                                             <td style="width: 
24%;"><h:inputText
  |                                                     
value="#{editWalze.hydronummer}" size="20" maxlength="20"
  |                                                     id="hydroNummer" /></td>
  | .
  | .
  | 


Can anybody help me?

If I set the required-Attribute of the Out-Parameter, the error disappears, but 
I can see the Outjected walze on the debugpage in a conversation-Context.

What am I doing wrong? Can anybody help me? 

Thanks in advance

Stefan

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3954963#3954963

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3954963

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&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to