Revision history [back]

click to hide/show revision 1
initial version

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

onsir gravatar image onsir

Setfocus in listcell

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);
           }}); 

  }

}

Thanks

Setfocus in listcell

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

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