- This topic has 2 replies, 2 voices, and was last updated 19 years, 3 months ago by Robin zou.
-
AuthorPosts
-
Robin zouMemberHi,this is a piece of the jsf code that not rendered properly:
<TABLE align="center" border="1" width="100%"> <TR> <TD> <H2 align="center">Movie Center</H2> </TD> </TR> <TR> <TD align="left"> <h:commandLink value="#{bundle.searchLink}" rendered="true" action="#{MovieCenter.search}" id="searchLink"> </h:commandLink> </TD> </TR> </TABLE> <HR>
And this is the actual html code of the rendered page:
<TABLE align="center" border="1" width="100%"> <TR> <TD> <H2 align="center">Movie Center</H2> </TD> </TR> <TR> <TD align="left"> </TD> </TR> </TABLE> <HR>
I want to use table to put the components in the right place,maybe i should use dataTable JSF tag to show it properly, but why the method above doesn’t work?
Best Regards:)Robin
Riyad KallaMemberRobin,
Command link doesn’t render text, you need to wrap it around the text you want to render in this fashion:<h:commandLink id="NAmerica" action="bookstore" actionListener="#{localeBean.chooseLocaleFromLink}"> <h:outputText value="#{bundle.English}" /> </h:commandLink>
Robin zouMemberThanks,but that doesn’t help.
The two pieces of code:<h:commandLink rendered="true" action="#{MovieCenter.search}" id="searchLink"> <h:outputText value="#{bundle.searchLink}"></h:outputText> </h:commandLink>
And
<h:commandLink value=”#{bundle.searchLink}”
rendered=”true” action=”#{MovieCenter.search}”
id=”searchLink”>
</h:commandLink>Actually brings the same effect.
The problem is that, i want to lay out my components in a specified way. in simple html pages, i could use table to hold the links and pics, and specify the alignment(call this “html effect“)now i write the header file like this to put the header test and command link in a table, but it was not rendered in the right way:<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <TABLE align="center" border="1" width="100%"> <TR> <TD> <H2 align="center">Movie Center</H2> </TD> </TR> <TR> <TD align="left"> <h:commandLink rendered="true" action="#{MovieCenter.search}" id="searchLink"> <h:outputText value="#{bundle.searchLink}"></h:outputText> </h:commandLink> </TD> </TR> </TABLE> <HR>
but the command link is rendered out of the table,just right below the horizental line. so in JSF, maybe i need to get the “html effect” in another way,as the code above finally generates the html code doesn’t work as specified in my original message.
but how?hope i have made it clear:)
Best Regards 😛
Robin -
AuthorPosts