Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Radio group item

    Hi,
    I have question about RadioGroupItem. I would like to create form with two columns of radio buttons, as you can see on picture. Have you any idea how to do it?

    Thanks
    Attached Files

    #2
    There is no direct way to do it, you could extend the CanvasItem and basically have two seperate RadioGroupItem's to get the look but then you would need to add logic to make sure only one item is selected. Anyway here is how it would be, but not an ideal solution:
    Code:
    public void onModuleLoad() { 
    	DynamicForm form = new DynamicForm();
    	myRadioItem i = new myRadioItem();
    	form.setItems(i);
    	form.draw();
    }
    
    public class myRadioItem extends CanvasItem {
    	RadioGroupItem r1 = null;
    	RadioGroupItem r2 = null;
    	
    	public myRadioItem() {
    		DynamicForm form = new DynamicForm();
    		form.setNumCols(2);
    		
    		RadioGroupItem r1 = new RadioGroupItem();
    		r1.setValueMap("A", "B", "C", "D", "E", "F");
    		r1.setVertical(true);
    		r1.setShowTitle(false);
        	
        	RadioGroupItem r2 = new RadioGroupItem();
        	r2.setValueMap("G", "H", "I", "J", "K");
        	r2.setVertical(true);
        	r2.setShowTitle(false);
        	
        	setTitle("Options");
        	
        	form.setItems(r1, r2);
        	
        	setCanvas(form);
    	}
    };
    Attached Files

    Comment

    Working...
    X