1. #1
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default [FIXED] ComboBox issue setValue to hidden field

    [FIXED] ComboBox issue setValue to hidden field


    when set a value to combobox the hidden field don't received the value.. I need select the item in combobox to my hidden field receveid the value.. the problem:

    my form have a combobox that have the country that the person live.. when the user go update your profile.. I need reset this field and do the user to select you country again...

    Code:
    		ListStore<TestModel> store = new ListStore<TestModel>();
    
    		TestModel model = new TestModel();
    		model.setCodigo(1);
    		model.setNome("name 1");
    
    		TestModel model1 = new TestModel();
    		model1.setCodigo(2);
    		model1.setNome("name 2");
    
    		store.add(model);
    		store.add(model1);
    
    		FormPanel form = new FormPanel();
    
    		ComboBox<TestModel> combo = new ComboBox<TestModel>();
    		combo.setStore(store);
    		combo.setFieldLabel("xxx");
    		combo.setDisplayField("nome");
    		combo.setValueField("codigo");
    		combo.setName("comboBox");
    		combo.setValue(model);
    
    		form.add(combo);
    
    		RootPanel.get().add(form);
    TestModel.java
    Code:
    public class TestModel extends BaseModel {
    
    	public Integer getCodigo() {
    		return get("codigo");
    	}
    
    	public String getNome() {
    		return get("nome");
    	}
    
    	public void setCodigo(Integer codigo) {
    		set("codigo", codigo);
    	}
    
    	public void setNome(String nome) {
    		set("nome", nome);
    	}
    
    }

  2. #2
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    wait.. setValueField() ???? I will test

  3. #3
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    add to the code, and you can see that the hidden field continue with the value empty..

    Code:
    combo.setValueField(model.getCodigo().toString());

  4. #4
    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


    Thanks for reporting.

  5. #5
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    In combobox...

    Code:
    private String loadingText = "Loading...";
    ????

    in properties..

    Code:
    # ComboBox
    comboBox_loading=Loading...

  6. #6
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    to solve this problem....


    Code:
        if (valueField != null) {
          hiddenInput = Document.get().createHiddenInputElement().cast();
          hiddenInput.setName(getName() + "-hidden");
          parent.appendChild(hiddenInput);
          updateHiddenValue(); // add this line or use other logic
        }

  7. #7
    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


    We already have a fix for this ready. Your suggested fix isnt fixing the hole issue.

  8. #8
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    hmm...

  9. #9
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    now appears other problem..

    Code:
    	public void onModuleLoad() {
    
    		ListStore<TestModel> store = new ListStore<TestModel>();
    
    		TestModel model = new TestModel();
    		model.setCodigo(1);
    		model.setNome("name 1");
    
    		TestModel model1 = new TestModel();
    		model1.setCodigo(2);
    		model1.setNome("name 2");
    
    		store.add(model);
    		store.add(model1);
    
    		final FormPanel form = new FormPanel();
    		form.setAction("Example");
    		form.setMethod(Method.POST);
    
    		ComboBox<TestModel> combo = new ComboBox<TestModel>();
    		combo.setStore(store);
    		combo.setFieldLabel("xxx");
    		combo.setDisplayField("nome");
    		combo.setValueField("codigo");
    		combo.setName("comboBox");
    		combo.setValue(model);
    		combo.setValueField(model.getCodigo().toString());
    
    		Button button = new Button("button");
    		button.addSelectionListener(new SelectionListener<ComponentEvent>() {
    
    			@Override
    			public void componentSelected(ComponentEvent ce) {
    
    				form.submit();
    
    			}
    
    		});
    
    		form.add(combo);
    		form.add(button);
    
    		RootPanel.get().add(form);
    	}
    Example.java
    Code:
    	@Override
    	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
    		System.out.println(request.getAttribute("comboBox-hidden"));
    
    	}
    Click to the button, return null. OK - the bug
    Change to "name 2" in combo box, click to the button, return null..

    You can test too, with your new code this? Because when the user will go update your profile.. he can't more save... same change the value.

    thanks

  10. #10
    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


    As i told you. Your suggested fix isnt fixing the hole issue...

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi