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

conditional native rendering problems

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.0.0, 8.5.2.1
    • Fix Version/s: 8.6.0
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 8.6.0 S2

      Description

      Steps to Reproduce

      run the example native-zk-if.zul

      Current Result

      the red label component in the 4th div doesn't render even though the condition around it is true <zk if="true"> in the lines above this problem doesn't occur

      Expected Result

      all labels (zk components inside native elements render correctly)

      Debug Info

      it seems only the last zk component inside native elements is affected (adding an additional unconditional zk component at the end fixes the problem - commented out in the example)

      Root Cause

      native elements compress into a single zk.Native widget with prolog/epilog, the last conditional <zk> element is missed somehow in this process

      Workaround

      1. don't use <zk if=> within native element and add the condition directly to the native element

      instead of

      	<zk if="${true}">
      		<n:div>Visible
      			<label value="ZK label" style="color:red"/>
      		</n:div>
      	</zk>
      

      use

      	<n:div if="true">Visible
      		<label value="ZK label" style="color:red"/>
      	</n:div>
      

      2. (Alternative) add a <nodom> as the last child of the parent native element (commented out in attachment native-zk-if.zul)

        Activity

        Show
        cor3000 cor3000 added a comment - - edited related forum post: http://forum.zkoss.org/question/110549/weird-bug-with-native-html-and-zk-if/ stackoverflow https://stackoverflow.com/questions/52271574/weird-bug-with-native-html-and-zk-if/52312439#52312439
        Hide
        Anonymous added a comment -

        Fixed since 2018/09/14

        Show
        Anonymous added a comment - Fixed since 2018/09/14

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 day
              1d
              Remaining:
              Time Spent - 4 hours Remaining Estimate - 4 hours
              4h
              Logged:
              Time Spent - 4 hours Remaining Estimate - 4 hours
              4h

                Agile