webtier@glassfish.java.net

Re: [webtier] JSF 2.0: re-render a dataTable with Ajax ?

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Wed, 13 Jan 2010 11:25:38 -0800

Out of curiosity, you do have the project stage set to development,
right? And does it give an error when it's not updating the form? Or
does it fail silently?

Jim

On 1/13/10 10:51 AM, Celinio Fernandes wrote:
> Well, I tried "Form1" (without the colon), "Form1:dataTable1" before and
> it did not work.
>
> --- On *Thu, 1/14/10, Jason Lee /<jasondlee_at_sun.com>/* wrote:
>
>
> From: Jason Lee <jasondlee_at_sun.com>
> Subject: Re: [webtier] JSF 2.0: re-render a dataTable with Ajax ?
> To: webtier_at_glassfish.dev.java.net
> Date: Thursday, January 14, 2010, 12:49 AM
>
> You specified render=":Form1:dataTable1". I think the leading : in
> the component ID was confusing things.
>
> On 1/13/10 12:47 PM, Celinio Fernandes wrote:
>> I got it working with this :
>> <f:ajax execute="@this" render="@form" />
>>
>> Before that, I tried with the value of the render attribute set to
>> the id of the form and it did not work. How come ?
>>
>>
>> --- On *Thu, 1/14/10, Celinio Fernandes /<papouasied_at_yahoo.com>/*
>> wrote:
>>
>>
>> From: Celinio Fernandes <papouasied_at_yahoo.com>
>> Subject: Re: [webtier] JSF 2.0: re-render a dataTable with Ajax ?
>> To: webtier_at_glassfish.dev.java.net
>> Date: Thursday, January 14, 2010, 12:33 AM
>>
>> Thanks for helping.
>> I understand that i need to reload the form or the page.
>> But i thought the tag <f:ajax> would take care of it.
>>
>> How do you reload the form/page in that case ?
>>
>> --- On *Thu, 1/14/10, Lincoln Baxter, III
>> /<lincolnbaxter_at_gmail.com>/* wrote:
>>
>>
>> From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
>> Subject: Re: [webtier] JSF 2.0: re-render a dataTable with
>> Ajax ?
>> To: webtier_at_glassfish.dev.java.net
>> Date: Thursday, January 14, 2010, 12:18 AM
>>
>> Or reload the entire page/data structure.
>>
>> Lincoln Baxter III
>> http://ocpsoft.com
>> http://scrumshark.com
>> Keep it simple.
>>
>>> On Jan 13, 2010 1:10 PM, "Celinio Fernandes"
>>> <papouasied_at_yahoo.com> wrote:
>>>
>>> Hi,
>>> I found several posts dealing with my problem :
>>> http://forums.java.net/jive/thread.jspa?messageID=332548
>>> http://forums.java.net/jive/thread.jspa?messageID=373960
>>>
>>> None gives answers unfortunately.
>>>
>>> My problem is simple : I have a dataTable which contains
>>> a list of products, the last column has a link to delete
>>> a product.
>>>
>>> <h:form id="Form1">
>>>
>>> <h:dataTable value="#{myBean.myList}" id="dataTable1" ...>
>>> <h:column>
>>> ...
>>> </h:column>
>>> ...
>>> <h:column>
>>> <h:commandLink value="update" action="#{myBean.delete}" >
>>> <f:ajax execute="@this" render=":Form1:dataTable1" />
>>> <f:param name="id" value="#{product.productid}"/>
>>> </h:commandLink>
>>> </h:column>
>>> </h:dataTable>
>>>
>>> </h:form>
>>>
>>> My delete method looks like this :
>>> public void delete() {
>>> FacesContext context = FacesContext.getCurrentInstance();
>>> Map<String, String> params =
>>> context.getExternalContext().getRequestParameterMap();
>>> String idNumber = params.get("id");
>>> myEJB.delProduct(idNumber);
>>> }
>>>
>>>
>>> It deletes the product. However it does not re-render the
>>> dataTable. What am i missing ?
>>> What value should the render attribute be set to in that
>>> case ?
>>>
>>> Thanks in advance for helping.
>>>
>>>
>>
>>
>
>
> --
> Jason Lee
> Senior Java Developer
> GlassFish Administration Console
>
> Sun Microsystems, Inc.
> Phone x31197/+1 405-343-1964
> Emailjasondlee_at_sun.com
> Bloghttp://blogs.sun.com/jasondlee
> Bloghttp://blogs.steeplesoft.com
>
>