• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help needed in facelets  RSS feed

 
saravana kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have one sample facelet appln, but i am trying to implement using frames. In the listing jsp i am calling two jsp thru frames but when i access the listing jsp, content of the two jsp's are not getting displayed in the UI, I mean if give anthing outside the frameset, it is getting displayed. Please look at code below and can anybody tell me how to solve this problem....

Please look at the sample code below..
listing.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a="http://www.arc-mind.com/jsf">


<ui:composition template="/WEB-INF/layout/layout.xhtml">
<ui:define name="title">Backend Listing screen</ui:define>
<ui:define name="content">

<h:form>

<frameset rows="33%,*" border="0" frameborder="0">
<frame name="f1" src="/body.xhtml" scrolling="no" noresize="noresize" />
<frame name="f1" src="/footer.xhtml" scrolling="no" noresize="noresize" />
</frameset>
<h:commandLink action="#{CDManagerBean.addNew}">
<f:verbatim>Add CD</f:verbatim>
</h:commandLink>
</h:form>
</ui:define>
</ui:composition>
</html>

body.xhtml page is below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a="http://www.arc-mind.com/jsf">

<h:dataTable id="items" value="#{CDManagerBean.cds}" var="cd"
rowClasses="oddRow, evenRow" headerClass="tableHeader">

<a:column entity="${cd}" fieldName="title" backingBean="${CDManagerBean}"/>
<a:column entity="${cd}" fieldName="artist" backingBean="${CDManagerBean}"/>
<a:column entity="${cd}" fieldName="price" backingBean="${CDManagerBean}"
sort="${false}"/>
<a:columnCommand label="Edit" action="editCD" backingBean="${CDManagerBean}"/>

</h:dataTable>

<br />
<h:commandLink action="#{CDManagerBean.addNew}">
<f:verbatim>Add CD</f:verbatim>
</h:commandLink>
</html>

Regards,
Saravanan
 
a
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I could not really help you with your issue.
But ( ;) ) why do you are using frames? Include your body and footer.xhtml and format it with CSS.

Cu
Alex
 
Tim Holloway
Bartender
Posts: 18775
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can think of only one good reason to use frames if you have Facelets to do tiling - Frames can be independently scrolled.

However, I think the problem here is that ".xhtml" is a facelets tile internal file and frames are HTML constructs that take URLs. So you'd want to define the two frame components as distinct facelets pages. Which could each be independently tiled (or not) as desired.
 
saravana kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
one thing i will tell you, you can achieve resizing the component only using the frames. So only body part i am implementing using frames, rest are all will be displayed from the layout.xhtml itself..

Is it possible to use frames inside the facelets application?

Regards,
Saravanan.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!