Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    32
    Vote Rating
    0
    lichnost is on a distinguished road

      0  

    Default ComboBox.getValue return null after binding???

    ComboBox.getValue return null after binding???


    When I call ComboBox.getValue() just after binding, it return null however ComboBox.value field not null. If I select then something selected value returns as well.

    Here is the example

    Code:
        public void onModuleLoad() {
    
            TestBean bean = new TestBean();
            bean.setName("Main bean");
            
            TestBean nestedBean = new TestBean();
            nestedBean.setName("Nested bean");
            bean.setNested(nestedBean);
        
         
               FormPanel form = new FormPanel();
            final TextField<String> nameField = new TextField<String>();
            nameField.setFieldLabel("Name");
            form.add(nameField);
            
            final ComboBox<BeanModel> combo = new ComboBox<BeanModel>();
            ListStore<BeanModel> store = new ListStore<BeanModel>();
            
            TestBean comboBean = new TestBean();
            comboBean.setName("Nested bean 2");
            store.add(BeanModelLookup.get().getFactory(TestBean.class).createModel(comboBean));
            
            comboBean = new TestBean();
            comboBean.setName("Nested bean 3");
            store.add(BeanModelLookup.get().getFactory(TestBean.class).createModel(comboBean));
            
            combo.setStore(store);
            combo.setFieldLabel("Nested");
            combo.setDisplayField("name");
            form.add(combo);
            
            final Bindings bindings = new Bindings();
            bindings.addFieldBinding(new FieldBinding(nameField,"name"));
            bindings.addFieldBinding(new FieldBinding(combo,"nested"));
            bindings.bind(BeanModelLookup.get().getFactory(TestBean.class).createModel(bean));
            RootPanel.get().add(form);
            
            Button initBtn = new Button("Init", new SelectionListener<ComponentEvent>(){
    
                @Override
                public void componentSelected(ComponentEvent ce) {
                    TestBean bean = new TestBean();
                    bean.setName("Main bean");
                    
                    TestBean nestedBean = new TestBean();
                    nestedBean.setName("Nested bean");
                    bean.setNested(nestedBean);
                    
                    bindings.bind(BeanModelLookup.get().getFactory(TestBean.class).createModel(bean));
                }
                
            });
            RootPanel.get().add(initBtn);
            
            Button changeBtn = new Button("Check combobox", new SelectionListener<ComponentEvent>(){
    
                @Override
                public void componentSelected(ComponentEvent ce) {
                    if(combo.getValue()==null)
                        combo.markInvalid(null);
                    else Info.display("Yeah!!", "All right");
                    if(nameField.getValue()==null)
                        nameField.markInvalid(null);
                }
                
            });
            RootPanel.get().add(changeBtn);
        }
    Any suggestions?
    Best regards
    Pavel

  2. #2
    Software Architect
    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


    Post some complete example, also with your TestBean class.

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    32
    Vote Rating
    0
    lichnost is on a distinguished road

      0  

    Default


    Here is it

    Code:
    public class TestBean implements BeanModelTag, Serializable{
        
        /**
         * 
         */
        private static final long serialVersionUID = 1L;
    
        private TestBean nested;
        
        private String name;
    
        public void setName(String name) {
            this.name = name;
        }
    
        public String getName() {
            return name;
        }
    
        public void setNested(TestBean nested) {
            this.nested = nested;
        }
    
        public TestBean getNested() {
            return nested;
        }
        
    }
    Best regards
    Pavel

  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239
    Vote Rating
    0
    kolli is on a distinguished road

      0  

    Default


    Are you selecting an item from the combo Box before clicking the changeBtn?? As it returns null if a value is not selected before.

  5. #5
    Software Architect
    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


    I looked into this and maybe found the reason and we will fix it.

  6. #6
    Sencha User
    Join Date
    Aug 2008
    Posts
    32
    Vote Rating
    0
    lichnost is on a distinguished road

      0  

    Default


    Quote Originally Posted by kolli View Post
    Are you selecting an item from the combo Box before clicking the changeBtn?? As it returns null if a value is not selected before.
    Well.. if I'm not selecting an item, then it must return value binded with Bindings, right?
    Best regards
    Pavel

  7. #7
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239
    Vote Rating
    0
    kolli is on a distinguished road

      0  

    Default


    ooh i am really sorry i have no idea about bindings i will take a look into that..
    thanks

  8. #8
    Sencha User
    Join Date
    Aug 2008
    Posts
    32
    Vote Rating
    0
    lichnost is on a distinguished road

      0  

    Default


    any progress for this issue??
    Best regards
    Pavel

  9. #9
    Ext User
    Join Date
    Jun 2009
    Posts
    9
    Vote Rating
    0
    brginfo05 is on a distinguished road

      0  

    Default


    There is a hack you can do to by pass that problem. I´ll post my code as soon as i can.

  10. #10
    Ext User
    Join Date
    Jun 2009
    Posts
    9
    Vote Rating
    0
    brginfo05 is on a distinguished road

      0  

    Default


    Forget my hack, its too unstable. Some times work sometimes dont.