1 Reply Latest reply on Dec 4, 2008 12:17 PM by Max Rydahl Andersen

    DataModelSelection doesnt work

    Zekeriya Kaya Newbie

      Hi,

      i am trying to select a row of a DataModel List. But get always the first Row.

      could you halp me please?

      a Part of my session Bean:

      @Stateful
      @Name("paxop")
      public class PaxOpBean implements paxOpI {
      
       FbMwOpDatevEinzelbuchung fbEinzelbuchung;
       FbMwOpDatevRechnung fbRechnung;
      
       @DataModel
       private List<Object[]> oposLst;
      
       @DataModelSelection(value="oposLst")
       @Out(required = false, value="datarow")
       private Object[] datarow;
      

      my xhtml Page

      
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a="http://richfaces.org/a4j"
       template="layout/template.xhtml">
      
      
       <ui:define name="head">
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       </ui:define>
      
       <rich:modalPanel id="panel" width="350" height="100">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Details"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:graphicImage value="/images/modal/close.png"
       style="cursor:pointer" id="hidelink" />
       <rich:componentControl for="panel" attachTo="hidelink"
       operation="hide" event="onclick" />
       </h:panelGroup>
       </f:facet>
       <h:outputText
       value="This panel is called using Component Control Component"></h:outputText>
       <br />
       <h:outputText value="#{datarow[1]}"></h:outputText>
       </rich:modalPanel>
      
      
       <ui:define name="body">
      
       <h:messages globalOnly="true" styleClass="message" />
      
       <h:form>
      
       <rich:panel style=" width : 480px;">
      
      
       <s:decorate id="valueDecoration4" template="layout/edit.xhtml">
       <ui:define name="label">PaXSuiteMandant</ui:define>
       <h:selectOneMenu id="Mandant" value="#{paxop.value}">
      
       <f:selectItem itemLabel="PaX AG" itemValue="1000" />
       <f:selectItem itemLabel="PaX Fenster Hermeskeil GmbH"
       itemValue="2000" />
       <f:selectItem itemLabel="PaX Fenster Rositz GmbH" itemValue="3000" />
       <f:selectItem itemLabel="PaX Türen Rositz GmbH" itemValue="3500" />
       <f:selectItem itemLabel="PaX Classic GmbH" itemValue="4000" />
       <f:selectItem itemLabel="PaXoptima GmbH" itemValue="5000" />
       <f:selectItem itemLabel="alle" itemValue="0" />
      
       </h:selectOneMenu>
       </s:decorate>
      
       <s:decorate id="valueDecoration889" template="layout/edit.xhtml">
       <ui:define name="label">Konten</ui:define>
       <h:selectOneMenu id="Mandant" value="#{paxop.auswahlkonten}">
      
       <f:selectItem itemLabel="Zahlungseingang" itemValue="1" />
       <f:selectItem itemLabel="Umsatz" itemValue="2" />
       <f:selectItem itemLabel="Skonto" itemValue="3" />
      
       </h:selectOneMenu>
       </s:decorate>
      
       <s:decorate id="valueDecoration2" template="layout/edit.xhtml">
       <ui:define name="label">Anfangsdatum</ui:define>
       <rich:calendar id="adatum" value="#{paxop.adatum}" required="false"
       datePattern="dd.MM.yyyy" showInput="true" enableManualInput="true">
       <f:convertDateTime timeZone="GMT+1" />
       </rich:calendar>
      
       </s:decorate>
       <s:decorate id="valueDecoration3" template="layout/edit.xhtml">
       <ui:define name="label">Enddatum</ui:define>
       <rich:calendar id="edatum" value="#{paxop.edatum}" required="false"
       datePattern="dd.MM.yyyy" showInput="true" enableManualInput="true">
       <f:convertDateTime timeZone="GMT+1" />
       </rich:calendar>
      
       </s:decorate>
      
       <div style="clear: both" />
      
       </rich:panel>
      
      
      
      
      
      
      
       <div class="actionButtons"><h:commandButton id="auflisten"
       value="auflisten" action="#{paxop.auflisten}" /></div>
      
       <rich:spacer height="30" />
      
      
      
      <rich:modalPanel id="panel" width="350" height="100">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Modal Panel"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:graphicImage value="img/close.png" style="cursor:pointer" id="hidelink"/>
       <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
       </h:panelGroup>
       </f:facet>
       <h:outputText value="Rechnungsnummer: "></h:outputText>
       <br/>
       <h:outputText value="#{datarow[1]}"></h:outputText>
       </rich:modalPanel>
      
      
      
      <rich:dataTable value="#{oposLst}" var="sp" id="datarow"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       style=" width : 480px;" width="480px"
       rendered="#{oposLst.rowCount >= 0}">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column colspan="5">
       <h:outputText value="Kunden" />
       </rich:column>
       <rich:column breakBefore="true">
       <h:outputText value="KundenNr" />
       </rich:column>
       <rich:column>
       <h:outputText value="Kundenname" />
       </rich:column>
       <rich:column>
       <h:outputText value="RechnungsNr" />
       </rich:column>
       <rich:column>
       <h:outputText value="Datum" />
       </rich:column>
       <rich:column>
       <h:outputText value="Betrag" />
       </rich:column>
      
      
      
       </rich:columnGroup>
      
       </f:facet>
       <rich:column filterBy="#{sp[0]}" filterEvent="onkeyup">
       <h:outputText value="#{sp[0]}" />
       </rich:column>
       <rich:column filterBy="#{sp[5]}" filterEvent="onkeyup">
       <h:outputText value="#{sp[5]}" />
       </rich:column>
       <rich:column filterBy="#{sp[1]}" filterEvent="onkeyup">
      
       <h:outputLink value="#" id="link">
       <h:outputText value="#{sp[1]}" />
       <rich:componentControl for="panel" attachTo="link"
       operation="show" event="onclick" />
       </h:outputLink>
      
      
      
       </rich:column>
       <rich:column filterBy="#{sp[7]}" filterEvent="onkeyup">
       <h:outputText value="#{sp[7]}">
       <f:convertDateTime type="date" dateStyle="medium" timeZone="GMT+1" />
       </h:outputText>
       </rich:column>
       <rich:column filterBy="#{sp[6]}" filterEvent="onkeyup" align="right">
       <h:outputText value="#{sp[6]}">
       <f:convertNumber pattern="###,###.##" />
       </h:outputText>
       </rich:column>
      
      
      
       <f:facet name="footer">
       <rich:columnGroup>
       <rich:column></rich:column>
       <rich:column></rich:column>
       <rich:column></rich:column>
       <rich:column></rich:column>
      
      
       <rich:column>
       <h:outputText value="#{paxop.sumze}" align="right">
       <f:convertNumber pattern="###,###.##" />
       </h:outputText>
       </rich:column>
       </rich:columnGroup>
      
       </f:facet>
       </rich:dataTable>
      
       </h:form>
      
       </ui:define>
      
      </ui:composition>
      
      


      thanks!