【问题标题】:submitForm() not defined for myfaces.JSF_JS_MODE 'minimal-modern'未为 myfaces.JSF_JS_MODE 'minimal-modern' 定义 submitForm()
【发布时间】:2016-03-20 03:27:53
【问题描述】:

我尝试使用 MyFaces 2.2.8 设置一个简单的 JSF 2.2 应用程序。 由于 MyFaces 有一些我以前从未使用过的上下文参数,因此我尝试熟悉这些参数。

所以我第一次使用org.apache.myfaces.JSF_JS_MODE 时遇到了h:commandLink 的问题。 如果我将模式设置为minimal-modern,commandLink 正在尝试调用未定义的myfaces.oam.submitForm()。 如果我将模式设置为 minimalnormal 它可以工作。

通过阅读一些互联网文章,我认为这是一个错误,因为 submitForm 既不是 jsf-legacy.js 的一部分,也不是 jsf-i18n.js 或 jsf-experimental.js 的一部分,h:commandLink 显然需要它。 还有org.apache.myfaces.shared.renderkit.html.util.ResourceUtils.markScriptAsRendered(FacesContext, String, String)的源码注释告诉我

oamSubmit 脚本包含在 jsf.js 中

这里:

public static void markScriptAsRendered(FacesContext facesContext, String libraryName, String resourceName)
{
    getRenderedScriptResources(facesContext).put(
            libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE);
    if (JAVAX_FACES_LIBRARY_NAME.equals(libraryName) &&
        JSF_JS_RESOURCE_NAME.equals(resourceName))
    {
        // If we are calling this method, it is expected myfaces core is being used as runtime and note
        // oamSubmit script is included inside jsf.js, so mark this one too.
        getRenderedScriptResources(facesContext).put(
                MYFACES_LIBRARY_NAME+'/'+MYFACES_JS_RESOURCE_NAME, Boolean.TRUE);
    }
}

我在这里缺少什么?提前致谢!

【问题讨论】:

    标签: jsf jsf-2 jsf-2.2 myfaces commandlink


    【解决方案1】:

    我可以确认这是一个错误。已在 MYFACES-4034 中解决 2.2.10

    【讨论】:

      猜你喜欢
      • 2018-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多