Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26th Apr 2012, 03:05
vgattani vgattani is offline
Registered Developer
 
Join Date: Feb 2008
Posts: 114
Default Insert a select box in between the radio options.

In SmartClient whenever I use radio group, I specify a value map, all the radio options are displayed together (one after other) in order as they are mentioned in value map.
Is there any way by which I can insert any other component in between these options?
I want something like, 1st radio option then a select box, 2nd option then a select box and so on...
Reply With Quote
  #2  
Old 26th Apr 2012, 09:38
sverma sverma is offline
Registered Developer
 
Join Date: Sep 2008
Posts: 7
Default SmartClient: Insert controls between radio items

Hi vgattani,

Please visit my blog for the solution.
http://sv-technical.blogspot.in/2012...s-between.html

I am also pasting the excerpt of the code for your ready reference.


isc.DynamicForm.create ({
autoDraw: true,
fields: [
{
name: "Radio",
title: "Title One",
type: "radioGroup",
valueMap: {"1":"Yes"}
},
{
name: "Shailendra",
defaultValue: "Enjoy"
},
{
name: "Radio",
title: "Title Two",
type: "radioGroup",
valueMap: {"2":"No"}
}
]
});

Last edited by sverma; 26th Apr 2012 at 09:39.. Reason: Forget to add title :)
Reply With Quote
  #3  
Old 27th Apr 2012, 20:45
yang.xin yang.xin is offline
Registered Developer
 
Join Date: Dec 2010
Posts: 7
Default

Hi Sverma,
Code:
var radioForm = isc.DynamicForm.create ({
    autoDraw: true,
    numCols : 3,
    cellPadding : 2,    
    fields : [       
              {
                title:"Itema",
                type:"radioGroup",
                name:"radio",
                valueMap: 
                        {
                          "a":""
                        },
                showTitle:false
              } ,
              {
                title:"Itemb",
                type:"radioGroup",
                name:"radio",
                valueMap:
                       {
                         "b":""
                       },
                showTitle:false
              } ,
              {
                title:"Itemc",
                type:"radioGroup",
                name:"radio",
                valueMap:
                       {
                         "c":""
                       },
               showTitle:false
             } 
         ]    
});
radioForm.getValue("radio"); success to get current selected value.

radioForm.setValue("radio","b"); or
radioForm.setValue("radio",{"b":""}) fail to set current value.
why?
The correct what should I do?

ths.

Last edited by yang.xin; 27th Apr 2012 at 22:28..
Reply With Quote
  #4  
Old 27th Apr 2012, 23:07
yang.xin yang.xin is offline
Registered Developer
 
Join Date: Dec 2010
Posts: 7
Default

Hi Sverma,
Code:
var radioForm = isc.DynamicForm.create ({
    autoDraw: true,
    numCols : 3,
    cellPadding : 2,    
    fields : [       
              {
                title:"Itema",
                type:"radioGroup",
                name:"radio",
                valueMap: 
                        {
                          "a":""
                        },
                showTitle:false
              } ,
              {
                title:"Itemb",
                type:"radioGroup",
                name:"radio",
                valueMap:
                       {
                         "b":""
                       },
                showTitle:false
              } ,
              {
                title:"Itemc",
                type:"radioGroup",
                name:"radio",
                valueMap:
                       {
                         "c":""
                       },
               showTitle:false
             } 
         ]    
});
radioForm.getValue("radio"); success to get current selected value.

radioForm.setValue("radio","b"); or
radioForm.setValue("radio",{"b":""}) fail to set current value.
why?
The correct what should I do?

ths
Attached Images
File Type: jpg 123.JPG (6.5 KB, 6 views)
Reply With Quote
  #5  
Old 28th Apr 2012, 00:16
sverma sverma is offline
Registered Developer
 
Join Date: Sep 2008
Posts: 7
Default

try this:

setValue is causing some ambiguity and you need to handle this via changeHandler.

function t (form, item, value, oldValue) {
form.getItem ("Radio2").clearValue ();
}

function t1 (form, item, value, oldValue) {
form.getItem ("Radio1").clearValue ();
}

isc.DynamicForm.create ({
ID: "dd",
autoDraw: true,
fields: [
{
name: "Radio1",
title: "Title One",
type: "radioGroup",
redrawOnChange:true,
change: function (form, item, value, oldValue) {t (form, item, value, oldValue);},
valueMap: ["Yes"]
//valueMap: {"1":"Yes"}
},
{
name: "Shailendra",
defaultValue: "Enjoy"
},
{
name: "Radio2",
title: "Title Two",
type: "radioGroup",
redrawOnChange:true,
change: function (form, item, value, oldValue) {t1 (form, item, value, oldValue);},
valueMap: ["No"]
//valueMap: {"2":"No"}
},
{
name: "bb",
title: "bbbbb",
type: "button",
click: function (form, item) {form.setValues ({"Shailendra": "have fun", "Radio1": "Yes"}); }
}
]
});
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
setOptionalDataSource on ComboboxItem fires queries rapidly. Is this a bug? curiousgally Smart GWT Technical Q&A 3 30th Nov 2011 10:46
Datasource used for two selectitem with different fetch operations works unexpectedly curiousgally Smart GWT Technical Q&A 2 18th Nov 2011 15:13
Can we have select all check box option in multiple select item in smartgwt-2.2 kodanhunt Smart GWT Technical Q&A 1 8th Jul 2010 10:05
how select radio button dynamically prabu_dvk Technical Q&A 2 8th Dec 2008 00:42
how to get select box and text box intact vidyab Technical Q&A 1 26th Nov 2008 05:45

© 2010,2011 Isomorphic Software. All Rights Reserved