voyent
Icefaces facelets dynamic content include exception  XML
Forum Index -> General Help Go to Page: Previous  1, 2
Author Message
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


I did some dirty work-around for pages to appear in the tabs. But, still I have some questions about this dynamic include.

Code:
<ui:fragment rendered="${tab.node.page == 'node1'}">
 		<ui:include src="${tab.node.page}.jspx"/>
 </ui:fragment>
 


The above code for <ui:fragment> returns true, but <ui:include> gets the
".jspx", basically it is getting empty string value for that variable. When I print it out using outputText, it prints the right page name. I don't understand this :-((

so, I made it like this:
Code:
<ui:fragment rendered="${tab.node.page == 'node1'}">
 		<ui:include src="node1.jspx"/>
 </ui:fragment>
 


I hate to hard-code the names.
cchhun

Joined: 05/Jan/2007 00:00:00
Messages: 56
Offline


Hi, I'm facing the same problem than everybody here...
I tried everything I found in forums...

But it still don"t work...
If anyone has a solution....^^

anilthomson

Joined: 10/Oct/2007 00:00:00
Messages: 1
Offline


There is a twisty work around for this.

Code:
<ice:panelTabSet id="tab" selectedIndex="# protoTypeBean.selectedIndex}" tabPlacement="top"	value="#{protoTypeBean.dynaTabSet}" var="tab">		<ice:panelTab label="#{tab.label}" title="#{tab.label}"><ui:include src="#protoTypeBean.tabFilePath}"></ui:include>
 				</ice:panelTab>
 
 				</ice:panelTabSet>
===============================================

public class ProtoTypeBean
{
List<Tab> dynaTabSet= new ArrayList<Tab>();;

int selectedIndex;
public int getSelectedIndex() {
return selectedIndex;
}
public void setSelectedIndex(int selectedIndex) {
this.selectedIndex = selectedIndex;
}
public List<Tab> getDynaTabSet() {
return dynaTabSet;
}

public void setDynaTabSet(List<Tab> dynaTabSet) {
this.dynaTabSet = dynaTabSet;
}

public String getTabFilePath() {
if (getDynaTabSet().size() > 0)
return this.getDynaTabSet().get(getSelectedIndex()).getFilePath(); // the filePath property of the Tab object has the path of the file to be included
else
return "/pages/err/authError.jspx";<br>/*else must return a path to a file relative to the context root.I assume this wont be included while building the component tree. If else return null ,you will get Stackoverflow error .If else retun a file which is not available,you will get FilenotFound exception.*/ }
}
ambeth

Joined: 21/Feb/2008 00:00:00
Messages: 7
Offline


I am having the same problem as the OP, and have tried all the solutions suggested in this thread to no avail.

I did notice this popping up in the logs though about 20 times before attempting to render the tab:

2008-07-21 17:25:24,326 DEBUG [com.sun.faces.application.ApplicationImpl] - <Couldn't find a factory for currentTab>

(using icefaces 1.7.1 and Sun JSF RI 1.1 + Tomcat 5.5)
cluder

Joined: 30/Mar/2007 00:00:00
Messages: 49
Offline


edit: sorry wrong thread.
cluder

Joined: 30/Mar/2007 00:00:00
Messages: 49
Offline


i had the overflow error when i used something like that: Code:
<ui:include src="#{menu.content}"/>  
 

Make sure that the string returned by menu.content is never null nor empty, init with "" will not work.

Code:
class MenuBean {
   private String content="default.jsp";
 }
ryan.kimber

Joined: 21/Mar/2007 00:00:00
Messages: 17
Offline


Balavenky,

Did you ever get this issue resolved? If so, how?

I have the same problem occurring when I have nested <ui:include> tags
(that is an included page has another <ui:include> tag)

Thanks.
rcollins

Joined: 29/Apr/2009 00:00:00
Messages: 17
Offline


I have been following this thread and there has been some progress on my end but here is what is happening with the solution that I am getting. My code looks like this

Code:
 <ui:composition template="/templates/MainTemplate.jspx">
 			<ui:define name="maincontent">	       		
        			<br clear="all" />       			
 		     	<ice:panelTabSet var="currentTab" value="#{homePage.tabs}" tabPlacement="top">
 		         	<ice:panelTab label="#{currentTab.name}">
 		         		<ui:fragment rendered="${currentTab.content == '/home/Test.jspx'}">
                         	<ui:include src="/home/Test.jspx" /> 
                         </ui:fragment>
                         <ui:fragment rendered="${currentTab.content == '/home/Test2.jspx'}">
                         	<ui:include src="/home/Test2.jspx" /> </ui:fragment>                                              				           		           	</ice:panelTab>	        				
 		       	</ice:panelTabSet>	       		 
 	       	</ui:define>                       
          </ui:composition>  
 


What ends up happening is that it will render the frist one correctly, but the second one will be the same as the first one. It is basically evaluating the first fragment rendering and then setting it for both tabs. How do I get around this?
rcollins

Joined: 29/Apr/2009 00:00:00
Messages: 17
Offline


Please disregard my previous post. This I had a user error that caused the application not to work. The code that I am displaying is working.
jpedro

Joined: 02/Nov/2008 00:00:00
Messages: 39
Offline


I Have the same problem!!!.

This bug is not fixed, yet?

I need Help!

Pedro Antonio Hidalgo Guzmán
from Dominican Republic
[Email]
rcollins

Joined: 29/Apr/2009 00:00:00
Messages: 17
Offline


The thing that helped me was by putting the initialization of the tree in the constructor of the backing bean.
jpedro

Joined: 02/Nov/2008 00:00:00
Messages: 39
Offline


The problem was that I had installed two versions of netbeans and it was provoking the problem with the include of facelets.

I uninstalled the two versions of netbeans and I reinstalled only one netbeans and everything was solved.

Pedro Antonio Hidalgo Guzmán
from Dominican Republic
[Email]
 
Forum Index -> General Help Go to Page: Previous  1, 2
Go to:   
Powered by JForum 2.1.7ice © JForum Team