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

Turn a text into an HTML element only

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 9.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Use Case

      A text in a zul is turned into a Label component.

      <zk>
      mylabel
      </zk>
      

      EL expression ${page} is also in the same situation.

      In most cases, application developers don't intend to change such static text value dynamically since they write in a pure text.
      The Label is largely used in almost every page e.g. in a form, the label for an input field doesn't change dynamically. Even there are only 5 labels on a page, but 100 users visit the same page will produce 5*100 unnecessary label components.

      drawback

      • if no dynamically change is needed, it's a waste of memory.

      alternative

      The native element like <n:span class="z-label">mylabel</n:span> can do the same work but it's more inconvenient.

      Proposed Solution

      turn the text into an HTML span, no Label Java component and Label widget, neither. Still apply z-label to keep the consistent style as ZK <label>.

      <span class='z-label'>mylabel<span>
      

      Consider to create a library property to determine such text conversion behavior ( to a Label or HTML span only)

      This solution could cause a back-compatibility issue, if you find it, please list it.

      advantage

      1. save both server and client memory

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: