function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nupur ModiNupur Modi 

Rerender an output panel dynamically

I have an apex:repeat. And an output panel inside of the repeat. If the repeater has 10 iterations, this means that I have 10 output panels on the page each with a dynamic id generated at the time when the page was rendered. Now on the click of a button, I want to rerender only 1 out of these 10 panels. Is it possible?

Nupur Modi
AshwaniAshwani
You can use visualforce functon to rerender the panel:

I have done this by example:
<apex:repeat value="{!list}" var="abc">

<apex:outputpanel rendered="{!IF(contains(abc.name, 'Type'), 'table-cell', 'none')}">{!abc.name}</apex:outputpanel>

</apex:repeat>

So according to condition only few output panel will be rendered. You can use other visualforce functions instead.


Nupur ModiNupur Modi
I do not think that this will work.
On the first load, it needs to render all the output panels. Thereafter, we need to rerender any one of the panels on the click of a button. For all the panels, the id will be dynamically generated. So we cannot specify the id in the rerender attribute of the action function.
AshwaniAshwani
To identify one of the panel you need to provide atleast one identifier on behalf of it output panel will render.

There should not be any role of Ids as are always unexprected. Well you can use solution like:

<apex:outputpanel id="options">
  <apex:repeat value="{!list}" var="abc">

     <apex:outputpanel rendered="{!IF(contains(abc.name, 'Type'),true, false)}">{!abc.name}</apex:outputpanel>

  </apex:repeat>
</apex:outputpane>
Avidev9Avidev9
Well wondering why do you want to rerender a specific outputpanel and why not all of them ? or the one above the repeat ?
Nupur ModiNupur Modi
Because rerendering all of them or the one above the repeat is too expensive for me in terms of time. The repeats has atleast 50 output panels and rerendering all of them takes a considerable time to refresh the section.