You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Benjamin Bratkus <br...@oio.de> on 2006/03/30 08:36:51 UTC

values of my managed beans

hello users,

i've got a problem with filling my managed beans. i've created a 
formular which contains a dataList with a nested grid and datatable. so 
its a "complex" formular imo. the default values for the fields are read 
correctly out of the database and the other values are correct displayed 
with their defaults. when i take some changes using the form this 
changes are discarded, means they arent in the propertys. i've added you 
a snippet of my jsp

best regards,


ben

<f:view>
<h:form id="createTravelsForm">
    <t:dataList id="travelslist" value="#{Traveller.travelModel}" 
var="Travel" first="#{Traveller.travelTable.firstRowIndex}" 
rows="#{Traveller.travelTable.noOfRows}">
        <h:panelGrid columns="6" styleClass="rka">
            <f:facet name="header">
                <h:outputText value="Reise #{Travel.travelNr}" />
            </f:facet>           
            <h:outputText value="Abfahrtsort" />
            <h:outputText value="Abfahrtsdatum" />
            <h:outputText value="Abfahrtszeit" />           
            <h:outputText value="Rückkehr Datum" />           
            <h:outputText value="Rückkehr Uhrzeit" />       
            <h:commandButton value="copy" 
action="#{Traveller.copyTravel}" immediate="true"/>
            <h:inputText id="startPlace" value="#{Travel.departure}" 
required="true"  />
            <h:inputText id="dateOfStart" value="#{Travel.dateOfStart}" 
required="true" size="10" />
            <h:inputText id="timeOfStart" value="#{Travel.timeOfStart}" 
required="true" size="5" />
            <h:inputText id="dateOfEnd" value="#{Travel.dateOfEnd}" 
required="true" size="10" />
            <h:inputText id="timeOfEnd" value="#{Travel.timeOfEnd}" 
required="true" size="5" />
            <h:commandButton value="delete" 
action="#{Traveller.deleteTravel}" />
            <f:facet name="footer">
                <h:panelGroup>
                    <h:dataTable id="hopsTable" 
value="#{Travel.hopsModel}" var="Hop" 
first="#{Travel.hopsTable.firstRowIndex}" 
rows="#{Travel.hopsTable.noOfRows}" styleClass="rka" 
rowClasses="firstRow, secondRow">
                        <f:facet name="header">
                            <h:outputText value="Etappe(n)" />
                        </f:facet>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Vorgangsnummer" />
                            </f:facet>
                            <h:inputText value="#{Hop.instanceNr}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Zielort"/>
                            </f:facet>
                            <h:inputText value="#{Hop.destination}" 
required="true"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Kunde" />
                            </f:facet>
                            <h:inputText value="#{Hop.customer}" 
required="true"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Distanz in km" />
                            </f:facet>
                            <h:inputText value="#{Hop.distance}" 
required="true"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Kollegen an Bord" />
                            </f:facet>
                            <h:inputText value="#{Hop.coWorker}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Aufwendungen extra" />
                            </f:facet>
                            <h:inputText value="#{Hop.expenditures}" />
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>               
            </f:facet>
        </h:panelGrid>
    </t:dataList>
</h:form>
</f:view>

Re: values of my managed beans

Posted by Mike Kienenberger <mk...@gmail.com>.
On 3/30/06, Benjamin Bratkus <br...@oio.de> wrote:
> so is it actually possible to use inputfield within a datalist or not ?
> because my datatable and some fields within grid are nested in a datalist

I'm fairly certain that this is fixed in the latest nightlies.   Give
it a try and see.   If not, open a JIRA issue and provide the
simplest-possible example demonstrating the problem.

Thanks!

Re: values of my managed beans

Posted by Benjamin Bratkus <br...@oio.de>.
after browsing your mail archives, i've found the following post

"Well, in ancient times dataTable did not work for inputComponents
either, so the code has been added to dataTable, but for dataList
nobody ever complained ;)

thanks for the patch,

regards,

Martin

On 5/4/05, mathias.werlitz@daimlerchrysler.com
<ma...@daimlerchrysler.com> wrote:
>  
> Yes it does, but it does not use <h:column> sub components to wrap the
> nested components and the dataTable implementation assumes this. 
> Therefor the dataTable component overwrites the processDecodes() method
> correctly. This is also were I got the code from. 
>  
> I guess the other methods were simply forgotten. 
>  
> After adding the code to the component it does work correctly for me. 
>"

so is it actually possible to use inputfield within a datalist or not ? 
because my datatable and some fields within grid are nested in a datalist

best regards,
ben