Hi Simon,

accessing map entries like this is allowed and possible. So the proposed:

#{savingsBean.recentBlogEntries[row]}

should work perfectly. This is the only exception to the
parameter-passing rule in the EL.

regards,

Martin

On 1/3/06, Simon Kitching <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I don't think that the syntax "#{savingsBean.recentBlogEntries[row]}" is
> allowed. EL doesn't support passing parameters to methods, just
> reading/writing *simple* properties.
>
> I presume your #{savingsBean.savingsList} method returns a List.
> You could add a method to your savingsBean that returns a ListDataModel
> instance rather than a List, and specify that in the h:dataTable's
> "value" attribute. You can then write a getRecentBlogEntries method
> which accesses that ListDataModel object to get the current rowData or
> rowIndex properties. These refer to the row currently being rendered at
> the time the getRecentBlogEntries method is invoked.
>
>
> Regards,
>
> Simon
>
> Alexandre Poitras wrote:
> > I can see one quick mistake:
> > #{savingsBean.recentBlogEntries[#{row}]} should be
> > #{savingsBean.recentBlogEntries[row]}
> >
> > On 1/3/06, Marco Mistroni <[EMAIL PROTECTED]> wrote:
> >> hello all,
> >> this code results in an error
> >>
> >> <f:view>
> >>   <h:form id="savingsForm">
> >>      <h:dataTable value="#{savingsBean.savingsList}" var="row" border="1">
> >>        <h:column>
> >>          <h:outputText value="#{row}"/>
> >>        </h:column>
> >>        <h:column>
> >>          <h:inputText value="#{savingsBean.recentBlogEntries[#{row}]}"/>
> >>      </h:column>
> >>     </h:dataTable>
> >>      <h:panelGroup>
> >>    <h:commandButton id="submitInsert" action="#{savingsBean.insert}"
> >> value="Insert"/>
> >>      </h:panelGroup>
> >>   </h:form>
> >> </f:view>
> >>
> >>
> >> at this point
> >>
> >> <h:inputText value="#{savingsBean.recentBlogEntries[#{row}]}"/
> >>
> >> recentBlogEntries is a Map. i tried, for hte sake of trying, to put in a
> >> List (savingsList, the one used for DataTable)all keys
> >> of the Map, and tried to generate inputText for the Map by passing the 
> >> value
> >> of #{row} (which woul dbe the key of the map)
> >>
> >> it didnt work out..... is that impossible or is my syntax wrong somehow?
> >>
> >> thanks and regards
> >>  marco
> >
> >
> > --
> > Alexandre Poitras
> > Québec, Canada
> >
> >
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to