You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by SO...@ameren.com on 2004/10/21 02:45:36 UTC

commandLink in datatable not calling 'action'

The code snippet below is a stripped down section of a data table using a
command link with an action binding.

<h:dataTable id="idPendingTasksTable"
value="#{taskListBean.pendingDeployList}" var="task" >
    <h:column>
        <f:facet name="header">
            <h:outputText value="Task"/>
        </f:facet>
        <h:commandLink action="#{taskListBean.details}" id="idTaskLink"
value="#{task.taskId}">
        </h:commandLink>
    </h:column>
.
.
</h:dataTable>

If the managed bean is request scope, JSF doesn't seem to call the action
method of the managed bean when the link is clicked.   If the bean is
session scope, then the action method gets called.  Is there a way to use a
datagrid with command links that will invoke the action method binding on
click when the managed bean is request scope?  If not and I need to stick
with session scope here, I'll have to manually remove the bean from the
session after I'm done, as the link only needs this bean for the one
request.

I'd be interested in opinions about whether the action method binding
should work in request scope or not.  If it should work , any ideas about
what I may be doing wrong or ways to track down why the invocation is
skipped would be appreciated.  I've turned on debug logs and haven't seen
anything helpful, but that's likely due to my newness to myfaces anyway.

Thanks in advance for any opinions or info...





*******************************
The information contained in this message may be privileged and/or confidential and 
protected from disclosure. If the reader of this message is not the intended recipient, 
or an employee or agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. Note that any views or opinions presented in this 
message are solely those of the author and do not necessarily represent those of Ameren. 
All emails are subject to monitoring and archival. Finally, the recipient should check 
this message and any attachments for the presence of viruses. Ameren accepts no liability 
for any damage caused by any virus transmitted by this email. If you have received this in 
error, please notify the sender immediately by replying to the message and deleting the 
material from any computer. Ameren Corporation 
*******************************


Re: commandLink in datatable not calling 'action'

Posted by Manfred Geiler <ma...@apache.org>.
Problem is, that your bean loses the "pendingDeployList" during 
requests. Try to use the <x:dataTable> and set the "preserveDataModel" 
attribute to "true".
HTH,
Manfred


SOlson@ameren.com wrote:

> The code snippet below is a stripped down section of a data table using a
> command link with an action binding.
> 
> <h:dataTable id="idPendingTasksTable"
> value="#{taskListBean.pendingDeployList}" var="task" >
>     <h:column>
>         <f:facet name="header">
>             <h:outputText value="Task"/>
>         </f:facet>
>         <h:commandLink action="#{taskListBean.details}" id="idTaskLink"
> value="#{task.taskId}">
>         </h:commandLink>
>     </h:column>
> .
> .
> </h:dataTable>
> 
> If the managed bean is request scope, JSF doesn't seem to call the action
> method of the managed bean when the link is clicked.   If the bean is
> session scope, then the action method gets called.  Is there a way to use a
> datagrid with command links that will invoke the action method binding on
> click when the managed bean is request scope?  If not and I need to stick
> with session scope here, I'll have to manually remove the bean from the
> session after I'm done, as the link only needs this bean for the one
> request.
> 
> I'd be interested in opinions about whether the action method binding
> should work in request scope or not.  If it should work , any ideas about
> what I may be doing wrong or ways to track down why the invocation is
> skipped would be appreciated.  I've turned on debug logs and haven't seen
> anything helpful, but that's likely due to my newness to myfaces anyway.
> 
> Thanks in advance for any opinions or info...
> 
> 
> 
> 
> 
> *******************************
> The information contained in this message may be privileged and/or confidential and 
> protected from disclosure. If the reader of this message is not the intended recipient, 
> or an employee or agent responsible for delivering this message to the intended recipient, 
> you are hereby notified that any dissemination, distribution or copying of this 
> communication is strictly prohibited. Note that any views or opinions presented in this 
> message are solely those of the author and do not necessarily represent those of Ameren. 
> All emails are subject to monitoring and archival. Finally, the recipient should check 
> this message and any attachments for the presence of viruses. Ameren accepts no liability 
> for any damage caused by any virus transmitted by this email. If you have received this in 
> error, please notify the sender immediately by replying to the message and deleting the 
> material from any computer. Ameren Corporation 
> *******************************
> 
> 
>