0

Readonly From Ctrl Class in ZK8

asked 2016-06-02 10:20:50 +0800

Pattu gravatar image Pattu
3 2

Hi all.I am trying to make my component readonly from ctrl class in ZK8.

Component_Id.setreadonly(true);

Like above have used,but can able to edit content..To make component readonly do i need to do anything else??

delete flag offensive retag edit

Comments

what component? for combobox you need to use disable also.

chillworld ( 2016-06-02 11:27:48 +0800 )edit

Hi Mr.chillworld..Components like textbox,Bandbox and combobox..For combo box i have used both readonly and also disable..Still i can able to edit.Is there any way to control it?(In zk6 its working fine but not in Zk8)

Pattu ( 2016-06-04 03:47:34 +0800 )edit

Hi Mr.Darksu,Same way i have tried.But facing issue in readonly.Is there any reason for not working?

Pattu ( 2016-06-04 11:22:03 +0800 )edit

Create an example or share some more code please

chillworld ( 2016-06-04 18:18:29 +0800 )edit

My code:(In ZUL) <row> <label id="labelGenericNameDialogDesc" value="${c:l('labelGenericNameDialogDesc.value')}" /> <hbox> <textbox id="genericNameDesc" rows="3" width="300px" /> <label value="*" sclass="labelasteric" /> </hbox> </row

Pattu ( 2016-06-05 04:48:05 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-06-04 08:32:03 +0800

Darksu gravatar image Darksu
1991 1 4

Hello Pattu,

The sure thing is that if you set on the zul script or from java code the property readonly="true" it will work (tested in ZK 8).

Example:

<zk>
  <window border="normal" title="Readonly combobox" apply="pkg$.TestComposer">

    <div>Cannot narrow items by writing in Readonly combobox</div>

        <combobox id="cbx"  autocomplete="true">
          <comboitem value="aaaaaaaa" label="aaaaaaaa" />
          <comboitem value="aaaaaaab" label="aaaaaaab" />
          <comboitem value="aaaaaabb" label="aaaaaabb" />
          <comboitem value="aaaaabbb" label="aaaaabbb" />
          <comboitem value="aaaabbbb" label="aaaabbbb" />
          <comboitem value="aaabbbbb" label="aaabbbbb" />
          <comboitem value="aabbbbbb" label="aabbbbbb" />
          <comboitem value="abbbbbbb" label="abbbbbbb" />
          <comboitem value="aaaaaaac" label="aaaaaaac" />
          <comboitem value="aaaaaacc" label="aaaaaacc" />
          <comboitem value="aaaaaccc" label="aaaaaccc" />
        </combobox>

  </window>
</zk>


package pkg$;

import org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkoss.zk.ui.util.*;
import org.zkoss.zk.ui.ext.*;
import org.zkoss.zk.au.*;
import org.zkoss.zk.au.out.*;
import org.zkoss.zul.*;

public class TestComposer extends GenericForwardComposer{

    Combobox cbx;

    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
          cbx.setReadonly(true);

    }
}

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-06-02 10:20:50 +0800

Seen: 21 times

Last updated: Jun 04 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More