JSF 2.0 Ajax Support

I am trying to solve this problem for days but couldn't find a proper solution. People suggested to use Ajax but I couldn't implement it. I have a jspf page in which I am using facelets. I have a form with input values and a button. When user clicks on the button I want to check the validation and give user a feedback.
<?xml version="1.0" encoding="UTF-8"?>
<div class="rave-layout" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<f:subview id="webfilteroverview">
<webuijsf:form id="form1">
<tr>
<td>
<webuijsf:label for="textField1" text="#{msg.reports_request_name}"/>
</td>
<td colspan="2">
<webuijsf:textField binding="#{report.reportNameField}" columns="26" id="textField1" required="true"
style="margin-left:10px;" styleClass="textfield"/>
</td>
</tr>
<h:commandButton value="push" action="#{report.submitReportRequest}">
<f:ajax execute="@form1" render="@form1"/>
</h:commandButton>
report.java:
public void submitReportRequest() {
if(reportNameField!=null){  
submitted=true;
but it is giving:
PWC6143: No tag "ajax" defined in tag library associated with uri "http://java.sun.com/jsf/core"
error. However I am using JSF 2.0 and as far as I know JSF 2.0 has Ajax support included. What am I doing wrong?

lamostreta wrote:
People suggested to use Ajax but I couldn't implement it. Are you trying to use that as an argument for something?
I have a jspf page in which I am using facelets.Facelets replaces JSP technology, so you do NOT have a 'jspf' page. Know what and understand what you are using and communicate that clearly or you'll only cause confusion.
but it is giving:
PWC6143: No tag "ajax" defined in tag library associated with uri "http://java.sun.com/jsf/core"
error. However I am using JSF 2.0 and as far as I know JSF 2.0 has Ajax support included. What am I doing wrong?I believe that you think you are using JSF 2.0, but this error right here seems to hint that you are mistaken. Are you sure you don't have both JSF 1.2 and JSF 2.0 floating around on the classpath?

Similar Messages

  • What is the best way to add AJAX support in an existing JSF application?

    I've done some research and I found several options listed below:
    1.Use JSF AJAX components like JBOSS RichFaces
    2. Use Client JavaScript Library like DOJO
    3. Use JavaScript directly
    My question is what is the best way to do that?
    And for approach 2, is it possible to mingle DOJO and JSF ?
    Thanks a million for your answers.

    If you can't wait for JSF 2 GA or don't want to use beta, look at project Dynamic Faces. It looks like JSF 2 AJAX support was based on the Dynamic Faces project, so it should be easy to switch from DynaFaces to JSF 2.

  • Adding AJAX support for dynamically created panelGrid components

    Hi everyone!
    I would like to ask help from anyone who may have encountered similar problem before...
    I have a panelGrid whose component is dynamically created by the backing bean. Here is my JSF code:
    <h:panelGrid styleClass="panelGrid"
              rowClasses="tsPanelGridRowClass" columns="8" cellpadding="0"
              cellspacing="2" bgcolor="transparent" style="margin-left: 10px"
              id="revCenterItemPanelGrid"
              binding="#{pc_Touchscreen_pull_select_item.revCenterItemPanelGrid}">
    </h:panelGrid>And here is the code for backing bean that adds content inside the panelGrid:
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("1");
    index.setValue(String.valueOf(1));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);On click of a button...
    <a4j:commandButton value="Update"
              styleClass="commandExButtonPou2" id="button1" reRender="revCenterItemPanelGrid"
              actionListener="#{pc_Touchscreen_pull_select_item.doSortActionListener2}">
              <f:attribute name="order" value="2"></f:attribute>
              <f:attribute name="toggleState" value="off"></f:attribute>
    </a4j:commandButton>the backing bean is supposed to update the value of the outputText
    doSortActionListener2() {
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("2");
    index.setValue(String.valueOf(2));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);
    }However, update doesn't seem to work. I have been successful in adding ajax support to a panelGrid that is not dynamically created but not for this one.
    Has anyone encountered this error before? Any ideas?
    Thanks in advance!

    Hi everyone!
    I would like to ask help from anyone who may have encountered similar problem before...
    I have a panelGrid whose component is dynamically created by the backing bean. Here is my JSF code:
    <h:panelGrid styleClass="panelGrid"
              rowClasses="tsPanelGridRowClass" columns="8" cellpadding="0"
              cellspacing="2" bgcolor="transparent" style="margin-left: 10px"
              id="revCenterItemPanelGrid"
              binding="#{pc_Touchscreen_pull_select_item.revCenterItemPanelGrid}">
    </h:panelGrid>And here is the code for backing bean that adds content inside the panelGrid:
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("1");
    index.setValue(String.valueOf(1));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);On click of a button...
    <a4j:commandButton value="Update"
              styleClass="commandExButtonPou2" id="button1" reRender="revCenterItemPanelGrid"
              actionListener="#{pc_Touchscreen_pull_select_item.doSortActionListener2}">
              <f:attribute name="order" value="2"></f:attribute>
              <f:attribute name="toggleState" value="off"></f:attribute>
    </a4j:commandButton>the backing bean is supposed to update the value of the outputText
    doSortActionListener2() {
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("2");
    index.setValue(String.valueOf(2));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);
    }However, update doesn't seem to work. I have been successful in adding ajax support to a panelGrid that is not dynamically created but not for this one.
    Has anyone encountered this error before? Any ideas?
    Thanks in advance!

  • Ajax support in jDeveloper 10.1.3.1 : Please reply

    Hi Everyone,
    I am supposed to use ADF faces and jDev for my upcoming project as we believe that ADF faces has lot of built in tags to support ajax behavior. But I found that most of the AJAX support is component based (for eg. change the values in one dropdown and values in 2nd drop down refresh).
    My application however needs to show different sections (show/hide them as per the response) based on the response we get. For e.g.. , in first page 1st section is "Customer Search", 2nd section is empty search result and one more section say "section 3" which is showing some information, all these sections can be 3 different forms. In customer search section on the hit of "Search" button section 2 & 3 are replaced by new content.
    Lets say If I use div then hide section 2 and 3 and replace them by 4 and 5.
    Do I have features to implement this kind of behavior in jdev 10.1.3.1? If yes can someone refer me to relevant link?
    expecting a reply....
    Thanks in advance!!!

    You can use the af:switcher for this:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/switcher.html
    Also see: http://technology.amis.nl/blog/?p=1211

  • How to add Ajax support to the dynamic UI componets.

    Hi,
    I am generating a dynamic table and want to add Ajax support to that table.
    How I can do that?

    Hi,
    In my appication, I am using Ajax with Myfaces (JSF 1.2) & Jboss 4.2.1.
    I m generating a table having (couple of selectmenu) dynamically by using the binding attribute of <h:panelGrid> and made that table Ajaxed. When i select some item form the select menu its works fine with Myfaces (JSF 1.2) but when I switched to Sun RI implementaion I got "AjaxUpdate component not found for id: :fForm:null" as exception in the console.

  • What's wrong about  "JSF that emits Ajax-widgets" on the server side?

    Hi,
    I just read this chat about Ajax on the server side and I wonder what this comment bellow means when we are building JSF application with Ajax:
    Another thing to consider is that in a pure Ajax application (i.e. one that's not a hybrid of a server-side technology like JSF that emits Ajax-widgets), the server can pretty much just respond to requests from the Ajax client in a stateless manner, and all of the state gets distributed to the client, greatly reducing the memory resources on the server. I'm working on an app like this for IBM Rational and we're really excited about the *decreased* load on the server by distributing state to clients.
    http://www.devwebsphere.com/devwebsphere/2006/04/ajax_and_its_im.html
    Thanks in advance.

    Just created a half an hour ago application:
    http://jsfbyexamples.com/facesTrace/
    shows that the AJAX request spends less time on the server even it walk though the whole life-cycle. This is a very small page, BTW. On the complicated page, the difference will be more significant. It is about server resources.
    About network traffic: Do you actually believe that sending the whole page produces less traffic than the portion updates? Just mathematically speaking?
    OK, I guess you mean the AJAX application requires traffic comes back and forward to produce the AJAX functionality. Non-AJAX application does not produce the traffic, but it does not produce the functionality you have in the first case.
    People who argue about it just try to compare Something to Nothing. So, where is the point?
    Sergey : http://jsfTutorials.net

  • AJAX supported in Oracle Portal ?

    Dear all,
    Can anyone suggest me some information on AJAX support in Oracle Portal ?
    thanks
    George (HK)

    Duplicate Post:-
    AJAX supported in Oracel Portal ?

  • AJAX supported in Oracel Portal ?

    Dear all,
    Can anyone suggest me some information on AJAX support in Oracle Portal ?
    thanks
    George (HK)

    I am a self taught pl/sql programmer. My client's site does not have any custom JSP. We do everything in PL/SQL.
    I created a httpxmlrequest powered page:
    1) step one write or find a database query based script that accepts a string from the url and gives results based on that string. The example i used (phone lookup) took a string (ss) from the url and queried a table to find employee names that contained that string.
    As the used types in letters the list shortens and zeros in on the desired result.
    (In the code I created a two letter length minimum, so no data gets displayed till there is at lease two letters typed in.)
    you can test this page by typing &ss='Yor' on the end of the url. It will return all the records that contain 'Yor' like Yorke.
    I will leave it to you to build a query.
    2) Place the query on a portal page, with no header graphics or any other elements. A naked page. I call this my data page.
    3) Create a normal page with all your header and footer decorations. On this page place a item that calls the code that accepts the search string (ss) and calls the httpxmlrequest. It also displays the results of the data page into a div on this page. see paulyorke.com/ajax/ajax_sample.sql.rtf
    When you run the page no results should show up till you lift your finger of the second character. A result list should show up.

  • Ask the Experts Session on AJAX Support in the Java Platform -- June 19-23

    Got a question about AJAX support in the Java Platform? Post it on the Ask the Experts page (http://java.sun.com/developer/community/askxprt/) during the week of June 19 and get answers from Sun experts Greg Murray, Mark Basler, and Carla Mott.

    Perhaps this explains why Sun removed the crossposting ban from the site "Terms of Use"?

  • JSF seems not to support the use of the back buttons and html frames.

    I�m having the following problem. I have a JSP which contains a button that register a listener. Here is part of the code:
    <h:command_hyperlink label="<%=engineBean.getId()%>" commandName="<%=engineBean.getId()%>">
    <f:action_listener type="helloDuke.CommandAction"/>
    </h:command_hyperlink>
    This action listener only forwards the request to other simple JSP.
    The problem appears in the following situation:
    1 � I click in the button that generates the event that will be processed by helloDuke.CommnadAction listener.
    2 � It forward to a second JSP page.
    3 � This second page is rendered to the user properly.
    4 � The user clicks in the browser�s back button to return to previous page.
    Then if is the user clicks in first page button, the CommandAction listener was removed. You must click again in the button to forward to the correct page.
    The same happened if you are using html frames. If you have a frame with 2 pages and both pages register action listeners.
    The last loaded page cleans the actions listener of the other.
    Does anybody have any solution?.
    It seems JSF doesn�t support the use of frames and I think that in some situation the frames are the solution to several problems.
    Any help will be really appreciated.

    Using the saveStateInClient=true produces a faulty output when using the command_button and an action_listener. The page that is rendered is totally useless: the button won't work, and due to the faulty rendering there's an output like: >com.sun.faces.saveStateMarker
    So, why is it, that pressing the button (not using the saveStateInClient option) will only work the second time, same thing pressing the backbutton. Pressing the reload button will toggle between two pages - the one before the session id is assigned and the one that it's supposed to show.
    Any guess will be greatly appreciated !!!!

  • JSF 2.0 Ajax navigation problem

    Hello
    I have some problem with new AJAX functionality of JSF 2.0.
    I want to do the navigation between two pages via AJAX because it looks more smooth and I have the possibility to show a wait screen during the server request.
    Here is a short example. I have two facelet page (page1.xhtml and page2.xhtml)
    page1.xhtml
    <h:form>
            <h:commandLink value="Go to page 2" action="page2">
                <f:ajax render="@all" execute="@all"/>
            </h:commandLink>
    </h:form>
    .....page2.xhtml
    <h:form>
                <h:commandLink value="Go to page 1" action="page1">
                    <f:ajax render="@all" execute="@all"/>
                </h:commandLink>
    </h:form>
    ....The example is very simple. Two pages and on each page is a link to navigate to the other page. I open the page1.xhtml in my browser and I click on the link. The first request is processed as expected. The second pages is displayed successfully. Now I want to go back to the other page. If I click on the link ("Go to page 1") nothing happens. If I click a second time on the link the navigation is working agian. Why I have to click twice? Is this a bug or feature of jsf? Do I use the <f:ajax> feature wrong?
    I did some investigations with firebug and what I can see is that after the second click on page2.xhtml a hidden field is available.
    <input type="hidden" name="javax.faces.ViewState" value="-6158142916843935211:2501145469136072012">
    If I add this hidden field via firebug into the page the navigaiton back to the first page is working after the first click. Why is this hidden field only after the second click available?
    Any ideas what I'm doing wrong?
    Thanks in advance

    I found the problem and a solution :-) The missing piece of the puzzle was the id attribute for the form tag. After some debugging of the JSF JavaScript I found the solution.
    The JavaScript function response(request, context) is invoked to handle the server response. Inside this function the doUpdate(element, context) is invoked.
    The doUpdate() function is doing the modification of the DOM. The function doUpdate() is two times invoked for a response. The first time the html elements are updated.
    The second time the view state hidden field is updated or created but only under the following condition:
    Comment in the JavaScript source code of the jsf.js
    //Now set the view state from the server into the DOM
    //but only for the form that submitted the request.If the forms of the both side haven't the same id the form can't be found on the second page.
    In the following way it is working:
    page1.xhtml
    <h:form id="myform">
            <h:commandLink value="Go to page 2" action="page2">
                <f:ajax render="@all" execute="@all"/>
            </h:commandLink>
    </h:form>
    .....page2.xhtml
    <h:form id="myform">
                <h:commandLink value="Go to page 1" action="page1">
                    <f:ajax render="@all" execute="@all"/>
                </h:commandLink>
    </h:form>So always set an explicit id for each JSF tag.

  • JSF tree with radiobuttons support

    Hi everybody,
    I need to create JSF tree with possibility to select both nodes and leaves with radio button.
    The only idea I have now is to create my own component, which will generate [BlueShoes JavaScript tree|http://www.blueshoes.org/_bsJavascript/components/tree/examples/example8.html]
    Perhaps anyone has better idea? Maybe anyone has already met JSF trees with radiob uttons support?
    Thanks beforehand

    unfortunately, the browser usually uses right click to bring up a browser's menu for copy/paste, etc. I don't think javascript can intercept that though I could be wrong.

  • MX Kollection 4 with Ajax support

    Hello,
    We've started the next major beta in InterAKT - the MX
    Kollection 4 beta.
    With a heavy accent on Ajax, our main focus for MX Kollection
    4 is to
    provide the perfect Dreamweaver extension for building web
    applications.
    Here is a preview of new features and improvements (you can
    also check
    out a very alpha version of Kollection 4 here):
    http://www.interaktonline.com/demos/MXKollection4/
    * Ajax-enabled NeXTensio Lists and Forms
    * NeXTensio List inline record editing "a la Access" on
    double-clicking a row.
    * NeXTensio List navigation, sort and filter-as-you-type
    without
    page refresh
    * Ajax-enabled Master/Detail support, Form Validation/Form
    Controls
    * Multiple image upload with watermark and upload progress
    bar
    * Download Counter, Captcha and Restricted Word List for
    secure forms
    * Send e-mail with attachments
    * Major performance boost in page loading and execution
    speed
    * Compatibility with MX Ajax Toolbox
    * and many others..
    Fill in the survey and apply for the beta now!
    http://iakt.rdsnet.ro/interakt/survey/survey/index.php?survey=23&from=mxk4_9_06_06
    Alexandru
    Alexandru COSTIN
    Division Manager
    http://www.interaktonline.com/
    +4021 312 5312

    Alexandru
    What language are you targeting with this example.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "Alexandru Costin" <[email protected]> wrote
    in message
    news:e6jrf3$fu$[email protected]..
    > Hello,
    >
    > We've started the next major beta in InterAKT - the MX
    Kollection 4 beta.
    >
    > With a heavy accent on Ajax, our main focus for MX
    Kollection 4 is to
    > provide the perfect Dreamweaver extension for building
    web applications.
    > Here is a preview of new features and improvements (you
    can also check out
    > a very alpha version of Kollection 4 here):
    >
    >
    http://www.interaktonline.com/demos/MXKollection4/
    >
    > * Ajax-enabled NeXTensio Lists and Forms
    > * NeXTensio List inline record editing "a la Access" on
    > double-clicking a row.
    > * NeXTensio List navigation, sort and filter-as-you-type
    without page
    > refresh
    > * Ajax-enabled Master/Detail support, Form
    Validation/Form Controls
    > * Multiple image upload with watermark and upload
    progress bar
    > * Download Counter, Captcha and Restricted Word List for
    secure forms
    > * Send e-mail with attachments
    > * Major performance boost in page loading and execution
    speed
    > * Compatibility with MX Ajax Toolbox
    > * and many others..
    >
    > Fill in the survey and apply for the beta now!
    >
    >
    http://iakt.rdsnet.ro/interakt/survey/survey/index.php?survey=23&from=mxk4_9_06_06
    >
    > Alexandru
    >
    > --
    > Alexandru COSTIN
    > Division Manager
    >
    http://www.interaktonline.com/
    > +4021 312 5312

  • AIR/Ajax support for gzipped HTTP response

    I run from one problem into another. I would like to fetch
    XML data from one site, but apparently it sends it gzip encoded.
    And it seems AIR/Ajax is not good with supporting this.
    I saw some workarounds for this in AIR/Flex (and Flash i
    suppose as well) by using some ActionScript code. Is there any
    option for AIR/Ajax ?
    Or maybe is there an option to setup URLRequest/URLLoader in
    a way it looks to external site as 'browser' that does not support
    gzip encoding ?

    I agree, it would be nice to have gzip encoding support in
    AIR's browser component. But, I looked at what my AIR app sends
    when it requests a web page, and it's not claiming to the remote
    server that it can support gzip. If the server is sending the
    content gzipped anyway, it's almost certainly broken. Web servers
    aren't supposed to dictate encodings. Clients say what they're
    capable of receiving, and servers send the data in that format if
    they're capable of sending any of the requested formats.
    I see only one exception in the spec.
    Section
    14.3 says the server is allowed to send what it likes if the
    client doesn't say what it wants (true for AIR) and it cannot
    support the default, which is to say, sending the raw data as it is
    on disk. So, is that the case? Can this server really not send raw
    data, to anyone, ever? If so, it's violating the spirit of the web,
    to the point that I'd say it's broken, even if the spec does allow
    it. And if the server really is capable of sending the raw data,
    it's
    really broken for insisting on sending it compressed when
    the client hasn't told it that it can handle it; this would
    actually be against the spec, not just against the spirit of the
    spec.
    It would seem a more sensible use of your time to fix the
    server than to go and learn another technology just to work around
    its brokenness.

  • Simple jsf 2.1/ajax page, example code?

    hi,
    ive created a dynamic web project in eclipse juno, it uses mojarra and tomcat.
    i just want some kind of ajax behavior to get started, this is my xhtml page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <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" >
    <head>
    <title>Insert title here</title>
    </head>
    <body>
         <h:form>
              <h:inputText id="myinput" value="">
                   <f:ajax render="outtext" event="keyup" listener="#{loginBean.update}"/>
              </h:inputText>
              <h:outputText id="outtext" value="#{loginBean.eventCount}"/>       
         </h:form>
    </body>
    </html>and this is LoginBean.java:
    import javax.faces.event.AjaxBehaviorEvent;
    public class LoginBean {
         private int eventCount = 0;
         private String name;
         private String password;
         public String getName ()
              return name;
         public void setName (final String name)
              this.name = name;
         public String getPassword ()
              return password;
         public void setPassword (final String password)
         this.password = password;
         public void update (AjaxBehaviorEvent event)
            this.setEventCount(this.getEventCount() + 1);
         public int getEventCount() {
              return eventCount;
         public void setEventCount(int eventCount) {
              this.eventCount = eventCount;
    }the error i get is: (right after starting the application, without any input)
    Feb 25, 2013 10:14:58 PM com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages
    INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
    sourceId=null[severity=(ERROR 2), summary=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.), detail=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.)]how can i fix this?

    theres quite a lot of outdated information out there, even if you specify last year as max time search in google.
    and there are even wrong ones, not just one. look at mykongs ajax example if you want to see ajax with a full page reload.
    now with h:head and h:body the error is gone, but yet no ajax update when i type :(
    updated login.xhtml:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <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" >
    <h:head>
    <title>Insert title here</title>
    </h:head>
    <h:body>
         <h:form>
              <h:inputText id="myinput" value="">
                   <f:ajax render="outtext" execute="@this" event="keyup" listener="#{loginBean.update}"/>
              </h:inputText>
              <h:outputText id="outtext" value="#{loginBean.eventCount}"/>       
         </h:form>
    </h:body>
    </html>why is the ajax part still not working?
    Edited by: 990254 on Feb 25, 2013 2:44 PM

Maybe you are looking for