-
1. Re: How to render <a4j:outputPanel> inside a loop?
ppitonak May 25, 2011 10:38 AM (in response to manakor)Hi Nikita,
yes, you can rerender the row you are on. You can do something like this:
<a4j:repeat value=#{...}" var="...">
<a4j:outputPanel id="panel">
// your code
<a4j:commandButton render="panel"/>
</a4j:outputPanel>
</a4j:repeat>
Regards,
Palo
-
2. Re: How to render <a4j:outputPanel> inside a loop?
manakor May 26, 2011 6:49 AM (in response to ppitonak)Hi Pavol,
Is it possible just with <a4j:commandButton>?
Or I could use <a4j:commandLink> instead?
And how about <a4j:jsFunction> inside every loop, is it going to work:
<a4j:repeat value=#{...}" var="...">
<a4j:outputPanel id="panel">
// your code
<h:commandLink onclick="renderFunction('param')" value="Click" />
<a4j:jsFunction name="renderFunction" render="panel" actionListener="#{}" oncomplete="doSmth();">
<f:param name="myParam" />
</a4j:jsFunction>
</a4j:outputPanel>
</a4j:repeat>
-
3. Re: How to render <a4j:outputPanel> inside a loop?
ppitonak May 26, 2011 7:12 AM (in response to manakor)1 of 1 people found this helpfulHi,
yes, it should work with a4j:commandLink as well. If it doesn't work, it's a bug.
-
4. Re: How to render <a4j:outputPanel> inside a loop?
manakor May 30, 2011 4:54 AM (in response to ppitonak)Have made tests on rendering of needed <a4j:outputPanel> from <aj4:jsFunction>, which is located inside the current loop, but it renders just the outputPanel of the last row of the loop, however I need this one, which is in the same row as the link clicked.
This is my code:
<a4j:repeat value=#{...}" var="...">
<a4j:jsFunction name="renderFunction" render="panel" actionListener="#{}" oncomplete="alert('Done');">
<f:param name="myParam" />
</a4j:jsFunction>
<h:commandLink onclick="renderFunction('param')" value="Click" />
<a4j:outputPanel id="panel">
// your code
</a4j:outputPanel>
</a4j:repeat>
I am using <a4j:jsFunction> just because I have to pass parameters into actionListener of this function. If I could avoid those params, I would use <a4j:commandLink> istead, but I need them. Maybe there's an alternative way how to pass params into <a4j:commandLink> actionListener?
-
5. Re: How to render <a4j:outputPanel> inside a loop?
snaker May 30, 2011 6:56 AM (in response to manakor)try out jsFunction outside a4j:repeat
-
6. Re: How to render <a4j:outputPanel> inside a loop?
manakor May 30, 2011 7:59 AM (in response to snaker)Kike, I can not, because I need to render <a4j:outputPanel>, which is located in this particular row of the <a4j:repeat> loop.
However, I found a solution assigning parameters to actionListener of <a4j:commandLink>:
<a4j:repeat value=#{...}" var="...">
<a4j:commandLink actionListener="#{}" render="panel" oncomplete="alert('Done');" value="Click">
<f:param name="paramName" value="paramValue" />
</a4j:commandLink>
<a4j:outputPanel id="panel">
// your code
</a4j:outputPanel>
</a4j:repeat>
And this is working for me perfectly - exactly as I was in need!