PDA

View Full Version : Render XComboBox



maqjav
8 Apr 2010, 2:04 AM
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.

maqjav
8 Apr 2010, 5:01 AM
Hello again...

I could fix it adding the next function:

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.

maqjav
9 Apr 2010, 12:37 AM
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.

maqjav
12 Apr 2010, 10:49 AM
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.

sven
12 Apr 2010, 10:50 AM
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