1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    62
    Vote Rating
    0
    maqjav is on a distinguished road

      0  

    Default Render XComboBox

    Render XComboBox


    Hello.

    I am using the component posted here http://www.extjs.com/forum/showthread.php?t=73726 and I've been a couple of days trying to fix a problem but I don't find the solution... maybe somebody can help me with it.

    The thing is that I have a grid with datas and a XComboBox.
    When I click on a row, the datas are loaded to my XComboBox but if I didn't expand it before, when I click on it, the checkboxes appear not checked.

    I've modified it to show the label correctly in the textfield with the datas suppostly loaded, but only that, if I use getSelected it returns null, so it seems the setSelected doesn't work before expand the component.

    Some ideas about what can I do?.

    Thanks.

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    62
    Vote Rating
    0
    maqjav is on a distinguished road

      0  

    Default


    Hello again...

    I could fix it adding the next function:
    Code:
    public void setSelectionIni(List<D> selection) {		
    
    		clearSelections();
    		
    		//super.focus();
    		super.onFocus(null);
    		super.doQuery("", true);
    		super.getInputEl().focus();
    			
    		setSelection(selection);
    			
    		collapse();
    	}
    With this change my combo is always checked as it should be but... there is one more problem.
    I can edit rows in my Grid, so I am taking the XComboBox datas and the Store of my Grid and then in a new View (I am using GWTruts) I make the changes to the Store.

    After this if I click in the row already edited it doesn't check anything. I can click in all the rows and come back, it never will check the checkboxes.
    The same happends if I add a new row.

    I've checked if the datas are right and they are.

    In the function setSelection it receives all the datas but when it calls the collapse function and uses getSelection it returns null, so my combo is empty again.


    I hope someone can help me.

    Thank you.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    62
    Vote Rating
    0
    maqjav is on a distinguished road

      0  

    Default


    Well it seems that if I modify the Store from the Grid the XComboBox stops working.
    It keeps showing checked the registers I loaded at the beggining in the Store, but even those when I try to edit them the getSelected returns null for all the checkboxes.

    Maybe someone can give me more ideas?.

    Thanks.

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Posts
    62
    Vote Rating
    0
    maqjav is on a distinguished road

      0  

    Default


    I've been reading in some posts about what's the most likely problem.
    I found some places where they say that the setChecked method of CheckBoxListView is not working properly.

    It would explain why setSelection returns always null, but I can't understand why it worked the first time.

    I am using GXT 2.1.1, is there someone who can confirm this error?

    Thank you.

  5. #5
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Quote Originally Posted by maqjav View Post
    I've been reading in some posts about what's the most likely problem.
    I found some places where they say that the setChecked method of CheckBoxListView is not working properly.

    It would explain why setSelection returns always null, but I can't understand why it worked the first time.

    I am using GXT 2.1.1, is there someone who can confirm this error?

    Thank you.
    The setChecked not working problem is already fixed in SVN and will be part of 2.1.3 which will be released soon

Thread Participants: 1