How to execute event on dojo dialog created dynamically? Announcing the arrival of Valued...

How did Elite on the NES work?

Why these surprising proportionalities of integrals involving odd zeta values?

What's the connection between Mr. Nancy and fried chicken?

How to produce a PS1 prompt in bash or ksh93 similar to tcsh

How can I delete rows in the text?

Can you make a star from other gases, and how long would they last?

Marquee sign letters

What helicopter has the most rotor blades?

What *exactly* is electrical current, voltage, and resistance?

How to ask rejected full-time candidates to apply to teach individual courses?

Suing a Police Officer Instead of the Police Department

How do I deal with an erroneously large refund?

Why doesn't the university give past final exams' answers?

Writing a t-sql stored procedure to recieve 4 numbers and insert them into a table

Why is old stuff good?

Setting chapter numbering to alphabetic in one part only

Is there a verb for listening stealthily?

Does the Pact of the Blade warlock feature allow me to customize the properties of the pact weapon I create?

Proving inequality for positive definite matrix

Who owned the land and natural resources under feudalism?

Will I be more secure with my own router behind my ISP's router?

How to mute a string and play another at the same time

How to obtain original coefficients after performing gradient descent on normalized data?

Check if custom CRS already exists, find EPSG



How to execute event on dojo dialog created dynamically?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to resize an infoWindow dynamically, based on the contentsHow to close DOJO layout elements programaticallyArcGIS map service not resizing for print-friendly pageTrying to label graphic using feature attribute (ArcGIS Javascript 3.7 API)How to synchronously execute a queryTaskHow to work on map created by using arcgisUtils.createMapButtons won't work when I copy the content of the TOC dynamically into Dojo FloatingPane and backHow to move a point on a touch screen using esri map, dojo and javascripthow to handle keyboard and click eventHow to prevent map click event esri map js API?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am working on draw Tool add Text as graphics on Map.I have created tool and when user click on Map I am showing dialog on map screen.
Now, I would like to get text values and dropdown select values from dialog box and when user click on save button of dialog I would like to add Text graphic on Map.
Below is Widgets.js file code. Dojo dialog I have html templates and I am loading and setting as content in Dialog.
After Showing the dialog box I am not able to execute event on Save button of dialog.
How do I create dialog box, get values and execute the event of Dialog button?



    define([
.....
'dojo/text!./Graphics/templates/TextGraphics.html', \ This is my HTML templates
...
]function (
....
....)
{
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
// below is my code what I am trying to do
var txtgr = Texttemplates;
var drawTextClickHanlder = this.map.on('click', lang.hitch(this, function (evt, override) {
var myDialog = new Dialog({
title: "Enter Text",
style: "width: 400px",
content: Texttemplates, // This is my HTML templates
});
myDialog.show();
//var textSymbol = dojo.byId("addmaptext").value;
var textSymbol = new TextSymbol(
//form.drawText,
"Text",
this.textFont,
this.textColor
);
var textGraphic = new Graphic(evt.mapPoint, textSymbol);
this.textGraphics.add(textGraphic);
this.connectMapClick();
drawTextClickHanlder.remove();
}));
});
}),


with above code Dialog box shows but not able to execute Save button event and get text and dropdown select values.



Below is my Dialog box HTML templates



<div style="padding:5px;">
<div id="dialogconfirmtext">
<table>
<tr>
<td><label for="name">Enter label:</label></td>
<td>
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="drawTextFormDijit">
<input type="text" data-dojo-type="dijit/form/ValidationTextBox" id="addmaptext"
data-dojo-props="name:'drawText',trim:true,required:true,style:'width:100%;',placeholder:''" />
</div>
</td>
</tr>
<tr>
<td>
<label for="name">Color:</label>
</td>
<td>
<select name="select" data-dojo-type="dojox/form/DropDownSelect">
<option value="Red">Red</option>
<option value="Black" selected="selected">Black</option>
</select>
</td>
</tr>

</table>
</div>
</div>
<div class="buttonActionBar" id="btnact">
<table>
<tr>
<td>
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-globe',showLabel:true" data-dojo-attach-point="savetext" id="savetext">
save
</button>
</td>
</tr>
</table>
</div>


below is the output of Dialogbox



enter image description here










share|improve this question





























    0















    I am working on draw Tool add Text as graphics on Map.I have created tool and when user click on Map I am showing dialog on map screen.
    Now, I would like to get text values and dropdown select values from dialog box and when user click on save button of dialog I would like to add Text graphic on Map.
    Below is Widgets.js file code. Dojo dialog I have html templates and I am loading and setting as content in Dialog.
    After Showing the dialog box I am not able to execute event on Save button of dialog.
    How do I create dialog box, get values and execute the event of Dialog button?



        define([
    .....
    'dojo/text!./Graphics/templates/TextGraphics.html', \ This is my HTML templates
    ...
    ]function (
    ....
    ....)
    {
    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
    // below is my code what I am trying to do
    var txtgr = Texttemplates;
    var drawTextClickHanlder = this.map.on('click', lang.hitch(this, function (evt, override) {
    var myDialog = new Dialog({
    title: "Enter Text",
    style: "width: 400px",
    content: Texttemplates, // This is my HTML templates
    });
    myDialog.show();
    //var textSymbol = dojo.byId("addmaptext").value;
    var textSymbol = new TextSymbol(
    //form.drawText,
    "Text",
    this.textFont,
    this.textColor
    );
    var textGraphic = new Graphic(evt.mapPoint, textSymbol);
    this.textGraphics.add(textGraphic);
    this.connectMapClick();
    drawTextClickHanlder.remove();
    }));
    });
    }),


    with above code Dialog box shows but not able to execute Save button event and get text and dropdown select values.



    Below is my Dialog box HTML templates



    <div style="padding:5px;">
    <div id="dialogconfirmtext">
    <table>
    <tr>
    <td><label for="name">Enter label:</label></td>
    <td>
    <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="drawTextFormDijit">
    <input type="text" data-dojo-type="dijit/form/ValidationTextBox" id="addmaptext"
    data-dojo-props="name:'drawText',trim:true,required:true,style:'width:100%;',placeholder:''" />
    </div>
    </td>
    </tr>
    <tr>
    <td>
    <label for="name">Color:</label>
    </td>
    <td>
    <select name="select" data-dojo-type="dojox/form/DropDownSelect">
    <option value="Red">Red</option>
    <option value="Black" selected="selected">Black</option>
    </select>
    </td>
    </tr>

    </table>
    </div>
    </div>
    <div class="buttonActionBar" id="btnact">
    <table>
    <tr>
    <td>
    <button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-globe',showLabel:true" data-dojo-attach-point="savetext" id="savetext">
    save
    </button>
    </td>
    </tr>
    </table>
    </div>


    below is the output of Dialogbox



    enter image description here










    share|improve this question

























      0












      0








      0








      I am working on draw Tool add Text as graphics on Map.I have created tool and when user click on Map I am showing dialog on map screen.
      Now, I would like to get text values and dropdown select values from dialog box and when user click on save button of dialog I would like to add Text graphic on Map.
      Below is Widgets.js file code. Dojo dialog I have html templates and I am loading and setting as content in Dialog.
      After Showing the dialog box I am not able to execute event on Save button of dialog.
      How do I create dialog box, get values and execute the event of Dialog button?



          define([
      .....
      'dojo/text!./Graphics/templates/TextGraphics.html', \ This is my HTML templates
      ...
      ]function (
      ....
      ....)
      {
      return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
      // below is my code what I am trying to do
      var txtgr = Texttemplates;
      var drawTextClickHanlder = this.map.on('click', lang.hitch(this, function (evt, override) {
      var myDialog = new Dialog({
      title: "Enter Text",
      style: "width: 400px",
      content: Texttemplates, // This is my HTML templates
      });
      myDialog.show();
      //var textSymbol = dojo.byId("addmaptext").value;
      var textSymbol = new TextSymbol(
      //form.drawText,
      "Text",
      this.textFont,
      this.textColor
      );
      var textGraphic = new Graphic(evt.mapPoint, textSymbol);
      this.textGraphics.add(textGraphic);
      this.connectMapClick();
      drawTextClickHanlder.remove();
      }));
      });
      }),


      with above code Dialog box shows but not able to execute Save button event and get text and dropdown select values.



      Below is my Dialog box HTML templates



      <div style="padding:5px;">
      <div id="dialogconfirmtext">
      <table>
      <tr>
      <td><label for="name">Enter label:</label></td>
      <td>
      <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="drawTextFormDijit">
      <input type="text" data-dojo-type="dijit/form/ValidationTextBox" id="addmaptext"
      data-dojo-props="name:'drawText',trim:true,required:true,style:'width:100%;',placeholder:''" />
      </div>
      </td>
      </tr>
      <tr>
      <td>
      <label for="name">Color:</label>
      </td>
      <td>
      <select name="select" data-dojo-type="dojox/form/DropDownSelect">
      <option value="Red">Red</option>
      <option value="Black" selected="selected">Black</option>
      </select>
      </td>
      </tr>

      </table>
      </div>
      </div>
      <div class="buttonActionBar" id="btnact">
      <table>
      <tr>
      <td>
      <button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-globe',showLabel:true" data-dojo-attach-point="savetext" id="savetext">
      save
      </button>
      </td>
      </tr>
      </table>
      </div>


      below is the output of Dialogbox



      enter image description here










      share|improve this question














      I am working on draw Tool add Text as graphics on Map.I have created tool and when user click on Map I am showing dialog on map screen.
      Now, I would like to get text values and dropdown select values from dialog box and when user click on save button of dialog I would like to add Text graphic on Map.
      Below is Widgets.js file code. Dojo dialog I have html templates and I am loading and setting as content in Dialog.
      After Showing the dialog box I am not able to execute event on Save button of dialog.
      How do I create dialog box, get values and execute the event of Dialog button?



          define([
      .....
      'dojo/text!./Graphics/templates/TextGraphics.html', \ This is my HTML templates
      ...
      ]function (
      ....
      ....)
      {
      return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
      // below is my code what I am trying to do
      var txtgr = Texttemplates;
      var drawTextClickHanlder = this.map.on('click', lang.hitch(this, function (evt, override) {
      var myDialog = new Dialog({
      title: "Enter Text",
      style: "width: 400px",
      content: Texttemplates, // This is my HTML templates
      });
      myDialog.show();
      //var textSymbol = dojo.byId("addmaptext").value;
      var textSymbol = new TextSymbol(
      //form.drawText,
      "Text",
      this.textFont,
      this.textColor
      );
      var textGraphic = new Graphic(evt.mapPoint, textSymbol);
      this.textGraphics.add(textGraphic);
      this.connectMapClick();
      drawTextClickHanlder.remove();
      }));
      });
      }),


      with above code Dialog box shows but not able to execute Save button event and get text and dropdown select values.



      Below is my Dialog box HTML templates



      <div style="padding:5px;">
      <div id="dialogconfirmtext">
      <table>
      <tr>
      <td><label for="name">Enter label:</label></td>
      <td>
      <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="drawTextFormDijit">
      <input type="text" data-dojo-type="dijit/form/ValidationTextBox" id="addmaptext"
      data-dojo-props="name:'drawText',trim:true,required:true,style:'width:100%;',placeholder:''" />
      </div>
      </td>
      </tr>
      <tr>
      <td>
      <label for="name">Color:</label>
      </td>
      <td>
      <select name="select" data-dojo-type="dojox/form/DropDownSelect">
      <option value="Red">Red</option>
      <option value="Black" selected="selected">Black</option>
      </select>
      </td>
      </tr>

      </table>
      </div>
      </div>
      <div class="buttonActionBar" id="btnact">
      <table>
      <tr>
      <td>
      <button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'fa fa-globe',showLabel:true" data-dojo-attach-point="savetext" id="savetext">
      save
      </button>
      </td>
      </tr>
      </table>
      </div>


      below is the output of Dialogbox



      enter image description here







      arcgis-javascript-api






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 21 mins ago









      MayurMayur

      2115




      2115






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2fgis.stackexchange.com%2fquestions%2f319601%2fhow-to-execute-event-on-dojo-dialog-created-dynamically%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f319601%2fhow-to-execute-event-on-dojo-dialog-created-dynamically%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Энтрерриос (город) Содержание История | Географическое...