# Help with custom component creation

**URL:** <https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452>\
**Category:** 3rd Party Modules\
**Created:** [November 20, 2012, 3:56pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452 "2012-11-20T15:56:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maz](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@maz](https://forum.inductiveautomation.com/u/maz)\
**Post date:** [November 20, 2012, 3:56pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/1 "2012-11-20T15:56:40Z")

</div>

Hi all,  
I’m making some custom components using the Ignition SDK ComponentExample as a loose template and I’ve run into a bit of a brick wall. I made a nifty little jPanel element that builds nicely into an importable module and shows up where it should in a custom Component Palette tab, and does everything that I want it to so far, but the problem I’m having is getting it to display all the custom properties I want to add. Some do show up, though, and I can’t tell why others don’t.

In the following code the ‘text’ field shows up but 'isClicked does not. I have variables declared before calling initComponents:

`	public String text = "Look at That!";
	private boolean isClicked = false;
    public PushPinRight() {
        initComponents();
    }`  
…

[code] public String getText() {  
return text;  
}  
public void setText(String text) {  
// Firing property changes like this is required for any property that has the BOUND\_MASK set on it.  
// (See this component’s BeanInfo class)  
String old = this.text;  
this.text = text;  
firePropertyChange(“text”, old, text);  
repaint();  
}

```
public boolean getisClicked() {
    return isClicked;
    
}
public void setisClicked(boolean isClicked) {
	// Firing property changes like this is required for any property that has the BOUND_MASK set on it.
	// (See this component's BeanInfo class)
	boolean old = this.isClicked;
	this.isClicked = isClicked;
	firePropertyChange("isClicked", old, isClicked);
	repaint();
}[/code]

```

and in the BeanInfo file

`	super.initProperties();
	addProp("text", "Text", "The text to display in the component", CAT_DATA, BOUND_MASK);
	addProp("isClicked", "Is Clicked", "holds open popup information when True", CAT_DATA, BOUND_MASK);`

Does anyone have an idea as to why one works and the other does not? Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 20, 2012, 4:00pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/2 "2012-11-20T16:00:20Z")

</div>

Your getter/setter naming for isClicked is wrong - you need to follow JavaBean conventions.

The proper naming for a boolean “clicked” would be setClicked() and isClicked().

---

<div class="post-metadata">

**Author:** ![maz](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@maz](https://forum.inductiveautomation.com/u/maz)\
**Post date:** [November 20, 2012, 4:01pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/3 "2012-11-20T16:01:58Z")

</div>

The boolean is declared as “isClicked”.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 20, 2012, 4:31pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/4 "2012-11-20T16:31:53Z")

</div>

Well change it to “clicked” and then use the getter/setter names I suggested and see if it works.

---

<div class="post-metadata">

**Author:** ![maz](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@maz](https://forum.inductiveautomation.com/u/maz)\
**Post date:** [November 20, 2012, 4:41pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/5 "2012-11-20T16:41:55Z")

</div>

Interesting, that worked, although I still can’t use that property to change the variable’s condition from the Property Window. Does that have to do with a naming convention, like ‘get’ or ‘set’ must be followed by a capital letter to be recognized?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 20, 2012, 4:44pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/6 "2012-11-20T16:44:10Z")

</div>

Yeah, along with some more rules. It’s referred to as the JavaBean naming convention - you may want to read about that a bit.

Naming a boolean variable ‘isClicked’ is not best practice and would result in you needing setters/getters named something like ‘setIsClicked()’ and ‘isIsClicked()’ - I think…

---

<div class="post-metadata">

**Author:** ![maz](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@maz](https://forum.inductiveautomation.com/u/maz)\
**Post date:** [November 20, 2012, 4:51pm UTC](https://forum.inductiveautomation.com/t/help-with-custom-component-creation/5452/7 "2012-11-20T16:51:43Z")

</div>

Thanks for your help!
