本文介绍了Ajax和JSF 1.1的实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JSF1.1在那,我想更新从一日一与放第二selectOneMenu用于;有这样的code _

I am using JSF1.1 in that, I want to update 2nd selectOneMenu from 1st one & have this code_

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://www.azureworlds.org" prefix="azure"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%>
<%@ taglib uri="http://www.asifqamar.com/jsf/asif" prefix="a"%>

...

<h:outputText value="State* " />
<x:selectOneMenu value="#{hotelBean.state}">
                    <f:selectItem itemLabel="Select One" itemValue="" />
                    <f:selectItem value="#{hotelBean.mapStates }" />
                    <x:ajax update="city" listener="#{hotelBean.handleCityChange}" />

</x:selectOneMenu>

                <h:outputText value="City* " />
                <x:selectOneMenu id="city" value="#{hotelBean.city}">

                    <f:selectItem itemLabel="Select One" itemValue="" />

                    <f:selectItem value="#{hotelBean.mapCities }" />
                </x:selectOneMenu>

行的 X:AJAX更新=城市监听器=#{hotelBean.handleCityChange}的不工作,我搜查,但JSF1.1了对Ajax不支持。

line x:ajax update="city" listener="#{hotelBean.handleCityChange}"is not working , i searched but got JSF1.1 not support for Ajax.

然后我能做些什么这个,我怎么可以使用JavaScript?和我有JS的知识较少。感谢名单

then what can i do for this,how i can use javascript? and i have less knowledge of JS.Thanx

推荐答案

根据该的,没有&LT; T:AJAX&GT; 在所有标记(是的,我知道你重命名 T preFIX到 X 由于某种不明原因,我会继续调用它 T 一致性)。

According to the Tomahawk 1.1 tag documentation, there is no <t:ajax> tag at all (yes, I know that you renamed t prefix to x for some unclear reason, I'll keep calling it t for consistency).

previously,在JSF 1.1时代,人们会使用标签库的Ajax4jsf此这是当时仍然是一个单独的项目提供的。没有其他像样的Ajax库的JSF。我依稀记得一些库中的Dojo的顶部这IBM文章,但它是impopular。后来,JSF 1.2时代的开始时,Ajax4jsf的被收购的JBoss RichFaces的,并包括其子库。从那时起,你不能单独从官方网站下载的Ajax4jsf了,你就必须沿着下载整个RichFaces的组件库。

Previously, during the JSF 1.1 ages, one would have used Ajax4jsf taglib for this which was then still a separate project available at http://ajax4jsf.dev.java.net. There was no other decent Ajax library for JSF. I vaguely recall some library on top of Dojo as ripoff of this IBM article, but it was impopular. Later, during the beginning of the JSF 1.2 era, Ajax4jsf was acquired by JBoss RichFaces and included as its sublibrary. Since then, you can't download Ajax4jsf separately from an official site anymore, you'd have to download the whole RichFaces component library along.

不过,深的地方在Maven的档案,你仍然可以下载原始Ajax4jsf库。在这里,它是:的Ajax4jsf 1.0.6 。原来java.net网站已关闭,所以原来的开发人员指南不再可用两种。然而,谷歌表明,有一个网站,有一个的在线备份(该网站是非常缓慢;一旦下载完成后,我会更快地引用创建一个脱机副本,也为情况下,它不断下降)。另外还有一个 JavaWorld的文章就如何安装和使用它(与MyFaces的组合)。

However, somewhere deep in a Maven archive, you can still download the original Ajax4jsf library. Here it is: Ajax4jsf 1.0.6. The original java.net site is down, so the original developer guide is not available anymore either. However, Google shows that there's a site which has an online backup of the original Ajax4jsf developer guide (the site is very slow; once finished downloading, I'd create an offline copy for faster reference and also for the case it ever goes down). Further there's also a JavaWorld article on how to setup and use it (in combination with MyFaces).

最后,你想用结束了&LT; A4J:载体&gt; 是这样的:

Ultimately, you'd like to end up using <a4j:support> something like as:

<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
...
<h:outputLabel for="state" value="State* " />
<t:selectOneMenu id="state" value="#{hotelBean.state}">
    <f:selectItem itemLabel="Select One" itemValue="" />
    <f:selectItem value="#{hotelBean.mapStates }" />
    <a4j:support event="onchange" actionListener="#{hotelBean.handleCityChange}" reRender="city" />
</t:selectOneMenu>
<h:outputLabel for="city" value="City* " />
<t:selectOneMenu id="city" value="#{hotelBean.city}">
    <f:selectItem itemLabel="Select One" itemValue="" />
    <f:selectItem value="#{hotelBean.mapCities }" />
</t:selectOneMenu>

这篇关于Ajax和JSF 1.1的实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 03:58