I have <a4j:outputPanel />  & <a4j:region /> in my code and it works fine
first time i.e. if user has not entered anything into the textfield then
onblur event functions as desirable i.e. clears off other fields on the form
with the help of backing bean method . The problem is when i go back to the
textfield and key in the value it still holds the null value 

Here is the snippet
<h:inputText  id="propertyTag" value="#{updateDeviceBean.tagNumber}"
disabled="#{!updateDeviceBean.disableMode}">
                                                <a4j:support  
action="#{updateDeviceBean.loadAssetDetails}"
event="onblur" reRender="mypanel" />
                                                
                                        </h:inputText>

<a4j:outputPanel  id="mypanel"> 
....
</a4j:outputPanel  >    

Backing Bean method
 public String loadAssetDetails() {
if (!StringUtils.isEmpty(tagNumber) && !StringUtils.isEmpty(selectedAsset)){ 
                                  System.out.println("In not null");
}
else if(StringUtils.isEmpty(tagNumber)){
                                  System.out.println("In tagNo null");
 disableMode = false;
                                  return null;
                          }
                          else{
                                  System.out.println("In else");
                                  disableMode = false;
                                  return null;
                          }
}


Andrew Robinson-5 wrote:
> 
> Once again, check to see if there are validation errors. I recommend
> always using a4j:regions around data that is submit by AJAX. This way
> you know exactly which components are being submitted/decoded/updated.
> 
> Also, at least when debugging, make sure there is the following in every
> page:
> 
> <a4j:outputPanel ajaxRendered="true">
> <t:messages globalOnly="false" />
> </a4j:outputPanel>
> 
> -Andrew
> 
> On 8/2/07, bansi <[EMAIL PROTECTED]> wrote:
>>
>> Good question Andrew. I knew you are pointing at Conversion or
>> Validations
>> which may occur during onchange event. It was error in my code which i
>> fixed
>> it & works fine now
>>
>> But i am having another wierd problem
>> I have onblur event on textfield which functions as expected in case the
>> textfield has null value. But if i go back & key in the value for
>> textfield
>> it still holds the null value & doesnt recognizes the new keyed in value
>> .
>> from debugging statement i figured out the setXXX() method doesn't get
>> called
>>
>>
>>
>>
>>
>> Andrew Robinson-5 wrote:
>> >
>> > do you have any faces messages as a result of changing the menu
>> > (conversion error, validation message, etc.)?
>> >
>> > On 8/1/07, bansi <[EMAIL PROTECTED]> wrote:
>> >>
>> >> When the page loads the textfield is disabled i.e. non-editable. It
>> >> should be
>> >> editable only thru onchange event of other component
>> >> Here is the snippet
>> >> <h:selectOneMenu id="assetMgmt" value="#{deviceBean.selectedAsset}"  >
>> >>                                           <f:selectItem itemLabel=""
>> >> itemValue="" />
>> >>                                           <f:selectItems
>> >> value="#{deviceBean.assetList}" />
>> >>                                               <a4j:support
>> >> action="#{deviceBean.loadTagMode}"
>> >> event="onchange"  reRender="propertyTag"/>
>> >>                             </h:selectOneMenu>
>> >>
>> >> <a4j:outputPanel>
>> >>                        <h:panelGrid columns="2" styleClass="detail"
>> >> columnClasses="label" >
>> >>
>> >>                         <h:outputLabel><h:outputText  value="Property
>> >> Tag" />
>> >> </h:outputLabel>
>> >>                             <h:inputText  id="propertyTag"
>> >> value="#{deviceBean.tagNumber}"
>> >> disabled="#{!updateDeviceBean.disableMode}">
>> >>                                                         <a4j:support
>> >> action="#{deviceBean.loadAssetDetails}"
>> >> event="onblur" reRender="mypanel"  />
>> >>                              </h:inputText>
>> >>
>> >>                                         </h:panelGrid>
>> >>                                 </a4j:outputPanel>
>> >>
>> >>
>> >> Backing Bean
>> >> public void loadTagMode() {
>> >>           System.out.println("Inside loadTagDetails");
>> >>                   disableMode = true;
>> >>
>> >> }
>> >> Any pointers/suggestions will be highly appreciated
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/ajax4jsf-onchange--event-doesnt-reRender-Textfield-tf4202589.html#a11953535
>> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ajax4jsf-onchange--event-doesnt-reRender-Textfield-tf4202589.html#a11971431
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ajax4jsf-onchange--event-doesnt-reRender-Textfield-tf4202589.html#a11972227
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to