View Poll Results: Change the method setValue(boolean) to setValue(String) and add the method setChecked

Voters
10. You may not vote on this poll
  • Yes

    10 100.00%
  • No

    0 0%
Results 1 to 3 of 3

Thread: Radio.setValueAux(String value)

  1. #1
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744

    Default Radio.setValueAux(String value)

    If you need set the other value to your com.extjs.gxt.ui.client.widget.form.Radio that isn't the boxLabel.

    MyRadio.java
    Code:
    import com.extjs.gxt.ui.client.widget.form.Radio;
    
    public class MyRadio extends Radio {
    
    	private String valueAux;
    
    	public SfRadio() {
    
    	}
    
    	/*
    	 * (non-Javadoc)
    	 * @see com.extjs.gxt.ui.client.widget.BoxComponent#afterRender()
    	 */
    	@Override
    	protected void afterRender() {
    		setNewValue();
    	}
    
    	/**
    	 * Real value of radio.
    	 * 
    	 * @return value of radio.
    	 * @since 1.0
    	 */
    	public String getValueAux() {
    		return valueAux;
    	}
    
    	private void setNewValue() {
    
    		if (valueAux != null) {
    
    			getInputEl().dom.setAttribute("value", valueAux);
    
    		}
    	}
    
    	/**
    	 * Set the new value to radio.
    	 * 
    	 * @param valueAux new value.
    	 * @since 1.0
    	 */
    	public void setValueAux(String valueAux) {
    		this.valueAux = valueAux;
    	}
    
    }
    Example
    Code:
    	public void onModuleLoad() {
    
    		FormPanel form = new FormPanel();
    
    		final SfRadio radio = new SfRadio();
    		radio.setName("radio");
    		radio.setBoxLabel("Red");
    		radio.setValue(true);
    		radio.setValueAux("1");
    
    		SfRadio radio2 = new SfRadio();
    		radio2.setName("radio");
    		radio2.setBoxLabel("Blue");
    		radio2.setValueAux("2");
    
    		RadioGroup radioGroup = new RadioGroup("test");
    		radioGroup.setFieldLabel("Favorite Color");
    		radioGroup.add(radio);
    		radioGroup.add(radio2);
    		form.add(radioGroup);
    
    		RootPanel.get().add(form);
    
    	}
    History
    07/01/09 - Remove the Listener and create an example

  2. #2
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744

    Default

    thanks to implement this.. in 1.2.3 you can see that to combobox this method was added.. setValueAttribute

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •