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

<choose> w/o <otherwise> inconsistent behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.1
    • 8.5.0
    • Databind 2
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      run the attached example choose-when-without-otherwise-ZK-3830.zul
      choose "green" from the combobox
      choose "red" from the combobox
      choose "other" from the combobox

      Current Result

      green -> green button is rendered OK
      red -> red button is rendered OK
      other -> the previously rendered button remains

      Expected Result

      consistent behavior:
      green -> green button
      red -> red button
      other -> no button at all

      OR

      in case <otherwise> is a mandatory element (for a technical reason) throw an exception to indicate incorrect usage

      Debug Info

      when setting the initial status value to anything other than red/green no button is rendered as expected.
      Only when switching from a matching <when> block back to a non matching value the previous <when> block remains

      Workaround

      1) add an empty <otherwise/> element
      2) surround the whole <choose> element with an <apply> to re-render the whole <choose> element and contents (like initial rendering)

            klyvechen klyvechen
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified