vendredi 28 août 2015

Why z-checkbox doesn't become active?

I am faced with ZK framework and folowing strange behavior. I have a page in which there a list of checkbox cjmponents. Each of them looks like

<div id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24205" style="width:250px;" class="z-div" xy="1:0">
  <span id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206" style="width:250px;" class="z-checkbox">
    <input type="checkbox" id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-real" 
      name="chb_dict_orderingauthority_nationalcustomer" style="position: absolute; left: -9000px;">
    <div id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-advcheckbox" class="advcheckbox-default"></div>
    <label for="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-real" id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-cnt"
      class="z-checkbox-content"></label>
  </span>
</div>

According the business logic, one checkbox (when it checked) should disable all another. And when that one is unchecked - all another should became enabled again. So, when I check that one checkbox, HTML layout chenges and looks like

<div id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24205" style="width:250px;" class="z-div" xy="1:0">
  <span id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206" style="width:250px;" class="z-checkbox">
    <input type="checkbox" id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-real" 
      name="chb_dict_orderingauthority_nationalcustomer" disabled="disabled" style="position: absolute; left: -9000px;">
    <div id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-advcheckbox" class="advcheckbox-default advcheckbox-disabled"></div>
    <label for="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-real" id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-cnt"
      class="z-checkbox-content"></label>
  </span>
</div>

Ans seems like all contenf of <div id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24205" /> rewriting. When I uncheck checkbox, in the html changing only few attributes in <input type="checkbox" id="zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206-real" ...> (disabled="disabled" dosappears).

From the server, when I check checkbox I get response with folowing JSON fragments for checkboxes:

Disabled state (I check checkbox)

["outer",[{$u:'zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206'},[['zul.wgt.Checkbox','zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206',{$$1onCheck:true,$onCheck:true,$$0onSwipe:true,$$0onFocus:true,$onFocus:true,$$0onBlur:true,$onBlur:true,$$0onAfterSize:true,width:'250px',disabled:true,name:'chb_dict_orderingauthority_nationalcustomer'},[]]]]],

Pseudo-enabled state (I uncheck checkbox, but all other checkboxes still disabled)

["setAttr",[{$u:'zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206'},"disabled",false]],

Enabled state (if I quickly check and uncheck checkbox)

["outer",[{$u:'zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206'},[['zul.wgt.Checkbox','zkau_jsessionid_q2rp7jjhd9hm1tw8jbet2y7xj_24206',{$$1onCheck:true,$onCheck:true,$$0onSwipe:true,$$0onFocus:true,$onFocus:true,$$0onBlur:true,$onBlur:true,$$0onAfterSize:true,width:'250px',name:'chb_dict_orderingauthority_nationalcustomer'},[]]]]],

So, my question is: Why setAttr doesn't work properly? Why checkboxes still disabled and I need to overwrite much more HTML layout code for enable them?

Best regards and many thanks for wasting your time for me.




Aucun commentaire:

Enregistrer un commentaire