| Issue 54: | Actions related to slider objects do not work | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. Define a slider object with an action Example: <slider constraints="3,43,5,1" minimum="0" maximum="255" value="200" action="transparencyAction" id="transparency" />
2. Define a Java action
public Action transparencyAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
// Read the transparency to use
//
System.out.println("DEBUG: This event is not called. It is a swixml bug. Open a ticket");
}
};
3. Move le slider
What is the expected output? What do you see instead?
I expect the action to be called, but instead the action is not called
What version of the product are you using? On what operating system?
Swixml 2.5 on Windows
Please provide any additional information below.
Sep 16, 2010
Project Member
#1
bartolom...@gmail.com
Status:
Accepted
Sep 17, 2010
hi
you right ... on the slider component action is not implemented (yet)
Meanwhile you could solve the problem using 'bindWith' attribute as shown below:
1.) Add bindWith to Xml tag
==================
<slider constraints="3,43,5,1" minimum="0" maximum="255" value="200" id="transparency" bindWith="transparency"/>
2.) add setter/getter on your Dialog
======================
public final int getTransparency() { return transparency; }
public final void setTransparency(int value) {
System.out.println("DEBUG: This setter is automatically called every change. " + value );
this.transparency = value;
}
That's all ... use setter as an event handler.
Hope this help
However I'll add the action support ...
Status:
Started
Apr 20, 2011
(No comment was entered for this change.)
Status:
Fixed
|