Closed glassfishrobot closed 11 years ago
@glassfishrobot Commented Reported by autozoom
@glassfishrobot Commented rogerk said: Taking ownership
@glassfishrobot Commented rogerk said: I'm not familiar with how thw Woodstock components encapsulate the underlying Dynamic Faces javascript apis and.. I haven't used the postReplace function myself but the documentation states:
postReplace
The name of a globally scoped function that conforms to the following signature.
function postReplace(ajaxZone, innerHTML, [closure], [xjson]);
An example usage of this in dynamic faces is the jmaki integration. Take a look under: jsf-extensions/trunk/code/run-time/samples/jmaki/src/main/webapp Take a look at: mainColumn.jsp devtime.js
devtime.js has a postReplace function:
function postReplace(ajaxZone, innerHTML) { var isJmaki; if ((isJmaki = (-1 != ajaxZone.id.indexOf("form:table"))))
{ jmaki.clearWidgets(); }
innerHTML.evalScripts(); if (isJmaki)
{ window.onload(); }
}
Seems like the args to your function should be "ajaxZone" and "innerHTML"
@glassfishrobot Commented autozoom said: I read the documentation and it's pretty clear how it's supposed to work, but it's not working with woodstock components, and woodstock team points me to JSF extension website
@glassfishrobot Commented rogerk said: Reassinging to Matt at his request.
@glassfishrobot Commented mattbohm said: Because woodstock is heavily based on JavaScript, currently you must go a little further in your application to ensure that the scripts of woodstock components are evaluated prior to the invocation of your custom postReplace function.
I was able to resolve this by doing two things:
1. Manually replace the jsf-extensions-dynamic-faces-0.1.jar and jsf-extensions-common-0.1.jar inside the dynamicfaces.complib (0.2) with the versions of those jars used in woodstock. (If you are building netbeans from sources, you can find those jars inside visualweb.woodstock.webui.jsf/external/woodstock-components-4.2.zip.)
2. Specify a custom replace function, as shown below, calling markup.evalScripts after DynaFaces.replace:
<?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">
@glassfishrobot Commented autozoom said: Yes this way it works thanks, I think the trick is that we cannot use a custom postreplace without using a custom replace at the same time. This is the kind of samples and docs we need to effectively use the libraries. thanks
@glassfishrobot Commented @edburns said: I am no longer tracking progress of these projects on java.net.
@glassfishrobot Commented This issue was imported from java.net JIRA JSF_EXTENSIONS-90
@glassfishrobot Commented Marked as won't fix on Wednesday, May 29th 2013, 8:24:34 am
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">