Dynamic creation of a4j:include in Java code

View: New views
1 Messages — Rating Filter:   Alert me  

Dynamic creation of a4j:include in Java code

by Dennis Ryan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to create an a4j:include in Java Code in my backing bean. If I view the page with the a4j:include tag in it, it works fine so I know the path to the include .xhtml is correct. I then take out the tag and replace it with a faces component with the following binding: #{ testBean.buildInclude}
It gets to the code below fine, but the .xhtml file is never included in the page.

Here is what I have so far:

public UIComponent getBuildInclude() {
            
   //create a4j include
   Include includeTab = new Include();
   String id = "_"+String.valueOf(generateId());
   includeTab.setId (id);
   includeTab.setViewId("inc/test.xhtml");
   includeTab.setLayout("inline");
        
   return includeTab;
}

Anyone have an example of this working, or see any issues?

Thanks,
Dennis
LightInTheBox - Buy quality products at wholesale price!