Use GetCheckedRadioButtonId() with an external radio group











up vote
1
down vote

favorite












I am a beginner in android development and am blocked on my project. I searched a solution all this morning and didn't find so here it is.



I have made a layout with a radiogroup and several radiobutton. I use it for different views of my project.



I didn't know that we can't find and element by its id from a view if this element is in an external view. So I searched a solution to "include" the layout with my radiogroup.



No problem with that, I get it with a LayoutInflater and can create the view of my layout.
Then I can get the radiogroup of this view.



The problem is that I can't manipulate it. The radiogroup is recognized but I can't get the checked radiobutton, it always return -1.



Here is the onCreate method, where the view is created.



protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add);

LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
View rank_W = inflater.inflate(R.layout.dialog_layout_w, (ViewGroup) findViewById(R.id.rank_w));
View rank_M = inflater.inflate(R.layout.dialog_layout, (ViewGroup) findViewById(R.id.rank_m));

// I also tried the commented way to make the view, it didn't change anything.

//viewRank = getLayoutInflater().inflate(R.layout.dialog_layout, null);
//viewRankW = getLayoutInflater().inflate(R.layout.dialog_layout_w, null);

tvT = findViewById(R.id.tv_T);
tvR = findViewById(R.id.tv_R);
dp = findViewById(R.id.dp);
rankM = findViewById(R.id.rankM);
rankW = findViewById(R.id.rankW);

rankM.setEnabled(false);
rankW.setEnabled(false);

gamesDB = new GamesDB(this);

rgT = findViewById(R.id.rg_t);
rgRM = rank_M.findViewById(R.id.rg_ranks);
rgRW = rank_W.findViewById(R.id.rg_ranksW);

rankM.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (rgT.getCheckedRadioButtonId() == R.id.rd_mm) {
rM = true;
dialogRank(view);

} else if (rgT.getCheckedRadioButtonId() == R.id.rd_wm) {
rM = true;
dialogRankW(view);
}
}
});
}


I try to get the checked radio button in the dialogRank(view) method, here it is :



public void dialogRank(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
LayoutInflater inflater = getLayoutInflater();
View dialogLayout = inflater.inflate(R.layout.dialog_layout, null);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//rgRM = rank_M.findViewById(R.id.rg_ranks);
int radioButtonID = rgRM.getCheckedRadioButtonId();
View radioButton = rgRM.findViewById(radioButtonID);
int idx = rgRM.indexOfChild(radioButton);
if (rM) {
newRankM = idx;
rM = false;
} else if (rW) {
newRankW = idx;
rW = false;
}
}
});
builder.setView(dialogLayout);
builder.show();
}


So in this method a dialog is opened with the list of the radio buttons and the goal for me is to get the index of the checked radiobutton when the user clicks on OK.
But idx returns -1.



I find nothing about external radio buttons, is there a solution to this ?



Thank you for reading (sorry for english).










share|improve this question


























    up vote
    1
    down vote

    favorite












    I am a beginner in android development and am blocked on my project. I searched a solution all this morning and didn't find so here it is.



    I have made a layout with a radiogroup and several radiobutton. I use it for different views of my project.



    I didn't know that we can't find and element by its id from a view if this element is in an external view. So I searched a solution to "include" the layout with my radiogroup.



    No problem with that, I get it with a LayoutInflater and can create the view of my layout.
    Then I can get the radiogroup of this view.



    The problem is that I can't manipulate it. The radiogroup is recognized but I can't get the checked radiobutton, it always return -1.



    Here is the onCreate method, where the view is created.



    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add);

    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View rank_W = inflater.inflate(R.layout.dialog_layout_w, (ViewGroup) findViewById(R.id.rank_w));
    View rank_M = inflater.inflate(R.layout.dialog_layout, (ViewGroup) findViewById(R.id.rank_m));

    // I also tried the commented way to make the view, it didn't change anything.

    //viewRank = getLayoutInflater().inflate(R.layout.dialog_layout, null);
    //viewRankW = getLayoutInflater().inflate(R.layout.dialog_layout_w, null);

    tvT = findViewById(R.id.tv_T);
    tvR = findViewById(R.id.tv_R);
    dp = findViewById(R.id.dp);
    rankM = findViewById(R.id.rankM);
    rankW = findViewById(R.id.rankW);

    rankM.setEnabled(false);
    rankW.setEnabled(false);

    gamesDB = new GamesDB(this);

    rgT = findViewById(R.id.rg_t);
    rgRM = rank_M.findViewById(R.id.rg_ranks);
    rgRW = rank_W.findViewById(R.id.rg_ranksW);

    rankM.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
    if (rgT.getCheckedRadioButtonId() == R.id.rd_mm) {
    rM = true;
    dialogRank(view);

    } else if (rgT.getCheckedRadioButtonId() == R.id.rd_wm) {
    rM = true;
    dialogRankW(view);
    }
    }
    });
    }


    I try to get the checked radio button in the dialogRank(view) method, here it is :



    public void dialogRank(View view) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    LayoutInflater inflater = getLayoutInflater();
    View dialogLayout = inflater.inflate(R.layout.dialog_layout, null);
    builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialogInterface, int i) {
    //rgRM = rank_M.findViewById(R.id.rg_ranks);
    int radioButtonID = rgRM.getCheckedRadioButtonId();
    View radioButton = rgRM.findViewById(radioButtonID);
    int idx = rgRM.indexOfChild(radioButton);
    if (rM) {
    newRankM = idx;
    rM = false;
    } else if (rW) {
    newRankW = idx;
    rW = false;
    }
    }
    });
    builder.setView(dialogLayout);
    builder.show();
    }


    So in this method a dialog is opened with the list of the radio buttons and the goal for me is to get the index of the checked radiobutton when the user clicks on OK.
    But idx returns -1.



    I find nothing about external radio buttons, is there a solution to this ?



    Thank you for reading (sorry for english).










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am a beginner in android development and am blocked on my project. I searched a solution all this morning and didn't find so here it is.



      I have made a layout with a radiogroup and several radiobutton. I use it for different views of my project.



      I didn't know that we can't find and element by its id from a view if this element is in an external view. So I searched a solution to "include" the layout with my radiogroup.



      No problem with that, I get it with a LayoutInflater and can create the view of my layout.
      Then I can get the radiogroup of this view.



      The problem is that I can't manipulate it. The radiogroup is recognized but I can't get the checked radiobutton, it always return -1.



      Here is the onCreate method, where the view is created.



      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_add);

      LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
      View rank_W = inflater.inflate(R.layout.dialog_layout_w, (ViewGroup) findViewById(R.id.rank_w));
      View rank_M = inflater.inflate(R.layout.dialog_layout, (ViewGroup) findViewById(R.id.rank_m));

      // I also tried the commented way to make the view, it didn't change anything.

      //viewRank = getLayoutInflater().inflate(R.layout.dialog_layout, null);
      //viewRankW = getLayoutInflater().inflate(R.layout.dialog_layout_w, null);

      tvT = findViewById(R.id.tv_T);
      tvR = findViewById(R.id.tv_R);
      dp = findViewById(R.id.dp);
      rankM = findViewById(R.id.rankM);
      rankW = findViewById(R.id.rankW);

      rankM.setEnabled(false);
      rankW.setEnabled(false);

      gamesDB = new GamesDB(this);

      rgT = findViewById(R.id.rg_t);
      rgRM = rank_M.findViewById(R.id.rg_ranks);
      rgRW = rank_W.findViewById(R.id.rg_ranksW);

      rankM.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
      if (rgT.getCheckedRadioButtonId() == R.id.rd_mm) {
      rM = true;
      dialogRank(view);

      } else if (rgT.getCheckedRadioButtonId() == R.id.rd_wm) {
      rM = true;
      dialogRankW(view);
      }
      }
      });
      }


      I try to get the checked radio button in the dialogRank(view) method, here it is :



      public void dialogRank(View view) {
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      LayoutInflater inflater = getLayoutInflater();
      View dialogLayout = inflater.inflate(R.layout.dialog_layout, null);
      builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
      @Override
      public void onClick(DialogInterface dialogInterface, int i) {
      //rgRM = rank_M.findViewById(R.id.rg_ranks);
      int radioButtonID = rgRM.getCheckedRadioButtonId();
      View radioButton = rgRM.findViewById(radioButtonID);
      int idx = rgRM.indexOfChild(radioButton);
      if (rM) {
      newRankM = idx;
      rM = false;
      } else if (rW) {
      newRankW = idx;
      rW = false;
      }
      }
      });
      builder.setView(dialogLayout);
      builder.show();
      }


      So in this method a dialog is opened with the list of the radio buttons and the goal for me is to get the index of the checked radiobutton when the user clicks on OK.
      But idx returns -1.



      I find nothing about external radio buttons, is there a solution to this ?



      Thank you for reading (sorry for english).










      share|improve this question













      I am a beginner in android development and am blocked on my project. I searched a solution all this morning and didn't find so here it is.



      I have made a layout with a radiogroup and several radiobutton. I use it for different views of my project.



      I didn't know that we can't find and element by its id from a view if this element is in an external view. So I searched a solution to "include" the layout with my radiogroup.



      No problem with that, I get it with a LayoutInflater and can create the view of my layout.
      Then I can get the radiogroup of this view.



      The problem is that I can't manipulate it. The radiogroup is recognized but I can't get the checked radiobutton, it always return -1.



      Here is the onCreate method, where the view is created.



      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_add);

      LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
      View rank_W = inflater.inflate(R.layout.dialog_layout_w, (ViewGroup) findViewById(R.id.rank_w));
      View rank_M = inflater.inflate(R.layout.dialog_layout, (ViewGroup) findViewById(R.id.rank_m));

      // I also tried the commented way to make the view, it didn't change anything.

      //viewRank = getLayoutInflater().inflate(R.layout.dialog_layout, null);
      //viewRankW = getLayoutInflater().inflate(R.layout.dialog_layout_w, null);

      tvT = findViewById(R.id.tv_T);
      tvR = findViewById(R.id.tv_R);
      dp = findViewById(R.id.dp);
      rankM = findViewById(R.id.rankM);
      rankW = findViewById(R.id.rankW);

      rankM.setEnabled(false);
      rankW.setEnabled(false);

      gamesDB = new GamesDB(this);

      rgT = findViewById(R.id.rg_t);
      rgRM = rank_M.findViewById(R.id.rg_ranks);
      rgRW = rank_W.findViewById(R.id.rg_ranksW);

      rankM.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
      if (rgT.getCheckedRadioButtonId() == R.id.rd_mm) {
      rM = true;
      dialogRank(view);

      } else if (rgT.getCheckedRadioButtonId() == R.id.rd_wm) {
      rM = true;
      dialogRankW(view);
      }
      }
      });
      }


      I try to get the checked radio button in the dialogRank(view) method, here it is :



      public void dialogRank(View view) {
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      LayoutInflater inflater = getLayoutInflater();
      View dialogLayout = inflater.inflate(R.layout.dialog_layout, null);
      builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
      @Override
      public void onClick(DialogInterface dialogInterface, int i) {
      //rgRM = rank_M.findViewById(R.id.rg_ranks);
      int radioButtonID = rgRM.getCheckedRadioButtonId();
      View radioButton = rgRM.findViewById(radioButtonID);
      int idx = rgRM.indexOfChild(radioButton);
      if (rM) {
      newRankM = idx;
      rM = false;
      } else if (rW) {
      newRankW = idx;
      rW = false;
      }
      }
      });
      builder.setView(dialogLayout);
      builder.show();
      }


      So in this method a dialog is opened with the list of the radio buttons and the goal for me is to get the index of the checked radiobutton when the user clicks on OK.
      But idx returns -1.



      I find nothing about external radio buttons, is there a solution to this ?



      Thank you for reading (sorry for english).







      java android android-layout radio-button radio-group






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Morgane

      348




      348
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I didn't figure it out but I found another way which works. In the onCreate I don't need to get the view of the external layout, but the method dialogRank(View view) changed, here it is :



          public void dialogRank(View view) {
          final Dialog dialog = new Dialog(context);
          dialog.setContentView(R.layout.dialog_layout);
          dialog.setTitle("Select a rank");

          Button ok = dialog.findViewById(R.id.btnOK);

          dialog.show();

          dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
          @Override
          public void onCancel(DialogInterface dialogInterface) {
          rgRM = dialog.findViewById(R.id.rg_ranks);
          int idB = rgRM.getCheckedRadioButtonId();
          int index = rgRM.indexOfChild(rgRM.findViewById(idB));
          if (rM && index != -1) {
          newRankM = index;
          changeR = true;
          } else if (rW && index != -1) {
          newRankW = index;
          changeR = true;
          }
          if (rM) rM = false;
          if (rW) rW = false;
          }
          });

          ok.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
          dialog.cancel();
          }
          });
          }


          For the context variable I declare in my activity final Context context = this;.



          This opens a dialog of the layout dialog_layout and in the cancelListner rgRM, there is the radiogroup of this layout. The method getCheckedRadioButtonId works and returns the id of the radiobutton. We can then have its index with rgRM.indexOfChild(rgRM.findViewById(idB)). The changeR and rM/rW variables are for my other treatments.



          I use OnCancelListener because it's the most adapted for the using I'm looking, the onCancel method is used when the user touch the screen outside the dialog or use the back button.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53227197%2fuse-getcheckedradiobuttonid-with-an-external-radio-group%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I didn't figure it out but I found another way which works. In the onCreate I don't need to get the view of the external layout, but the method dialogRank(View view) changed, here it is :



            public void dialogRank(View view) {
            final Dialog dialog = new Dialog(context);
            dialog.setContentView(R.layout.dialog_layout);
            dialog.setTitle("Select a rank");

            Button ok = dialog.findViewById(R.id.btnOK);

            dialog.show();

            dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialogInterface) {
            rgRM = dialog.findViewById(R.id.rg_ranks);
            int idB = rgRM.getCheckedRadioButtonId();
            int index = rgRM.indexOfChild(rgRM.findViewById(idB));
            if (rM && index != -1) {
            newRankM = index;
            changeR = true;
            } else if (rW && index != -1) {
            newRankW = index;
            changeR = true;
            }
            if (rM) rM = false;
            if (rW) rW = false;
            }
            });

            ok.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            dialog.cancel();
            }
            });
            }


            For the context variable I declare in my activity final Context context = this;.



            This opens a dialog of the layout dialog_layout and in the cancelListner rgRM, there is the radiogroup of this layout. The method getCheckedRadioButtonId works and returns the id of the radiobutton. We can then have its index with rgRM.indexOfChild(rgRM.findViewById(idB)). The changeR and rM/rW variables are for my other treatments.



            I use OnCancelListener because it's the most adapted for the using I'm looking, the onCancel method is used when the user touch the screen outside the dialog or use the back button.






            share|improve this answer

























              up vote
              0
              down vote













              I didn't figure it out but I found another way which works. In the onCreate I don't need to get the view of the external layout, but the method dialogRank(View view) changed, here it is :



              public void dialogRank(View view) {
              final Dialog dialog = new Dialog(context);
              dialog.setContentView(R.layout.dialog_layout);
              dialog.setTitle("Select a rank");

              Button ok = dialog.findViewById(R.id.btnOK);

              dialog.show();

              dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
              @Override
              public void onCancel(DialogInterface dialogInterface) {
              rgRM = dialog.findViewById(R.id.rg_ranks);
              int idB = rgRM.getCheckedRadioButtonId();
              int index = rgRM.indexOfChild(rgRM.findViewById(idB));
              if (rM && index != -1) {
              newRankM = index;
              changeR = true;
              } else if (rW && index != -1) {
              newRankW = index;
              changeR = true;
              }
              if (rM) rM = false;
              if (rW) rW = false;
              }
              });

              ok.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
              dialog.cancel();
              }
              });
              }


              For the context variable I declare in my activity final Context context = this;.



              This opens a dialog of the layout dialog_layout and in the cancelListner rgRM, there is the radiogroup of this layout. The method getCheckedRadioButtonId works and returns the id of the radiobutton. We can then have its index with rgRM.indexOfChild(rgRM.findViewById(idB)). The changeR and rM/rW variables are for my other treatments.



              I use OnCancelListener because it's the most adapted for the using I'm looking, the onCancel method is used when the user touch the screen outside the dialog or use the back button.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                I didn't figure it out but I found another way which works. In the onCreate I don't need to get the view of the external layout, but the method dialogRank(View view) changed, here it is :



                public void dialogRank(View view) {
                final Dialog dialog = new Dialog(context);
                dialog.setContentView(R.layout.dialog_layout);
                dialog.setTitle("Select a rank");

                Button ok = dialog.findViewById(R.id.btnOK);

                dialog.show();

                dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialogInterface) {
                rgRM = dialog.findViewById(R.id.rg_ranks);
                int idB = rgRM.getCheckedRadioButtonId();
                int index = rgRM.indexOfChild(rgRM.findViewById(idB));
                if (rM && index != -1) {
                newRankM = index;
                changeR = true;
                } else if (rW && index != -1) {
                newRankW = index;
                changeR = true;
                }
                if (rM) rM = false;
                if (rW) rW = false;
                }
                });

                ok.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                dialog.cancel();
                }
                });
                }


                For the context variable I declare in my activity final Context context = this;.



                This opens a dialog of the layout dialog_layout and in the cancelListner rgRM, there is the radiogroup of this layout. The method getCheckedRadioButtonId works and returns the id of the radiobutton. We can then have its index with rgRM.indexOfChild(rgRM.findViewById(idB)). The changeR and rM/rW variables are for my other treatments.



                I use OnCancelListener because it's the most adapted for the using I'm looking, the onCancel method is used when the user touch the screen outside the dialog or use the back button.






                share|improve this answer












                I didn't figure it out but I found another way which works. In the onCreate I don't need to get the view of the external layout, but the method dialogRank(View view) changed, here it is :



                public void dialogRank(View view) {
                final Dialog dialog = new Dialog(context);
                dialog.setContentView(R.layout.dialog_layout);
                dialog.setTitle("Select a rank");

                Button ok = dialog.findViewById(R.id.btnOK);

                dialog.show();

                dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialogInterface) {
                rgRM = dialog.findViewById(R.id.rg_ranks);
                int idB = rgRM.getCheckedRadioButtonId();
                int index = rgRM.indexOfChild(rgRM.findViewById(idB));
                if (rM && index != -1) {
                newRankM = index;
                changeR = true;
                } else if (rW && index != -1) {
                newRankW = index;
                changeR = true;
                }
                if (rM) rM = false;
                if (rW) rW = false;
                }
                });

                ok.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                dialog.cancel();
                }
                });
                }


                For the context variable I declare in my activity final Context context = this;.



                This opens a dialog of the layout dialog_layout and in the cancelListner rgRM, there is the radiogroup of this layout. The method getCheckedRadioButtonId works and returns the id of the radiobutton. We can then have its index with rgRM.indexOfChild(rgRM.findViewById(idB)). The changeR and rM/rW variables are for my other treatments.



                I use OnCancelListener because it's the most adapted for the using I'm looking, the onCancel method is used when the user touch the screen outside the dialog or use the back button.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 18 hours ago









                Morgane

                348




                348






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53227197%2fuse-getcheckedradiobuttonid-with-an-external-radio-group%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Error while running script in elastic search , gateway timeout

                    Adding quotations to stringified JSON object values