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

conditional native rendering problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.0
    • 6.0.0, 8.5.2.1
    • Components
    • Security Level: Jimmy
    • ZK 8.6.0 S2

      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)

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

              Created:
              Updated:
              Resolved:

                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