<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to show dialog box (with either radio buttons or dropdown list) in Experience Builder Custom Widgets</title>
    <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378126#M184</link>
    <description>&lt;P&gt;It's important to keep in mind when working in React that everything is happening in the Javascript through the Virtual DOM and nothing is actually in the DOM. It's very difficult to get jQuery to work with React because jQuery manipulates the actual DOM, not the Virtual DOM.&lt;/P&gt;&lt;P&gt;For related reasons, you will also need to build a function to capture any user inputs and store them in state. A simple textArea input would look something like this.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const [textarea, setTextarea] = useState(
    "The content of a textarea goes in the value attribute"
  );

  const handleChange = (event) =&amp;gt; {
    setTextarea(event.target.value)
  }

  return (
    &amp;lt;form&amp;gt;
      &amp;lt;textarea value={textarea} onChange={handleChange} /&amp;gt;
    &amp;lt;/form&amp;gt;
  )&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 05 Feb 2024 13:30:33 GMT</pubDate>
    <dc:creator>JeffreyThompson2</dc:creator>
    <dc:date>2024-02-05T13:30:33Z</dc:date>
    <item>
      <title>How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378056#M183</link>
      <description>&lt;P&gt;From custom widget, I need to ask the user to select between some choices, and the like.&lt;/P&gt;&lt;P&gt;I thought to present him with a dialog box.&lt;/P&gt;&lt;P&gt;I failed to open a jQuery dialog box from my function widget (even that I don't get an error message),&lt;/P&gt;&lt;P&gt;and I don't yet know how to use react to display a dialog box (and get result from it).&lt;/P&gt;&lt;P&gt;Help will be greatly appreciated&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 08:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378056#M183</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2024-02-05T08:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378126#M184</link>
      <description>&lt;P&gt;It's important to keep in mind when working in React that everything is happening in the Javascript through the Virtual DOM and nothing is actually in the DOM. It's very difficult to get jQuery to work with React because jQuery manipulates the actual DOM, not the Virtual DOM.&lt;/P&gt;&lt;P&gt;For related reasons, you will also need to build a function to capture any user inputs and store them in state. A simple textArea input would look something like this.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const [textarea, setTextarea] = useState(
    "The content of a textarea goes in the value attribute"
  );

  const handleChange = (event) =&amp;gt; {
    setTextarea(event.target.value)
  }

  return (
    &amp;lt;form&amp;gt;
      &amp;lt;textarea value={textarea} onChange={handleChange} /&amp;gt;
    &amp;lt;/form&amp;gt;
  )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378126#M184</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2024-02-05T13:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378164#M185</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;&amp;nbsp;thank you very much for your bright explanation. Indeed I have found in the internet some code examples for implementing radio buttons in react environment, and I'll analyse them and implement as fits me.&lt;/P&gt;&lt;P&gt;Meanwhile I used js prompt to get user's choice, and this deceived me to think jQuery will also work same as js prompt works.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 15:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1378164#M185</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2024-02-05T15:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1382850#M205</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;&amp;nbsp;I tried to follow&amp;nbsp;&lt;A href="https://www.geeksforgeeks.org/how-to-create-dialog-box-in-reactjs-2/" target="_blank" rel="noopener"&gt;How to create Dialog Box in ReactJS?&lt;/A&gt;&amp;nbsp;but it uses Material UI lib, and I do not know how to incorporate this lib either to the widget or to the whole app. I need instructions how to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 15:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1382850#M205</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2024-02-15T15:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1382974#M207</link>
      <description>&lt;P&gt;Experience Builder comes packaged with reactstrap as the default UI library. You can use the modal component to get what you want.&amp;nbsp;&lt;A href="https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-index-modal--docs" target="_blank"&gt;https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-index-modal--docs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 18:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1382974#M207</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2024-02-15T18:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1386534#M214</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;&amp;nbsp;, Thank you for showing the way. I searched in EXB for "Modal" and found its usage in dist/widgets/arcgis/query.&lt;/P&gt;&lt;P&gt;Since I'm new to React, It'll help me if I can see some simple barebone code example, or get some explanations how to adapt it from there.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2024 12:26:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1386534#M214</guid>
      <dc:creator>MichaelLev</dc:creator>
      <dc:date>2024-02-25T12:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to show dialog box (with either radio buttons or dropdown list)</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1386790#M218</link>
      <description>&lt;P&gt;A simple model would look like this.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import {React} from 'jimu-core'
import {Modal, Button} from 'jimu-ui'

const {useState} = React

const Widget = (props) =&amp;gt; {
  const [open, setOpen] = useState(false)

  const handleOpen = () =&amp;gt; {
    setOpen(!open)
  }
  
  return(
    &amp;lt;div&amp;gt;
       &amp;lt;Button
          onClick={handleOpen}
       &amp;gt;
          Open Modal
       &amp;lt;/Button&amp;gt;
       &amp;lt;Modal
          isOpen={open}
       &amp;gt;
          Modal Content
          &amp;lt;Button
             onClick={handleOpen}
          &amp;gt;
             Close Modal
          &amp;lt;/Button&amp;gt;
     &amp;lt;/div&amp;gt;
  )
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 26 Feb 2024 15:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-show-dialog-box-with-either-radio-buttons/m-p/1386790#M218</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2024-02-26T15:42:03Z</dc:date>
    </item>
  </channel>
</rss>

