05-27-2020 10:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 10:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
So, I basically have a counting app, and I've got pretty far for not knowing a single thing about how to do it. However, I have a combo-button thing, and that's supposed to let the side buttons be able to be the buttons on screen. However, my event listener only takes the button on screen input, but not the side button. If anybody could help, that would be great!
I'll post my code here:
import document from "document";
const score = document.getElementById("score");
const btntr = document.getElementById("btntr");
const counter = 0;
btntr.addEventListener("click", () => {
counter = counter + 1;
score.text = `${counter} `;
console.log("TOP RIGHT!");
});
Answered! Go to the Best Answer.

Accepted Solutions
05-27-2020 13:02 - edited 05-27-2020 13:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 13:02 - edited 05-27-2020 13:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Ok. I see. It is still beyond me a bit, but here is what I would do.
1) Make sure I am setting up the buttons correctly. You need to use the Combo Button class, not just a regular button positioned on the side. The button needs an entry in 3 files.
- Only once for all instances import in widgets
- The svg for each in index
- The implementation for each in your Javascript file.
2) I would then make certain I was using the primary and secondary buttons (the two right-hand ones).
If it still did not work, I would bypass the software buttons altogether and try just getting a hardware button to work first. Then integrating the two.

05-27-2020 12:02 - edited 05-27-2020 12:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 12:02 - edited 05-27-2020 12:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
When you say side buttons, do you mean the corner combo buttons, or the hardware buttons on the Versa 1 and Ionic? I can help with the former, but the latter is a bit beyond me.

05-27-2020 12:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 12:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 13:02 - edited 05-27-2020 13:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 13:02 - edited 05-27-2020 13:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Ok. I see. It is still beyond me a bit, but here is what I would do.
1) Make sure I am setting up the buttons correctly. You need to use the Combo Button class, not just a regular button positioned on the side. The button needs an entry in 3 files.
- Only once for all instances import in widgets
- The svg for each in index
- The implementation for each in your Javascript file.
2) I would then make certain I was using the primary and secondary buttons (the two right-hand ones).
If it still did not work, I would bypass the software buttons altogether and try just getting a hardware button to work first. Then integrating the two.

05-27-2020 16:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 16:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Okay. I'll try that, and get back to this thread in a moment.

05-27-2020 16:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-27-2020 16:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
So far, this seems to work. Now to my next problem...
Thanks!
05-28-2020 05:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-28-2020 05:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Excellent. Good luck and have fun.

