# Another way for Htmldialog get\_element\_value. Need Help

**URL:** <https://forums.sketchup.com/t/another-way-for-htmldialog-get-element-value-need-help/34618>\
**Category:** Ruby API\
**Tags:** make-2017\
**Created:** [November 24, 2016, 9:52am UTC](https://forums.sketchup.com/t/another-way-for-htmldialog-get-element-value-need-help/34618 "2016-11-24T09:52:25Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [March 18, 2018, 5:52pm UTC](https://forums.sketchup.com/t/another-way-for-htmldialog-get-element-value-need-help/34618/21 "2018-03-18T17:52:31Z")

</div>

> [@Aerilius](#):
>
> Freezing (with wait) an asynchronous operation to make it synchronous will cause a deadlock in a single threaded application.

Which is what our tests proved 18 days ago. (ie, the “trigger” cannot be sent to the CEF if the Ruby is wound up in a wait loop. The Ruby method must return before SketchUp’s C-side will send the “trigger” to the CEF process.)

> [@Aerilius](#):
>
> It’s better to accept thinking in the asynchronous paradigm.

Which was also the conclusion of this and the [other thread](https://forums.sketchup.com/t/alternative-to-get-element-value-method-for-htmldialog/33753/) (despite the wishes of the OPs migrating from `UI::WebDialog`,) to have a synchronous “getter” method equivalent of **`get_element_value`**.  
It is also, why I changed the name of the “trigger” method ([in the example](https://forums.sketchup.com/t/another-way-for-htmldialog-get-element-value-need-help/34618/6)) to **`request_element_value()`** and gave the reason …

> ⚠ Changed the name of **`get_element_value()`** to **`request_element_value()`**  
> because there is no way to receive synchronous values from JS in the **`UI::HtmlDialog`** class.

* * *

Just opened another issue to add the DevCamp 2017 examples link to the class (and perhaps some statements that are more clear and informative regarding the new class’ asynchronous nature.)

> <https://github.com/SketchUp/api-issue-tracker/issues/64>
>
> \### Ruby API Issue
> 
> \#### API Documentation: \*\*\`UI::HtmlDialog\`\*\*
> 
> Insert lin…k to UI::HtmlDialog Examples in class Overview section.
> https://github.com/SketchUp/htmldialog-examples
> 
> If those migrating from \*\*\`UI::WebDialog\`\*\* read the examples from DevCamp 2017, they'll be less likely to be posting the "\_HtmlDialog alternative to \`get\_element\_value()\`\_" threads in the forum.
> 
> Also the first sentence could have the word "asynchronously" following the word "interact" so the readers would hopefully get the idea. Or, perhaps even a more blunt statement that informs the readers that the new class does not have synchronous communication at all.

---

_[View the full topic](https://forums.sketchup.com/t/another-way-for-htmldialog-get-element-value-need-help/34618)._
