How to fix the red mark that appears when using binding.scala in intellij?












2















I am developing with scalajs and binding.scala. I'm using the IDE as an Intellij. However, when using dom macro in Intellij, the following red mark appears. this error appears when I use the attribute value of id in the input element as macro What is the solution?



This error(a.k.a. "cannot resolve symbol something") appears when you use the id attribute value of the input element as marco.



please see the link of image below.



this is my code image.



 @dom
def render: xml.Elem = {
val name: _root_.com.thoughtworks.binding.Binding.Var[_root_.java.lang.String] = Var.apply("Binding.scala")
val show: _root_.com.thoughtworks.binding.Binding.Var[Boolean] = Var.apply(false)
<div>
<p>
<label for="showCheckbox">
<input type="checkbox" id="showCheckbox" onchange={e: Event => show.value = showCheckbox.value }/>
<span> Say hello to <input id="nameInput" value={name.value} oninput={_: Event => name.value = nameInput.value}/></span>
</label>
</p>
{
if (show.bind) {
<p>
Hello, {name.bind}!
</p>
} else {
<!-- Don't show hello. -->
}
}
</div>
}









share|improve this question





























    2















    I am developing with scalajs and binding.scala. I'm using the IDE as an Intellij. However, when using dom macro in Intellij, the following red mark appears. this error appears when I use the attribute value of id in the input element as macro What is the solution?



    This error(a.k.a. "cannot resolve symbol something") appears when you use the id attribute value of the input element as marco.



    please see the link of image below.



    this is my code image.



     @dom
    def render: xml.Elem = {
    val name: _root_.com.thoughtworks.binding.Binding.Var[_root_.java.lang.String] = Var.apply("Binding.scala")
    val show: _root_.com.thoughtworks.binding.Binding.Var[Boolean] = Var.apply(false)
    <div>
    <p>
    <label for="showCheckbox">
    <input type="checkbox" id="showCheckbox" onchange={e: Event => show.value = showCheckbox.value }/>
    <span> Say hello to <input id="nameInput" value={name.value} oninput={_: Event => name.value = nameInput.value}/></span>
    </label>
    </p>
    {
    if (show.bind) {
    <p>
    Hello, {name.bind}!
    </p>
    } else {
    <!-- Don't show hello. -->
    }
    }
    </div>
    }









    share|improve this question



























      2












      2








      2








      I am developing with scalajs and binding.scala. I'm using the IDE as an Intellij. However, when using dom macro in Intellij, the following red mark appears. this error appears when I use the attribute value of id in the input element as macro What is the solution?



      This error(a.k.a. "cannot resolve symbol something") appears when you use the id attribute value of the input element as marco.



      please see the link of image below.



      this is my code image.



       @dom
      def render: xml.Elem = {
      val name: _root_.com.thoughtworks.binding.Binding.Var[_root_.java.lang.String] = Var.apply("Binding.scala")
      val show: _root_.com.thoughtworks.binding.Binding.Var[Boolean] = Var.apply(false)
      <div>
      <p>
      <label for="showCheckbox">
      <input type="checkbox" id="showCheckbox" onchange={e: Event => show.value = showCheckbox.value }/>
      <span> Say hello to <input id="nameInput" value={name.value} oninput={_: Event => name.value = nameInput.value}/></span>
      </label>
      </p>
      {
      if (show.bind) {
      <p>
      Hello, {name.bind}!
      </p>
      } else {
      <!-- Don't show hello. -->
      }
      }
      </div>
      }









      share|improve this question
















      I am developing with scalajs and binding.scala. I'm using the IDE as an Intellij. However, when using dom macro in Intellij, the following red mark appears. this error appears when I use the attribute value of id in the input element as macro What is the solution?



      This error(a.k.a. "cannot resolve symbol something") appears when you use the id attribute value of the input element as marco.



      please see the link of image below.



      this is my code image.



       @dom
      def render: xml.Elem = {
      val name: _root_.com.thoughtworks.binding.Binding.Var[_root_.java.lang.String] = Var.apply("Binding.scala")
      val show: _root_.com.thoughtworks.binding.Binding.Var[Boolean] = Var.apply(false)
      <div>
      <p>
      <label for="showCheckbox">
      <input type="checkbox" id="showCheckbox" onchange={e: Event => show.value = showCheckbox.value }/>
      <span> Say hello to <input id="nameInput" value={name.value} oninput={_: Event => name.value = nameInput.value}/></span>
      </label>
      </p>
      {
      if (show.bind) {
      <p>
      Hello, {name.bind}!
      </p>
      } else {
      <!-- Don't show hello. -->
      }
      }
      </div>
      }






      scala scala.js binding.scala






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 1 at 16:48







      terdong

















      asked Jan 1 at 15:05









      terdongterdong

      113




      113
























          1 Answer
          1






          active

          oldest

          votes


















          1














          I actually have the same problem. I have 2 ways dealing with it:




          1. Ignore these exception - as they are only a problem within IntellIJ
            (it compiles just fine).


          2. Use for example JQuery like this:



            import org.scalajs.jquery.jQuery 
            ..
            jQuery("#showCheckbox").value()


            As soon as your id gets more dynamic - you will need something like that anyway (at least that is what I know;)) -> jQuery(s"#${elem.id}").value().








          share|improve this answer
























          • Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

            – terdong
            Jan 3 at 7:37













          • @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

            – pme
            Jan 3 at 8:20











          • yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

            – terdong
            Jan 3 at 11:40













          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',
          autoActivateHeartbeat: false,
          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%2f53996512%2fhow-to-fix-the-red-mark-that-appears-when-using-binding-scala-in-intellij%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          I actually have the same problem. I have 2 ways dealing with it:




          1. Ignore these exception - as they are only a problem within IntellIJ
            (it compiles just fine).


          2. Use for example JQuery like this:



            import org.scalajs.jquery.jQuery 
            ..
            jQuery("#showCheckbox").value()


            As soon as your id gets more dynamic - you will need something like that anyway (at least that is what I know;)) -> jQuery(s"#${elem.id}").value().








          share|improve this answer
























          • Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

            – terdong
            Jan 3 at 7:37













          • @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

            – pme
            Jan 3 at 8:20











          • yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

            – terdong
            Jan 3 at 11:40


















          1














          I actually have the same problem. I have 2 ways dealing with it:




          1. Ignore these exception - as they are only a problem within IntellIJ
            (it compiles just fine).


          2. Use for example JQuery like this:



            import org.scalajs.jquery.jQuery 
            ..
            jQuery("#showCheckbox").value()


            As soon as your id gets more dynamic - you will need something like that anyway (at least that is what I know;)) -> jQuery(s"#${elem.id}").value().








          share|improve this answer
























          • Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

            – terdong
            Jan 3 at 7:37













          • @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

            – pme
            Jan 3 at 8:20











          • yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

            – terdong
            Jan 3 at 11:40
















          1












          1








          1







          I actually have the same problem. I have 2 ways dealing with it:




          1. Ignore these exception - as they are only a problem within IntellIJ
            (it compiles just fine).


          2. Use for example JQuery like this:



            import org.scalajs.jquery.jQuery 
            ..
            jQuery("#showCheckbox").value()


            As soon as your id gets more dynamic - you will need something like that anyway (at least that is what I know;)) -> jQuery(s"#${elem.id}").value().








          share|improve this answer













          I actually have the same problem. I have 2 ways dealing with it:




          1. Ignore these exception - as they are only a problem within IntellIJ
            (it compiles just fine).


          2. Use for example JQuery like this:



            import org.scalajs.jquery.jQuery 
            ..
            jQuery("#showCheckbox").value()


            As soon as your id gets more dynamic - you will need something like that anyway (at least that is what I know;)) -> jQuery(s"#${elem.id}").value().









          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 1 at 19:14









          pmepme

          2,90611527




          2,90611527













          • Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

            – terdong
            Jan 3 at 7:37













          • @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

            – pme
            Jan 3 at 8:20











          • yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

            – terdong
            Jan 3 at 11:40





















          • Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

            – terdong
            Jan 3 at 7:37













          • @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

            – pme
            Jan 3 at 8:20











          • yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

            – terdong
            Jan 3 at 11:40



















          Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

          – terdong
          Jan 3 at 7:37







          Thanks. But unfortunately I've been already doing it the same way as your first. And this makes me annoyed.

          – terdong
          Jan 3 at 7:37















          @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

          – pme
          Jan 3 at 8:20





          @terdong Me too;) so I switched to the 2. possibility. But of course if there is a more elegant solution I would also take it gladly;)

          – pme
          Jan 3 at 8:20













          yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

          – terdong
          Jan 3 at 11:40







          yep. jQuery is convenient. But I think jQuery is too heavy. And it is a tendency not to use more and more. Therefore I haven't been using jQuery from this project. In conclusion, I can't help but wait for next solution.

          – terdong
          Jan 3 at 11:40






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f53996512%2fhow-to-fix-the-red-mark-that-appears-when-using-binding-scala-in-intellij%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

          Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

          ts Property 'filter' does not exist on type '{}'

          mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window