Tuesday, April 30, 2013

ZK MVVM: Show Validation Message in Modal Window



Simple Note

Introduction

This article describe how to display validation message in a modal window, this is a custom way to simulate the EE only feature so just simple note.

NOTE: It is better to buy a ZK EE License and use the official feature for better stability.

The Result

View demo on line
http://screencast.com/t/zuHrho5u3

The Program

MVVM_Show_Validation_Message_in_Modal_Window.zul
https://github.com/benbai123/ZK_Practice/blob/master/Pattern/MVVM/AdvancedMVVM/WebContent/MVVM_Show_Validation_Message_in_Modal_Window.zul

ShowMessageInModalWinTestVM.java
https://github.com/benbai123/ZK_Practice/blob/master/Pattern/MVVM/AdvancedMVVM/src/blog/ben/test/mvvm/formbinding/ShowMessageInModalWinTestVM.java

Reference

Related thread on forum
http://forum.zkoss.org/question/86565/mvvm-form-binding-validator/

AbstractValidator.java
https://github.com/zkoss/zk/blob/v6.5.1.1/zkbind/src/org/zkoss/bind/validator/AbstractValidator.java#L67

16 comments:

  1. can i use zk framework for commercial website in free.

    ReplyDelete
    Replies
    1. You can use ZK CE, just need to open source to whom you delivered (follow GPL)

      Delete
  2. can i view excel file in iframe.

    when i want to view excel file in iframe it's automatically download. how to view excel,word file in viewable mode.

    ReplyDelete
    Replies
    1. What is your testing browser?

      Delete
    2. seems it is the spec now, refer to

      http://stackoverflow.com/questions/13525404/displaying-excel-page-in-iframe-not-possible

      Delete
  3. can i scroll menu pupup. i want to display after 10 menu item it should be scroll.

    ReplyDelete
    Replies
    1. you can try set a fixed height if a menupopup has lots of children

      e.g.,

      <menupopup onCreate='if (self.getChildren().size() > 3) {self.setHeight("75px"); self.setStyle("overflow: auto;");}'>

      Delete
    2. it use zscript but we are not recommend zscript i our production server.

      Delete
    3. thank you. I have done using java code.but zk has issue with menu popup because when getting too many menu items it over ride below page. it should be scroll according to window size.

      Delete
    4. do you mean adjust the height of menupopup to prevent it causes vertical scrollbar?

      Delete

    5. try this:

      https://gist.github.com/benbai123/5704968

      Delete