Announcement

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

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

    #2
    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; 26 Apr 2012, 08:39. Reason: Forget to add title :)

    Comment


      #3
      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; 27 Apr 2012, 21:28.

      Comment


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

        Comment


          #5
          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"}); }
          }
          ]
          });

          Comment

          Working...
          X