1

Problem:

I was going through SmartClient forum and read one problem (here is the link) stating as:

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

Solution:

I tried some of the options and played around some tweaks. What I get is, if you keep the name of radio group item same and then pass on same item to your dynamic form control with different valueMap you can achieve this. I understand, some thing hard to imagine without code :). So, here we go ....

But wait :) .... don't worry I will share the code, but I just want to show the result first.

Result:

enter image description here

Code:

<HTML>
<HEAD>
<SCRIPT>var isomorphicDir = "../content/isomorphic/";</SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_Core.js"></SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_Foundation.js"></SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_Containers.js"></SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_Grids.js"></SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_Forms.js"></SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_DataBinding.js"></SCRIPT>
<SCRIPT SRC="../content/isomorphic/system/modules/ISC_PluginBridges.js"></SCRIPT>
<SCRIPT SRC="sc_common.js"></SCRIPT>


<!-- Isomorphic Skin -->
<SCRIPT SRC="../content/isomorphic/skins/SilverWave/load_skin.js"></SCRIPT>
</HEAD>


<BODY>
<!-- $Id: cm_admin.js 875 2006-11-17 23:34:46Z sverma $ . -->
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">




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


</SCRIPT>


</BODY>
</HTML>
Jonas
  • 121,568
  • 97
  • 310
  • 388
shaILU
  • 2,050
  • 3
  • 21
  • 40

1 Answers1

1

the DynamicForm can also have an ID property for reference purposes, e.g

isc.DynamicForm.create ({
ID:"DynamicForm1",
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"}
     }
]

});

S34N
  • 7,469
  • 6
  • 34
  • 43