未为myfaces定义的SubmitForm().JSF_JS_MODE“最小现代" [英] submitForm() not defined for myfaces.JSF_JS_MODE 'minimal-modern'

查看:154
本文介绍了未为myfaces定义的SubmitForm().JSF_JS_MODE“最小现代"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I tried to set up a simple JSF 2.2 application using MyFaces 2.2.8. Since MyFaces has some context parameters that I never used before, I tried to get familiar with those.

所以我不得不第一次使用org.apache.myfaces.JSF_JS_MODE并遇到h:commandLink的问题. 如果将模式设置为minimal-modern,则CommandLink尝试调用未定义的myfaces.oam.submitForm(). 如果将模式设置为minimalnormal,它将起作用.

So I got to use org.apache.myfaces.JSF_JS_MODE for the first time and ran into problems with h:commandLink. The commandLink is trying to call myfaces.oam.submitForm() which is not defined if I set the mode to minimal-modern. If I set the mode to minimal or normal it works.

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

From reading some internet articles I assume this is a bug because submitForm is neither part of jsf-legacy.js nor jsf-i18n.js nor jsf-experimental.js and it apparently is needed by h:commandLink. Also the source code comment of org.apache.myfaces.shared.renderkit.html.util.ResourceUtils.markScriptAsRendered(FacesContext, String, String) tells me

oamSubmit脚本包含在jsf.js中

oamSubmit script is included inside 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);
    }
}

我在这里想念什么?预先感谢!

What am I missing here? Thanks in advance!

推荐答案

我可以确认这是一个错误.解决了 MYFACES-4034 中的2.2.10

I can confirm it is a bug. Solved in MYFACES-4034 for 2.2.10

这篇关于未为myfaces定义的SubmitForm().JSF_JS_MODE“最小现代"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆