cancel
Showing results for 
Search instead for 
Did you mean: 

SMP Issue

Former Member
0 Kudos

am working on hybrid app in SMP 2.3:

have some issue on  it .

run the app first time select the choice field it will show at  empty after click on outer space and then click the choice field again it shows the data
but my need is first time to select the choice field it shows the data pls help its urgent

i need  some documents on SMP 2.3 for development purpose

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Any idea to clear on this issue. because till now i didn't get any solution on that choice field problem

midhun_vp
Active Contributor
0 Kudos

Inside which method you added this code ?

Midhun VP

Former Member
0 Kudos

this all  js coding added into  custom .js i can call some OData also.

html coding added into jqm_html file 

Former Member
0 Kudos

If I understand correctly, you want to populate a choice field with options.  If so, don't you want to move the retrieval of the <select> element outside of your for loop?  E.g.:

CommonNamespace.Fillregion_dd = function()  {

  if(Region.length > 0){

      var region_dd = document.getElementById("Reg");

      for ( var i = 0; i < Region.length; i++) {

          var region_opt = document.createElement("option");

          if (Region[i].parent == "AllRegion") {

            region_opt.text = Region[i].desc;//

            region_opt.value = Region[i].id;

            // Region[i].id;

            region_dd.options.add(region_opt);

          }

      }//For

  }

};

Thanks,

Andrew.

Former Member
0 Kudos

thanks for ur reply, it didn't work

but in my case i created custom html coding on hypridapp_jqm.html

for dropdownlist and added value in odata using javascript

but in my case first time i will select that field shows empty after click again it shows the data

Former Member
0 Kudos

Where is CommonNamespace.Fillregion_dd() being called in your code?

Former Member
0 Kudos

in custom.js this is my coding:

CommonNamespace.select=function ()

{

  OData.read({requestUri: requestUri_getSelection, user: "fff", password: "ff"},

  function(data) {

    if(data.results.length > 0){

  for ( var i = 0; i < data.results.length; i++) {

// Region & Sub Region

  if(data.results[i].ID != ""){

  var Region_obj = {parent : data.results[i].Parenth1, id : data.results[i].ID, desc : data.results[i].Evdescription };

  Region.push(Region_obj);

CommonNamespace.Fillregion_dd();

  }

//Function to Fill Region dropdown

CommonNamespace.Fillregion_dd = function()  {

  if(Region.length > 0){

  for ( var i = 0; i < Region.length; i++) {

  var region_dd = document.getElementById("Region");

  var region_opt = document.createElement("option");

  if (Region[i].parent == "AllRegion") {

  region_opt.text = Region[i].desc;//

  region_opt.value = Region[i].id;

// Region[i].id;

  region_dd.options.add(region_opt);

  }

//

  }//For

  }

};

and my html codi on hypridapp_jqm.html:

  <div data-role="fieldcontain" style="border-bottom-width: 0px;"

  class="containing-element">

  <label class="left" for="Region">Region*</label> <select

  class="right" id="Region" sup_num_of_decimals="0"

  sup_html_type="text" sup_static_options="true">

  <option value="Select">--Select--</option>

  </select><span id="Budget_Analyzer1_Region_help" class="help"></span>

  </div>

Former Member
0 Kudos

HTMl code: <div data-role="fieldcontain"  style="border-bottom-width: 0px;"  class="containing-element">

          <label class="left" for="Reg">Reg*</label>

            <select class="right" id="Reg" sup_num_of_decimals="0" sup_html_type="text"  sup_static_options="true" >           

                  <option value="Select">--Select--</option>  </select><span id="bb" class="help"></span>

          </div>

js code:

CommonNamespace.Fillregion_dd = function()  {

  if(Region.length > 0){

  for ( var i = 0; i < Region.length; i++) {

  var region_dd = document.getElementById("Reg");

  var region_opt = document.createElement("option");

  if (Region[i].parent == "AllRegion") {

  region_opt.text = Region[i].desc;//

  region_opt.value = Region[i].id;

// Region[i].id;

  region_dd.options.add(region_opt);

  }

//

  }//For

  }

};

Former Member
0 Kudos

have written some js code and html coding for fill the value on choice field

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Please share complete information. Share what all you have done.. what exactly you have written in your code

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Mani,

Can you please share the settings details what you have done for choice control? Have you written any piece of code for this functionality? If yes, please share.

For SMP 2.3 hybrid app development, you can refer

Tutorial: Hybrid App Package Development 2.3

Rgrds,

Jitendra