users@woodstock.java.net

Re: postreplace for ajax transactions with woodstock does not work

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Wed, 26 Mar 2008 13:47:44 -0500

I don't know if you'll find an answer on this alias, but I forwarded
your message to the JSF Extenions folks. If they respond, it will most
likely be a reply to the message you sent to
users_at_jsf-extensions.dev.java.net.

Dan

autozoom wrote:
> sorry to insist on this, but I cannot get an answer neither from the
> woodstock/netbeans groups nor from the JSF extension ones.
>
> here is my problem:
>
> if you set the postreplace attribute of an Ajax transaction, the function
> receives incorrect call parameters:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jsp:root version="2.1" xmlns:df="http://java.sun.com/jsf/dynamicfaces"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:jsp="http://java.sun.com/JSP/Page"
> xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
> <jsp:directive.page contentType="text/html;charset=UTF-8"
> pageEncoding="UTF-8"/>
> <f:view>
> <webuijsf:page binding="#{Page1.page1}" id="page1">
> <webuijsf:html binding="#{Page1.html1}" id="html1">
> <webuijsf:head id="head1">
> <webuijsf:link binding="#{Page1.link1}" id="link1"
> url="/resources/stylesheet.css"/>
> <df:ajaxTransaction binding="#{Page1.tx1}" id="tx1"
> inputs="page1:html1:body1:form1:button1" postReplace="pr"
> render="page1:html1:body1:form1:staticText1"/>
> <webuijsf:script id="script1">
> function pr(a,b,c) {
> alert(a + " " + b + " " + c);
> }
> </webuijsf:script>
> </webuijsf:head>
> <webuijsf:body id="body1" style="-rave-layout: grid">
> <webuijsf:form id="form1">
> <webuijsf:staticText binding="#{Page1.staticText1}"
> id="staticText1" style="position: absolute; left: 444px; top: 108px"
> text="provaaaaaaaaa"/>
> <webuijsf:button
> actionExpression="#{Page1.button1_action}" id="button1"
> onClick="DynaFaces.Tx.fire('tx1');return false;"
> style="height: 36px; left: 72px; top: 108px;
> position: absolute; width: 107px" text="Button"/>
> </webuijsf:form>
> </webuijsf:body>
> </webuijsf:html>
> </webuijsf:page>
> </f:view>
> </jsp:root>
>
> whatever the button action handler does, the javascript function named pr()
> receives the 1st and 3rd parameters as null or undefined, making it
> impossible
> to use it.
>
> As a side effect, with the postreplace not working at all, how is it
> possible to execute something client-side *after* the ajax transaction has
> completed?
> Ajax transaction is asynchronous by nature so its call returns even if it's
> not completed.
>