You need to sign in to do that
Don't have an account?
sslater
Avoiding Page Refresh on Render
Hi,
I have an VF page with a datatable component. Inside the table, I am using a commandlink to toggle and inputtext field on and off. Something like:
Entry1 link [input]
Entry2 link [input]
etc...
So the commandlink for each row chagnes a boolean in the list object. That boolean is used by the input field to set the rendered component.
The idea is when I click the link, it changes the render boolean and should then render the box. The problem is that when I do this, the entire page reloads. It works correctly, but refreshes the entire page.
In JSF, I can use the "visible" tag and some frameworks do not refresh the entire page on a render change like this.
Is there a smoother way to do this without having the full page refresh? I think I could use a script to set the CSS visible property instead and just hide it until I click the link, but that is somewhat ugly. Anyone have a way to show and hide elements without forcing a full page refresh?
Thanks!
I have an VF page with a datatable component. Inside the table, I am using a commandlink to toggle and inputtext field on and off. Something like:
Entry1 link [input]
Entry2 link [input]
etc...
So the commandlink for each row chagnes a boolean in the list object. That boolean is used by the input field to set the rendered component.
The idea is when I click the link, it changes the render boolean and should then render the box. The problem is that when I do this, the entire page reloads. It works correctly, but refreshes the entire page.
In JSF, I can use the "visible" tag and some frameworks do not refresh the entire page on a render change like this.
Is there a smoother way to do this without having the full page refresh? I think I could use a script to set the CSS visible property instead and just hide it until I click the link, but that is somewhat ugly. Anyone have a way to show and hide elements without forcing a full page refresh?
Thanks!
I have also implemented something like this in one of my projects. As Jill mentioned, if you reRender just the datatable component alone, your problem would be solved.
But there is a small catch in it .. any changes you make on the data table (if the datatable has some inputFields or any editable fields) before the click of the link might be lost when you rerender the entire datatable as the original list that holds your data might be repopulated. I mean you might lose the uncomitted data on the datatable during reRender. Thats why you might want to include some Java Scripting in the picture ...
Thanks
Message Edited by Arun Bala on 12-31-2008 01:58 PM
Message Edited by Arun Bala on 12-31-2008 01:58 PM
There should not be any javascript required to make this work.
<apex:dataTable value="{!list}" var="s" id="tw" >
columns and other stuff...
<apex:outputpanel id="{!s.uniqueid}">
etc...
It gives an error saying it needs a getS method. So I had to just rerender the table itself. It would be convenient to reference each row in the table individually by the controller to set rendered, etc...
Any thoughts on how to do it?