开发者

Cufon font isn't applied for link generated with JSF EL expression when use message bundling

开发者 https://www.devze.com 2023-02-06 15:38 出处:网络
I\'m trying to use Cufon js lib. to display specific font on web page. jQuery is used also. <script language=\"javascript\" src=\"resources/js/cufon-yui.js\"/>

I'm trying to use Cufon js lib. to display specific font on web page.

jQuery is used also.

<script language="javascript" src="resources/js/cufon-yui.js"/>
<script language="javascript" src="resources/js/Salaryman_400.font.js"/>
<script type="text/javascript">
    Cufon.replace('.menu-text');
</script>

if link text obtained with EL #{m.decoys},which mean that it's value got from properties file in order to support i18n,that it doesn't work:

<h:outputLink value="#{request.contextPath}/decoys.jsf" class="menu-text">
   <f:verbatim>#{m.decoys}</f:verbatim>
</h:outputLink>

after this text within <a> wasn't displayed at all.

here is i18n setting in faces-config,they work without Cufon:

<applicatio开发者_如何学运维n>
        <resource-bundle>
            <base-name>msg_ru</base-name>
            <var>m</var>
        </resource-bundle>
</application> 

if link text is obtained with other EL, eg. #{request.contextPath} ,that it's OK:

<h:outputLink value="#{request.contextPath}/decoys.jsf" class="menu-text">
   <f:verbatim>#{request.contextPath}</f:verbatim>
</h:outputLink>


There's no such attribute "class" for h:outputLink. You should use "styleClass":

<h:outputLink value="#{request.contextPath}/decoys.jsf" styleClass="menu-text" id="cufId">
0

精彩评论

暂无评论...
验证码 换一张
取 消