0

Setfocus in listcell

asked 2015-03-06 03:03:31 +0800

onsir gravatar image onsir
132 2

updated 2015-03-06 04:51:24 +0800

Hello,

I make data input using inline in listbox, User input in column/component txtDocumentNo, when moved to the next column, txtDocumentNo will visible false and documentNoCell will contain the value of txtDocumenNo.

but when i back cursor to column cmbType and move to next column use tab,

why the cursor not focus in column/component txtDocumentNo ? this my code.

public class InvoiceRender extends GenericForwardComposer implements ListitemRenderer<InvoiceTmp>{
  public void render(Listitem listitem, InvoiceTmp tmp1, int index)throws Exception {

            InvoiceTmp tmp= tmp1;

            final Listcell typeCell = new Listcell();
            final Combobox cmbType =new Combobox();

            final Listcell documentNoCell = new Listcell();
            final Textbox txtDocumentNo= new Textbox();

            txtDocumentNo.setParent(documentNoCell);
            txtDocumentNo.setVisible(false);

            final Listcell amountCell = new Listcell();
            final Doublebox dblAmount = new Doublebox();
            dblAmount.setParent(amountCell);

            listitem.appendChild(typeCell);
            listitem.appendChild(documentNoCell);
            listitem.appendChild(amountCell);
            listitem.setSelected(true);
            listitem.setValue(tmp);

            //hide txtDocumentNo
            txtDocumentNo.addEventListener(Events.ON_CHANGE, new EventListener() {
            @Override
            public void onEvent(Event event) throws Exception {
                   txtDocumentNo.setVisible(false);
                   documentNoCell.setLabel(txtDocumentNo.getValue());
            }});                

            //i will txtDocumentNo get focus
            cmbType.addEventListener(Events.ON_BLUR, new EventListener() {
            @Override
            public void onEvent(Event event) throws Exception {
                txtDocumentNo.setVisible(true);
                documentNoCell.setLabel("");
                txtDocumentNo.setFocus(true);
           }}); 


            documentNoCell.addEventListener(Events.ON_CLICK, new EventListener() {
            @Override
            public void onEvent(Event event) throws Exception {
                documentNoCell.setFocus(true);
                documentNoCell.setLabel("");
                txtDocumentNo.setVisible(true);
                txtDocumentNo.setFocus(true);
           }}); 

  }

}

I want like erp nav* Thanks

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-03-08 12:29:34 +0800

Darksu gravatar image Darksu
1991 1 4

Hello onsir,

You're case sounds very interesting.

First of all could you upload also your zul file so i can check it out?

Furthermore please add tabindex's to your components, and check out the following url:

http://zkfiddle.org/sample/357n1ej/2-tab-order-forward-events#source-1

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: 2015-03-06 03:03:31 +0800

Seen: 15 times

Last updated: Mar 08 '15

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