TextField Control Problem [SOLVED]

Hey guys,



I’ve been trying to create another GUI screen, and I’ve been having issues with the “textfield” control. I have my screen configured, and the panel in which I place the control shows up normally and where it’s supposed to be, but the control never shows up. I’ve tried changing parameters, giving it its own screen, and a few other simple things, but nothing seems to help. Here is my Control code:



[xml]<panel width=“100%” height=“10%” childLayout=“vertical”

backgroundColor="#000a">



<control id=“input” name=“textfield” width=“100%” />



</panel>[/xml]



And here are my opening lines, if they help:



[xml]<?xml version=“1.0” encoding=“UTF-8”?>

<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>

[/xml]



If you need any more info, let me know. I have several screens stored in this file, and they all work. When I load this screen, it shows up as well, but the control is nowhere to be found.



Thanks!

-Dan

Hi,



Could you post your entire xml file (excluding the other screens)? I assume you’ve got the lines:

[xml]

<useControls filename=“nifty-default-controls.xml” />

<useStyles filename=“nifty-default-styles.xml” />

[/xml]

at the head of your file just after the <nifty …> tag.



If you’ve previously got the textfield to work in the other screens then try copying a control from a different screen into your problem one?



Lachlan

2 Likes

Alternatively you can use the following to validate your XML:



[java]

nifty.validateXml(pathToXMLFile);

[/java]



If there is a problem somewhere you’ll know where to look. (hopefully)

Another thought: you may want to check your error logs if you haven’t already… which would pick up a validation error as well.

I did have the following:



[xml]<useControls filname=“nifty-default-controls.xml” />[/xml]



As you can see, I spelled “filename” incorrectly. I caught it when I went to go doublecheck. Thanks!

1 Like
@lachlanap said:
Another thought: you may want to check your error logs if you haven't already... which would pick up a validation error as well.


The problem with that approach is that nifty spams the hell out.
@madjack said:
The problem with that approach is that nifty spams the hell out.


Yeah, I turn the nifty logging level to Warning which helps a lot for that.
@zarch said:
Yeah, I turn the nifty logging level to Warning which helps a lot for that.

Same here. I just wish it'd just crash with a relevant message though. Would be a whole lot easier to debug. Oh well...