You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by lmk <lo...@casden.banquepopulaire.fr> on 2007/03/22 11:20:41 UTC

about using ajax4jsf with selectOneRadio

hiii,

I want to hide a region on JSF dependin on the radio boutttton click..

the code is very simple like inspired by the a4j doc.

I do this:
<h:selectOneRadio
value="#{bean.person}" >
<f:selectItem itemValue="1" />
<f:selectItem itemValue="2" />
<a4j:support ajaxSingle="true"  event="onclick"/>	
</h:selectOneRadio>

<a4j:outputPanel ajaxRendered="true">
<h:outputText value="#{bean.person}" />
</a4j:outputPanel>						


the value of bean.personn  stay equal to default value '1' even  sending
ajax request on click  on 2..




-- 
View this message in context: http://www.nabble.com/about-using-ajax4jsf-with-selectOneRadio-tf3446617.html#a9611759
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: about using ajax4jsf with selectOneRadio

Posted by lmk <lo...@casden.banquepopulaire.fr>.
yes  I just realised, I've conversion error..
thanks



Jeff Bischoff wrote:
> 
> Hmm I don't see what's wrong. Maybe conversion error? You should post 
> question on the new ajax4jsf forum. See [1].
> 
> You might also want to take a look at their existing issue [2].
> 
> [1] http://jboss.com/index.html?module=bb&op=viewforum&f=259
> [2] http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030828
> 
> Regards,
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> lmk wrote:
>> the code:
>> 
>> <h:panelGrid columns="2">
>> 	<h:panelGroup styleClass="libelleDemande">
>> 		<h:outputText value="Emp" />
>> 	</h:panelGroup>
>> 	<h:panelGroup styleClass="champsDemande">
>> 		<h:selectOneRadio value="#{bean.person}">
>> 			<f:selectItems value="#{bean.nbPersonItems}" />
>> 			<a4j:support event="onclick" />
>> 			<a4j:support event="onchange" />
>> 		</h:selectOneRadio>
>> 	</h:panelGroup>
>> </h:panelGrid>
>> <a4j:outputPanel ajaxRendered="true">
>> 	<h:outputText value="#{bean.person}"></h:outputText>
>> 	<h:panelGrid columns="2" rendered="#{bean.person == 2}">
>> 		<h:panelGroup styleClass="libelleDemande">
>> 			<h:outputText value="Co emp" />
>> 		</h:panelGroup>
>> 		<h:panelGroup styleClass="champsDemande">
>> 			<h:inputText maxlength="10" size="10" value="#{bean.dateCoEmp}"
>> 				converter="dateConverter">
>> 			</h:inputText>
>> 		</h:panelGroup>
>> 	</h:panelGrid>
>> </a4j:outputPanel>
>> 
>> when a select the first time the radio  2, the panel grid is displayed,
>> and
>> there is no  reaction on any another  cllick, the value still equal to
>> 2..
>> thanks
>> NB: I'm developping with apache myfaces and facelets
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Jeff Bischoff wrote:
>>> post the code
>>>
>>> lmk wrote:
>>>> I removed it,I still have the same problem when I put the  a4j code
>>>> inside a
>>>> panel grid and panel group.
>>>> the code  without panels  works fine!!
>>>>
>>>
>>>
>>>
>>>
>> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/about-using-ajax4jsf-with-selectOneRadio-tf3446617.html#a9634940
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: about using ajax4jsf with selectOneRadio

Posted by Jeff Bischoff <jb...@klkurz.com>.
Hmm I don't see what's wrong. Maybe conversion error? You should post 
question on the new ajax4jsf forum. See [1].

You might also want to take a look at their existing issue [2].

[1] http://jboss.com/index.html?module=bb&op=viewforum&f=259
[2] http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030828

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

lmk wrote:
> the code:
> 
> <h:panelGrid columns="2">
> 	<h:panelGroup styleClass="libelleDemande">
> 		<h:outputText value="Emp" />
> 	</h:panelGroup>
> 	<h:panelGroup styleClass="champsDemande">
> 		<h:selectOneRadio value="#{bean.person}">
> 			<f:selectItems value="#{bean.nbPersonItems}" />
> 			<a4j:support event="onclick" />
> 			<a4j:support event="onchange" />
> 		</h:selectOneRadio>
> 	</h:panelGroup>
> </h:panelGrid>
> <a4j:outputPanel ajaxRendered="true">
> 	<h:outputText value="#{bean.person}"></h:outputText>
> 	<h:panelGrid columns="2" rendered="#{bean.person == 2}">
> 		<h:panelGroup styleClass="libelleDemande">
> 			<h:outputText value="Co emp" />
> 		</h:panelGroup>
> 		<h:panelGroup styleClass="champsDemande">
> 			<h:inputText maxlength="10" size="10" value="#{bean.dateCoEmp}"
> 				converter="dateConverter">
> 			</h:inputText>
> 		</h:panelGroup>
> 	</h:panelGrid>
> </a4j:outputPanel>
> 
> when a select the first time the radio  2, the panel grid is displayed, and
> there is no  reaction on any another  cllick, the value still equal to 2..
> thanks
> NB: I'm developping with apache myfaces and facelets
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Jeff Bischoff wrote:
>> post the code
>>
>> lmk wrote:
>>> I removed it,I still have the same problem when I put the  a4j code
>>> inside a
>>> panel grid and panel group.
>>> the code  without panels  works fine!!
>>>
>>
>>
>>
>>
> 




Re: about using ajax4jsf with selectOneRadio

Posted by lmk <lo...@casden.banquepopulaire.fr>.
the code:

<h:panelGrid columns="2">
	<h:panelGroup styleClass="libelleDemande">
		<h:outputText value="Emp" />
	</h:panelGroup>
	<h:panelGroup styleClass="champsDemande">
		<h:selectOneRadio value="#{bean.person}">
			<f:selectItems value="#{bean.nbPersonItems}" />
			<a4j:support event="onclick" />
			<a4j:support event="onchange" />
		</h:selectOneRadio>
	</h:panelGroup>
</h:panelGrid>
<a4j:outputPanel ajaxRendered="true">
	<h:outputText value="#{bean.person}"></h:outputText>
	<h:panelGrid columns="2" rendered="#{bean.person == 2}">
		<h:panelGroup styleClass="libelleDemande">
			<h:outputText value="Co emp" />
		</h:panelGroup>
		<h:panelGroup styleClass="champsDemande">
			<h:inputText maxlength="10" size="10" value="#{bean.dateCoEmp}"
				converter="dateConverter">
			</h:inputText>
		</h:panelGroup>
	</h:panelGrid>
</a4j:outputPanel>

when a select the first time the radio  2, the panel grid is displayed, and
there is no  reaction on any another  cllick, the value still equal to 2..
thanks
NB: I'm developping with apache myfaces and facelets









Jeff Bischoff wrote:
> 
> post the code
> 
> lmk wrote:
>> I removed it,I still have the same problem when I put the  a4j code
>> inside a
>> panel grid and panel group.
>> the code  without panels  works fine!!
>> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/about-using-ajax4jsf-with-selectOneRadio-tf3446617.html#a9631458
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: about using ajax4jsf with selectOneRadio

Posted by Jeff Bischoff <jb...@klkurz.com>.
post the code

lmk wrote:
> I removed it,I still have the same problem when I put the  a4j code inside a
> panel grid and panel group.
> the code  without panels  works fine!!
> 




Re: about using ajax4jsf with selectOneRadio

Posted by lmk <lo...@casden.banquepopulaire.fr>.
I removed it,I still have the same problem when I put the  a4j code inside a
panel grid and panel group.
the code  without panels  works fine!!



Jeff Bischoff wrote:
> 
> You use
> 
>  > ajaxSingle="true"
> 
> so the outputText can not be rerendered. Only the selectOneRadio itself 
> will be rerendered. Remove this attribute.
> 
> lmk wrote:
>> hiii,
>> 
>> I want to hide a region on JSF dependin on the radio boutttton click..
>> 
>> the code is very simple like inspired by the a4j doc.
>> 
>> I do this:
>> <h:selectOneRadio
>> value="#{bean.person}" >
>> <f:selectItem itemValue="1" />
>> <f:selectItem itemValue="2" />
>> <a4j:support ajaxSingle="true"  event="onclick"/>	
>> </h:selectOneRadio>
>> 
>> <a4j:outputPanel ajaxRendered="true">
>> <h:outputText value="#{bean.person}" />
>> </a4j:outputPanel>						
>> 
>> 
>> the value of bean.personn  stay equal to default value '1' even  sending
>> ajax request on click  on 2..
>> 
>> 
>> 
>> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/about-using-ajax4jsf-with-selectOneRadio-tf3446617.html#a9615924
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: about using ajax4jsf with selectOneRadio

Posted by Jeff Bischoff <jb...@klkurz.com>.
You use

 > ajaxSingle="true"

so the outputText can not be rerendered. Only the selectOneRadio itself 
will be rerendered. Remove this attribute.

lmk wrote:
> hiii,
> 
> I want to hide a region on JSF dependin on the radio boutttton click..
> 
> the code is very simple like inspired by the a4j doc.
> 
> I do this:
> <h:selectOneRadio
> value="#{bean.person}" >
> <f:selectItem itemValue="1" />
> <f:selectItem itemValue="2" />
> <a4j:support ajaxSingle="true"  event="onclick"/>	
> </h:selectOneRadio>
> 
> <a4j:outputPanel ajaxRendered="true">
> <h:outputText value="#{bean.person}" />
> </a4j:outputPanel>						
> 
> 
> the value of bean.personn  stay equal to default value '1' even  sending
> ajax request on click  on 2..
> 
> 
> 
>