Yes the code that you are putting in is for an onUpdate() method which means
that whenever the state of the checkbox gets changed only then the code will
be executed. So if you check it, something should happen and when you
uncheck it then again something should happen.

Also did u try to use the setOutputMarkupPlaceholdertag to true. I had a
similar issue like you and I was able to get it to work with that.

Vishy

vishy_sb wrote:
> 
> Well you need to put the component (say component) which you want to make
> invisible into target and then set
> component.setOutputMarkupPlaceholderTag(true).
> 
> Let me know if that works. 
> 
> vishy
>  
> 
> rit wrote:
>> 
>> I have strange situation while handling Ajax on check box.
>> 
>> I have a scenario , On click of check box i need to hide one component
>> and on uncheck i need to show the component back . when i select the
>> check box my Ajax fires and component hide , but when i unselect the
>> check box , my ajax doesn't fires . 
>> 
>> Please help me . 
>> 
>> my code is :
>> 
>> Object obj = this.get("e_joint_cover");
>>                              if (obj instanceof MCheckbox) {
>>                                      final MCheckbox eJointCover = 
>> (MCheckbox)obj;
>>                                      eJointCover.add(new 
>> AjaxFormComponentUpdatingBehavior("onclick") {
>>                                      private static final long 
>> serialVersionUID = 1L;                
>>                                      protected void 
>> onUpdate(AjaxRequestTarget target) {                     
>> 
>> if (jointCoverValue.equalsIgnoreCase("false")){                              
>>                         
>>                                                      
>> //ServiceUtility.setPanelVisible(component, true);
>>                                                      
>> LpiComponent.setVisible(true);
>>                                              }else{
>>                                                      
>> //ServiceUtility.setPanelVisible(component, false);
>>                                                      
>> LpiComponent.setVisible(false);
>>                                              }       
>>                                              
>> target.addComponent(container.get("lpi_insured_two_details_comp"));
>> 
>> 
>>                                     }                                        
>>                              });             
>>                      }
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/CheckBox-handling-with-Ajax.-tp18781515p18790177.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to