Augmenting the calendar widget in ZK Studio 5.0

In an acquired RESTful Spring Boot Web application, there are some restrictions I currently cannot change. The code partly uses Java 1.6, the rest is Java 17. And the ZK Studio has the version 5.0 and cannot be upgraded without encountering problems. This was at least the statement from my predecessor. The server is running on a VM with Linux.

What I want to do is to augment the calendar widget of the ZK Studio with a week-of-year column. This updated widget is already built in from version 6.5 on, but I am bound to v5.0. 🙁

To implement it by myself, I made the following changes:

..workflowzk-components.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<zk>
    <component>
        <component-name>customCalendar</component-name>
    <component-class>at.cps.oflow.utils.CustomCalendar</component-class>
    </component>
</zk>

..workflow240la_erfassung.zul:

<zk>
    <import src="../zk-components.xml"/>
    <component>
        <component-name>customCalendar</component-name>
        <component-class>at.cps.oflow.utils.CustomCalendar</component-class>
        </component>
        <window border="none" id="ls_erfassung">
             <grid>
                  <row>
                       <cell>
                             <label>Date:</label>
                       </cell>
                       <cell>
                            <customCalendar id="datum" value="@{actcontroller.actVars.datum}" constraint="no empty"/>
                       </cell>
                   </row>
                   …
             </grid>
      </window>
</zk>

CustomCalendar.java:

package at.cps.oflow.utils;

import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;

import org.zkoss.zk.ui.sys.*;

public class CustomCalendar extends org.zkoss.zul.Calendar {

    @Override
    protected void renderProperties(final ContentRenderer renderer) throws IOException {
        super.renderProperties(renderer);
        // Add code for the week of year
        final Calendar cal = new GregorianCalendar();
        final int week = cal.get(Calendar.WEEK_OF_YEAR);

        renderer.render("weekNumber", week);
    }

}

Obviously, I have forgotten something. Actually, it is the first try to work with the MVVM paradigm and with ZK Studio. When I run the application, an error showed that it couldn’t find the file ..zk-components.xml:

So I decided to add the code directly into the ZUL file:

..workflow240la_erfassung.zul:

<zk>
    <!--import src="../zk-components.xml"/-->
    <component>
        <component-name>customCalendar</component-name>
        <component-class>at.cps.oflow.utils.CustomCalendar</component-class>
    </component>
    <window border="none" id="ls_erfassung">
        <grid>
              <row>
                   <cell>
                        <label>Date:</label>
                    </cell>
                    <cell>
                        <customCalendar id="datum" value="@{actcontroller.actVars.datum}" constraint="no empty"/>
                    </cell>
               </row>
               …
        </grid>
    </window>
</zk>

But still, I get an error:

Column 3 line 16 in the ZUL file is the end of the tag <component>. Can you tell me what I have forgotten to add?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật