• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in rendering html tags in myfaces tiles

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use MyFaces tiles in my project.
when i use a jsp page with jsf components as a tile.
and render whole page html tag in page render separately
for example my template page is something like this:

template.jsp
--------------------------------------
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html;CHARSET=iso-8859-1" />
<title>
<tiles:getAsString name="title" />
</title>
</head>
<f:view>
<body dir="rtl">
<table class="main">
<tr>
<td colspan="2" class="header">
<f:subview id="header">
<tiles:insert attribute="header" flush="false"/>
</f:subview>
</td>
</tr>
<tr>
<td rowspan="3" class="sidemenu">
<f:subview id="sideMenu">
<tiles:insert attribute="sideMenu" flush="false"/>
</f:subview>
</td>
</tr>
<tr>
<td class="body">
<f:subview id="form">
<h:form>
<table class="inputMain">
<tr><td class="inputFormfields">
<tiles:insert attribute="inputFormFields" flush="false" />
</td></tr>
<tr><td class="inputButtoms">
<tiles:insert attribute="inputButtons" flush="false" />
</td></tr>
</table>
</h:form>
</f:subview>
</td>
</tr>
<tr>
<td colspan=2 class="footer">
<f:subview id="footer">
<tiles:insert attribute="footer" flush="false"/>
</f:subview>
</td>
</tr>
</table>
</body>
</f:view>
</html>
-------------------------------------------------------


inputFormFields.jsp
--------------------
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<h utputLabel for="fn" value="FirstName : "/>
<h:inputText id="fn"/><br>

<h utputLabel for="ln" value="LastName : "/>
<h:inputText id="ln"/><br>
------------------------------------------------


inputButtons.jsp
-------------------
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<h:commandButton accesskey="0" id="BtnSave" value="Save"/> 
<h:commandButton accesskey="1" id="BtnCancel" value="Cancel"/> 
<h:commandButton accesskey="2" id="BtnEdit" value="Edit"/> 
<h:commandButton accesskey="3" id="BtnUpdate" value="Update"/> 
<h:commandButton accesskey="4" id="BtnDelete" value="Delete"/> 

--------------------------------------------------------------------


tiles.xml
---------------
<definition name="inputLayout" path="/template/inputTemplate.jsp">
<put name="header" value="/common/header.jsp" />
<put name="footer" value="/common/footer.jsp" />
<put name="sideMenu" value="/common/sideMenu.jsp" />
<put name="inputButtons" value="/common/inputButtons.jsp" />
</definition>

<definition name="/page1.tiles" extends="inputLayout" >
<put name="inputFormFields" value="/page1.jsp" />
<put name="title" value="input" />
</definition>

-----------------------------------------------------------
when http://localhost:8080/wtr/page1.jsf rendered
html tags like(<br> in inputFormFields.jsp and inputFormFields.jsp rendered after jsf components

result is something like this

<form action="....>

<input typ="text" ...>
<input typ="text" ...>
<input typ="text" ...>
<input typ="text" ...>

<br>
<br>
<br>

<input typ="submit" ...>
<input typ="submit" ...>
<input typ="submit" ...>
<input typ="submit" ...>

 
 
 
 
 

</form>

-------------------------------------
i don't have any control on my Form Fields position and designing Form template

Please guide me what can i do.

Regards soli
 
Solmaz Anvar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again.
I think i can't use any html tags in my tiles pages.
instead of these tags i must use jsf tag lib that rendered as html tags like table,..

somthing like
<h anelGrid> or </h anelGroup>

any suggestions?

Regards soli
 
Why is the word "abbreviation" so long? And this ad is so short?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic