-
1. Re: a4J:function for subview rendered= not working
sanjeevkoppal Sep 27, 2007 2:43 PM (in response to sanjeevkoppal)is there any restriction that the backing beans should be in request scope?
-
2. Re: a4J:function for subview rendered= not working
sergeysmirnov Sep 27, 2007 2:44 PM (in response to sanjeevkoppal)it should not.
Please, understand the very important thing. RichFaces (former Ajax4jsf) framework does not render the whole page and does not replace the whole page (that, probably, the reason you use it).
To do this, two conditions should be satisfied:
1. the component with id you specified for re-rendering should be in the components tree
2. the component should have a representation on the page to be replaced
The first condition is simple. If you have no component in the tree, there is nothing to render. If the component is there, it is rendered and the result is included in the response package.
What happens on the client side when the response package arrives?
RichFaces try to find the component representative on the page and then replace it with new data. If no representative on the page, RichFaces just has no idea where to insert the arrived part and do nothing. (Actually, if you look at the a4j:log, RichFaces scream about this there)
f:subview is a type of component what has no representative on the page. The goal of this component is create a namespace, but it renders nothing.
So, you cannot point to f:subview in any case.
Other issue is about 'rendered' attribute.
What happens in JSF when you have:
<h:panelGrid rendered="false".......
or
<h:panelGrid rendered="#{foo.bar}"...... where foo.bar is false ?
JSF inserts this component is the tree on the server, but render nothing on the page. The situation is the same. After the condition becomes true, RichFaces include it in the response package. However, it cannot show it on the page, because there is no placeholder (representative) there.
Those are couple more words about this:
http://livedemo.exadel.com/richfaces-demo/richfaces/outputPanel.jsf
http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxAttributes.jsf?c=ajaxattributes - about reRendering -
3. Re: a4J:function for subview rendered= not working
sergeysmirnov Sep 27, 2007 2:53 PM (in response to sanjeevkoppal)"sanjeevkoppal" wrote:
is there any restriction that the backing beans should be in request scope?
no -
4. Re: a4J:function for subview rendered= not working
sanjeevkoppal Sep 27, 2007 3:10 PM (in response to sanjeevkoppal)wow! the explanation is great. i understood it to some extent.
Now i already have the required data to be shown on the page and i just wnt to hide and show that data, could you pls suggest me the best wasy of approaching this other than using subviews -
5. Re: a4J:function for subview rendered= not working
sanjeevkoppal Sep 27, 2007 3:13 PM (in response to sanjeevkoppal)The expand and collapse works really great for me,
the only problem i am having is that it takes sometime, as i am sending the request to the server and the response time is too much so wanted to switch to ajax for faster response... -
6. Re: a4J:function for subview rendered= not working
sergeysmirnov Sep 27, 2007 3:22 PM (in response to sanjeevkoppal)do you really need to content to be changed or just hide/show it?
If only hide/show, you can use rich:effect to do it client side. -
7. Re: a4J:function for subview rendered= not working
sanjeevkoppal Sep 27, 2007 4:28 PM (in response to sanjeevkoppal)I donno upto what extent i can use rich:effect
coz though i have the content already on the client i need to dynamically change somethings
if you look into my code, i have a expand and collapse image which changes...
its similar to the one in the examples site where if we click on viewsource source is visible and hide source hides.
but i want to perform both of these actions on one link (expand) -
8. Re: a4J:function for subview rendered= not working
sergeysmirnov Sep 27, 2007 4:50 PM (in response to sanjeevkoppal)examples site uses rich:effect to hide/show the source. No any Ajax there.
I saw your code. I just can say you do not use JSF yet, even you program with JSF. -
9. Re: a4J:function for subview rendered= not working
sanjeevkoppal Sep 27, 2007 5:07 PM (in response to sanjeevkoppal)May be you are true..
I may not be using or utilizing 100% of JSF.
but the appln works great :) except that our QA told it takes lots of time to render or refresh :( -
10. Re: a4J:function for subview rendered= not working
sanjeevkoppal Sep 27, 2007 5:29 PM (in response to sanjeevkoppal)i am not able to use rich:effect either as i have dynamic div or panels with dynamic ids if i try to use this dynamic id it never works, wtz the best way of debugging this.
for example i have 10 rows displayed in click of each row i need to expand that row and display details...