[SOLVED] Unique IDs of custom control definition

Hi,

I’ve found this code snippet: http://hub.jmonkeyengine.org/forum/topic/textarea-with-line-wrapping-code/ . But when I instantiate the control twice in my XML gui definition I get the following: [java]szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-scrollpanel-child-root] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textpanel] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [areatext] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-vertical-scrollbar] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-vertical-scrollbar#nifty-internal-vertical-scrollbar#background] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-vertical-scrollbar#nifty-internal-vertical-scrollbar#background#nifty-internal-vertical-scrollbar#background#position] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-horizonal-panel] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-horizonal-panel#nifty-internal-horizontal-scrollbar] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-horizonal-panel#nifty-internal-horizontal-scrollbar#nifty-internal-horizontal-scrollbar#background] detected. Consider making all Ids unique or use #id in control-definitions.
szept. 03, 2013 8:01:57 DU de.lessvoid.nifty.screen.Screen registerElementId
WARNING: Possible conflicting id [textScrollpanel#nifty-internal-horizonal-panel#nifty-internal-horizontal-scrollbar#nifty-internal-horizontal-scrollbar#background#nifty-internal-horizontal-scrollbar#background#position] detected. Consider making all Ids unique or use #id in control-definitions.[/java]

I can’t figure out what’s wrong with the code and what does that ‘or use #id in control-definition’…

Thanks for any help,
Adam.

Nevermind it, I found the solution.

One has to insert a ‘#’ in front of the id both in the XML and the code so the instanciated controls’ ids will not conflict with eashother.

1 Like