Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3587

focus new listitem in ROD listbox

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.0.4.1
    • Fix Version/s: 8.5.2
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      Steps to Reproduce

      run the attached example focus-rod.zul
      click the button

      Actual Result

      textbox in initial listitem is focussed (OK)
      when new listitem is added the textbox is not focussed

      Expected Result

      when new listitem is added the textbox should also be focussed

      Debug Info

      this works as expected when ROD is disabled

      <custom-attributes org.zkoss.zul.listbox.rod="false"/>
      

      Root Cause

      when calling self.focus() the AuFocus response object is correctly added to the reponses
      https://github.com/zkoss/zk/blob/master/zk/src/org/zkoss/zk/ui/impl/UiVisualizer.java#L421

      when rendering the response it get's removed during doCrop()
      https://github.com/zkoss/zk/blob/master/zk/src/org/zkoss/zk/ui/impl/UiVisualizer.java#L654

      Workaround

      1. disable ROD
      2. with ROD enabled: focussing the textbox directly using JS will prevent the response from being filtered out

      Clients.evalJavaScript("zk.$('#" + self.getUuid() + "').focus();");
      

        Issue Links

          Activity

          Hide
          Anonymous added a comment -

          Fixed since 2018/04/24

          Show
          Anonymous added a comment - Fixed since 2018/04/24

            People

            • Assignee:
              DevChu DevChu
              Reporter:
              cor3000 cor3000
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1 day, 4 hours
                1d 4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours Time Not Required
                4h