Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8820347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:35:10+00:00 2026-06-14T05:35:10+00:00

I try to create my own kind in enyo enyo.kind( { name: DeviceButton, kind:

  • 0

I try to create my own kind in enyo

enyo.kind(
{
    name: "DeviceButton",
    kind: "Button",
    caption: "",
    published: { userAgent: "" },
    flex: 1,
    onclick: "butclick",
    butclick: function() { console.log("User agent changed to " + this.userAgent) }
})

But when I click there is nothing shown

If I just did

onclick: console.log("User agent changed to " + this.userAgent)

It was printed that this.userAgent is undefined

What am I doing wrong?

Btw., is it possible to send parameters via onclick (so that the function repsponding to the click get a variable)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:35:12+00:00Added an answer on June 14, 2026 at 5:35 am

    The problem you’re having here is that the onclick property is actually giving the name of the event handler for the Enyo to send the event to when the click is received. The “butclick” event isn’t dispatched to the DeviceButton, but rather to its parent.

    If you want to handle the event entirely within your kind, then you need to set it up as a “handler”. In Enyo 2.x, you do it like this:

    enyo.kind(
    {
        name: "DeviceButton",
        kind: "Button",
        caption: "",
        published: { userAgent: "" },
        flex: 1,
        handlers {
          onclick: "butclick"
        },
        butclick: function() { console.log("User agent changed to " + this.userAgent) }
    })
    

    In Enyo 1.x, you’d just need to name the handler function “onclickHandler”. I mention the Enyo 1 solution because I see that you have “flex: 1” in your definition. Flexbox isn’t supported in Enyo 2, we have a “Fittable” system instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to create my own linux bash script that calls truecrypt for mounting.
I try to create donate via PayPal button and add custom select with amount.
Im try to create a spinner dynamically on press of a button. this is
I try to create an array of Integers (i tried with own object but
I try to create my own capcha (ctrlCapcha :UserControl) and I would like to
I try to create my own application bar in my app based on StackPanel.
I try to create my own slide show for a personal use, and I
I try to create an own list type in haskell but, my implementation contains
I try to create my own helper but face a problem. First i create
So I try to create my own window system (because I want to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.