Skip to main content

AssignToBoundException thrown with ListBox

5 replies [Last post]
blasky
Offline
Joined: 2008-05-21
Points: 0

I've been using the NetBeans 6.1 plugin with the compiler, and can't seem to bind properly with a ListBox like so...

class VariableList {
public attribute selectedIndex: Integer;
etc...
}

var availableVariables = VariableList { etc... }

ListBox {
selection: bind availableVariables.selectedIndex
etc...
}

This compiles just fine. But when you run the app and actually click on an item in the listbox it throws a runtime exception.

Exception in thread "AWT-EventQueue-0" com.sun.javafx.runtime.AssignToBoundException: Cannot assign to bound variable

What am I missing? This was lifted almost word for word from the ListBox example I was looking at, but that was interpreted instead of compiled script, I believe. Has there been a significant change with bind and it's usage?

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tallgese2
Offline
Joined: 2008-05-31
Points: 0

Thanks, this also helped me.

Experienced same issue learning the very basics of NetBeans using the HelloWorld example.

blasky
Offline
Joined: 2008-05-21
Points: 0

Like a charm...thanks.

alexsch
Offline
Joined: 2007-07-12
Points: 0

Use [i]with inverse[/i] key words for bidirectional binding:

[code]
ListBox {
selection: bind availableVariables.selectedIndex with inverse
//etc...
}
[/code]

arungupta
Offline
Joined: 2003-06-13
Points: 0

Getting the error "Expression not supported for bind with inverse"

var label = Label {
text: bind glassfish.monitContainers[count] with inverse
}

How can this be solved ?

-Arun

arungupta
Offline
Joined: 2003-06-13
Points: 0

http://forums.sun.com/thread.jspa?messageID=10747205#10747205 has the solution for this issue.

-Arun