myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: datatable and htmlcommandlink?
Date Sun, 17 Sep 2006 23:43:07 GMT
Yes to both of you.   All you need to do is update your backing data
model in the action -- pretty convenient :-)

Ie, if you have something like

<h:dataTable value="#{sharkEngine.acceptedAssignments}"
<h:commandLink action="#{sharkEngine.action.showActivity}"

then in #{sharkEngine.action.showActivity} you change the value of
sharkEngine.acceptedAssignments to be the updated list.


On 9/16/06, delbd <delbd@oma.be> wrote:
> So then my problem is how to have the datatable contains old datas
> before action and new datas after action...

On 9/16/06, Mr Arvind Pandey <arvindspandey@yahoo.co.in> wrote:
>     u r right. u can use preserveDataModel="true" in
> datatable. if it is true then action method surely be
> invoked. But the problem is if u want to delete the
> row from table and afetr deletion you want to display
> the same page then row will be deleted from DB but
> page will contain that row. I am looking for the soln.

> Mike Kienenberger a écrit :
> > h:dataTable value="#{sharkEngine.acceptedAssignments}" must remain
> > constant  from renderResponse of the first request through
> > invokeAction of the second request.
> >
> > I handle this by using <t:saveState
> > value="#{sharkEngine.acceptedAssignments}">
> >
> >
> >
> > On 9/15/06, David Delbecq <delbd@oma.be> wrote:
> >> Hello,
> >>
> >> I have a datatable that iterate over some database values. Those values
> >> are subject to change, especially in quantity. The datatable is rendered
> >> like this:
> >>     <h:dataTable value="#{sharkEngine.acceptedAssignments}"
> >> var="theAssignment">
> >>         <h:column>
> >>             <h:commandLink immediate="true"
> >> value="#{theAssignment.activity.name}"
> >> action="#{sharkEngine.action.showActivity}"
> >> actionListener="#{sharkEngine.action.commandListener}">
> >>                 <f:param name="activityToShow"
> >> value="#{theAssignment.activity.key}"  />
> >>             </h:commandLink>
> >>         </h:column>
> >>     </h:dataTable>
> >>
> >> This basically renders a list of links that need to contain one
> >> information: "activityToShow". Technically,
> >> #{sharkEngine.action.showActivity} will need nothing more to setup
> >> session and show the edition form. However, between display of table and
> >> click by user, the database list referenced by datatable is subject to
> >> change  (because whatever happens, we must reflect db changes to user).
> >>
> >> Here is the problem:
> >> If 3 items are showned to user (let's say a,b,c), the user clicks on the
> >> last one (c) but by that time the entry a has been removed from
> >> database, the action does not take place?!?
> >>  I suspect this is because the 3rd line of datatable has been removed,
> >> but how do i handle this. The user won't accept that nothing happens
> >> while he clicks on an entry, obviously. JSF is silent on why it did not
> >> execute the action and <h:messages/> shows nothing too.
> >>
> >> What is the good way to create such list of links?
> >>
>
>

Mime
View raw message