【问题标题】:icefaces include argument passingicefaces 包括参数传递
【发布时间】:2011-03-18 15:07:50
【问题描述】:

我有两个 xhtml-s,一个包括另一个。我的问题是参数传递对我不起作用:

<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE HTML>
    <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:ice="http://www.icesoft.com/icefaces/component" >

        <ui:include src="core-classic-layout.xhtml">
            <ui:param name="css-basename" value="core-classic"></ui:param>
            <ui:param name="css-themename" value="blue"></ui:param>
        </ui:include>
    </html>

另外一个core-classic-layout.xhtml是:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML>
<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:ice="http://www.icesoft.com/icefaces/component" >

    <f:view locale="#{system.usedLocale}" >
        <ice:loadBundle
          basename="hu.gap.resources.messages"
          var="msgs"/>

    <head>
        <title>#{msgs['ApplFrmTitle']}</title>

        <ice:outputStyle href="./xmlhttp/css/rime/rime.css" />

        <ice:outputStyle href="./xmlhttp/css/core/#{css-basename}-layout.css" />
        <ice:outputStyle href="./xmlhttp/css/core/#{css-basename}-#{css-themename}.css" />
    </head>

我的问题是,当我导航到包含第二个的第一个 xhtml 时,浏览器会尝试加载 0-layout.css 和 0-0.css 文件。

【问题讨论】:

    标签: java jsf icefaces


    【解决方案1】:

    “-”是算术运算符,所以当你写css-basename它是css minus basename时,它的计算结果为0。调用参数cssBaseName将解决它。

    【讨论】:

      【解决方案2】:

      这将隐式包含包含 core-classic-layout.xhtml 的任何位置的布局。

      <ice:outputStyle href="./xmlhttp/css/core/#{css-basename}-layout.css" />
      <ice:outputStyle href="./xmlhttp/css/core/#{css-basename}-#{css-themename}.css" />
      

      如果您不想加载这些布局,您可以从 core-classic-layout.xhtml 中删除它们。

      【讨论】:

        猜你喜欢
        • 2017-04-01
        • 1970-01-01
        • 2010-11-04
        • 2018-06-07
        • 2012-04-25
        • 2011-06-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多