dev@jsf-extensions.java.net

Re: [JSF-EXT] problem with ajaxZone

From: Jennifer Ball <Jennifer.Ball_at_Sun.COM>
Date: Tue, 19 Dec 2006 09:19:58 -0800

I tried it in Firefox, but I did not see any errors in the Console. Did
you see any errors with your issue?

Jennifer

Ken Paulsen wrote:

>
> Are you using firebug? If so, do you see errors? I ran into an issue
> w/ ajaxZone where I was seeing similar behavior... it's on my todo
> list to produce a test .war so Ed can look at this. This might not be
> related, though.
>
> Ken
>
> Jennifer Ball wrote:
>
>> Thank you for the tip. I believe you're right. It didn't solve the
>> problem though.
>>
>> Jennifer
>>
>> Sergey Smirnov wrote:
>>
>>> From the level I understand DynaFaces, you have a problem with ids.
>>> In the javascript you use Document.getElementById('fruit'); .
>>> However, the id of this field will be "form:fruit". As an
>>> alternative, you can try to use prependId as a form attribute. It
>>> will keep the field ids shorter.
>>>
>>>
>>> ----- Original Message ----- From: "Jennifer Ball"
>>> <Jennifer.Ball_at_Sun.COM>
>>> To: <dev_at_jsf-extensions.dev.java.net>
>>> Sent: Monday, December 18, 2006 6:48 PM
>>> Subject: [JSF-EXT] problem with ajaxZone
>>>
>>>
>>>> Hi
>>>>
>>>> I have an example that is using ajaxZones to allow the user to
>>>> select a fruit from a list of radio buttons, causing the values in
>>>> a menu to change to list some varieties on the chosen fruit. When
>>>> the user selects a variety, an output component is supposed to show
>>>> some information about that fruit variety.
>>>>
>>>> What I have in the page is the following. I was trying to follow
>>>> the example given in the tlddoc for collectPostData. When I click
>>>> on the radio buttons or the menu, nothing happens. My listeners
>>>> are not called either. Any ideas?
>>>> thanks.
>>>> Jennifer
>>>>
>>>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>>>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
>>>> <%@ taglib prefix="jsfExt"
>>>> uri="http://java.sun.com/jsf/extensions/dynafaces" %>
>>>>
>>>> <f:view>
>>>> <html>
>>>> <head>
>>>> <title>DynaFaces JSP Blank App</title>
>>>> <jsfExt:scripts />
>>>> </head>
>>>> <body bgcolor="white">
>>>>
>>>> <h:form id="form">
>>>> <h1>DynaFaces JSP Blank App</h1>
>>>>
>>>> <jsfExt:ajaxZone id="zone1" eventType="onChange"
>>>> collectPostData="handler">
>>>> <h:panelGrid columns="2">
>>>> <h:selectOneRadio id="fruit" value="#{fruitInfoBean.fruit}"
>>>> valueChangeListener="#{fruitInfoBean.changeFruit}">
>>>> <f:selectItems value="#{fruitInfoBean.fruits}"/>
>>>> </h:selectOneRadio>
>>>> <h:selectOneMenu id="variety" value="#{fruitInfoBean.variety}"
>>>> valueChangeListener="#{fruitInfoBean.updateVariety}">
>>>> <f:selectItems value="#{fruitInfoBean.varieties}"/>
>>>> </h:selectOneMenu>
>>>> </h:panelGrid>
>>>> </jsfExt:ajaxZone>
>>>> <jsfExt:ajaxZone id="zone2">
>>>> <h:outputText id="varietyInfo"
>>>> value="#{fruitInfoBean.varietyInfo}" />
>>>> </jsfExt:ajaxZone>
>>>>
>>>> </h:form>
>>>> <script type="text/JavaScript">
>>>>
>>>> function handler(ajaxZone, element, outArray) {
>>>>
>>>> var name = null, value = null;
>>>>
>>>> var fruit = Document.getElementById('fruit');
>>>> var variety = Document.getElementById('variety');
>>>> var elementNodeName = fruit.nodeName.toLowerCase();
>>>> var elementType = fruit.type;
>>>> name = DynaFacesZones.getParamNameFromElement(fruit,
>>>> elementNodeName,
>>>> elementType);
>>>> value = DynaFacesZones.getParamValueFromElement(fruit,
>>>> elementNodeName,
>>>> elementType);
>>>> outArray.push(name+'='+value);
>>>> var elementNodeName = variety.nodeName.toLowerCase();
>>>> var elementType = variety.type;
>>>> name = DynaFacesZones.getParamNameFromElement(variety,
>>>> elementNodeName,
>>>> elementType);
>>>> value = DynaFacesZones.getParamValueFromElement(variety,
>>>> elementNodeName,
>>>> elementType);
>>>> outArray.push(name+'='+value); }
>>>>
>>>> </script>
>>>> </body>
>>>> </html>
>>>> </f:view>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_jsf-extensions.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_jsf-extensions.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_jsf-extensions.dev.java.net
>>> For additional commands, e-mail: dev-help_at_jsf-extensions.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jsf-extensions.dev.java.net
>> For additional commands, e-mail: dev-help_at_jsf-extensions.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsf-extensions.dev.java.net
> For additional commands, e-mail: dev-help_at_jsf-extensions.dev.java.net
>