StablexUI
StablexUI copied to clipboard
InputText field not working ( not taking inputs )
Hi,
This is my first app using stablexui I am quite old fan of stablexui but now has a chance to implement it, I need InputText to take input from user, inputtext appears but does not take input I tried neko, linux and then I tried android not any app taking input or showing keyboard after clicking the inputtext field. Here is the code
UIBuilder.setTheme('ru.stablex.ui.themes.android4');// even excluding this line has same effect
UIBuilder.init();
var widget = UIBuilder.create(InputText, {
left : 50, top : 200, text: "Enter" });
flash.Lib.current.addChild( widget );//UIBuilder.buildFn("Assets/ui/test.xml") );
( another bug ) when using buildFn, as commented above throws following error:
Error:(1, -1) ?__ui__arguments : Dynamic -> ru.stablex.ui.widgets.Text should be openfl.display.DisplayObject
Also unable to find any inputtext demo :(
buildFn should be used like this:
flash.Lib.current.addChild( UIBuilder.buildFn("Assets/ui/test.xml")() );
As for the inputText i'll check it later today
Looks like your input field hase zero width and height. Try changing its size to something reasonable.
Thanks, buildfn working great :+1:
I have added width, its making text "Enter" streched. Still not taking inputs, strangely adding height make the field disappear completely. My new code when text is streching:
var widget = UIBuilder.create(InputText, {
left : 50, top : 200, width: 200, text: "Enter" });
I am not sure if its related or not, the above inputtext issue is with openfl [3,2,2] while setting it to openfl[3,3,3] there is null iter bug, see:
Information:- Copying template file: /usr/lib/haxe/lib/openfl/3,3,3/templates/haxe/ApplicationMain.hx -> Export/linux64/neko/haxe/ApplicationMain.hx Information:Called from ? line 1 Information:Called from CommandLineTools.hx line 1359 Information:Called from CommandLineTools.hx line 25 Information:Called from a C function Information:Called from CommandLineTools.hx line 126 Information:Called from CommandLineTools.hx line 579 Information:Called from lime/project/PlatformTarget.hx line 70 Information:Called from lime/tools/platforms/LinuxPlatform.hx line 341 Information:Called from lime/tools/helpers/FileHelper.hx line 375 Information:Called from lime/tools/helpers/FileHelper.hx line 358 Information:Called from lime/tools/helpers/FileHelper.hx line 150 Information:Called from /usr/lib/haxe/std/haxe/Template.hx line 110 Information:Called from /usr/lib/haxe/std/haxe/Template.hx line 366 Information:Called from /usr/lib/haxe/std/haxe/Template.hx line 376 Information:Uncaught exception - Cannot iter on null
You should use w
and h
properties instead of width
and height
sorry friend still no difference, I am on Lubuntu 15.04 does it has to do with the problem.
I doubt it's related to OS version (i test on Ubuntu 14.04). Can you show full source code and library versions?
stablexui[1.1.5] openfl[3.2.2] actuate[1.8.6]
my app is not working in html5, therefore for e.g. openfl "AddingText" sample project, main.hx (Note: same code is accepting input in html5 )
package;
import ru.stablex.ui.themes.android4.defaults.Button;
import ru.stablex.ui.themes.android4.defaults.InputText;
import ru.stablex.ui.widgets.Checkbox;
import ru.stablex.ui.widgets.InputText;
import openfl.text.TextFieldType;
import ru.stablex.ui.widgets.Text;
import ru.stablex.ui.widgets.Button;
import ru.stablex.ui.UIBuilder;
import openfl.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
UIBuilder.setTheme('ru.stablex.ui.themes.android4');
UIBuilder.init();
var widget = UIBuilder.create(InputText, {
left : 50, top : 200, w: 200, h: 20, text: "Enter" });
flash.Lib.current.addChild( widget );
}
}
Can you try with latest OpenFL? For me it works fine on all targets.
Yes I tried I mentioned it before see: I am not sure if its related or not, the above inputtext issue is with openfl [3,2,2] while setting it to openfl[3,3,3] there is null iter bug, see:
Information:- Copying template file: /usr/lib/haxe/lib/openfl/3,3,3/templates/haxe/ApplicationMain.hx -> Export/linux64/neko/haxe/ApplicationMain.hx Information:Called from ? line 1 Information:Called from CommandLineTools.hx line 1359 Information:Called from CommandLineTools.hx line 25 Information:Called from a C function Information:Called from CommandLineTools.hx line 126 Information:Called from CommandLineTools.hx line 579 Information:Called from lime/project/PlatformTarget.hx line 70 Information:Called from lime/tools/platforms/LinuxPlatform.hx line 341 Information:Called from lime/tools/helpers/FileHelper.hx line 375 Information:Called from lime/tools/helpers/FileHelper.hx line 358 Information:Called from lime/tools/helpers/FileHelper.hx line 150 Information:Called from /usr/lib/haxe/std/haxe/Template.hx line 110 Information:Called from /usr/lib/haxe/std/haxe/Template.hx line 366 Information:Called from /usr/lib/haxe/std/haxe/Template.hx line 376 Information:Uncaught exception - Cannot iter on null
Latest OpenFL is 3.3.6. I checked against 3.3.3 and it works for me (Ubuntu 14.04, x64). I guess that exception is related to some conflicts on your machine.
my badluck :(
after update to openfl 3.3.6, I am having same "Uncaught exception - Cannot iter on null" ( and sure its related to openfl only, as I have commented out everything and still getting it), Alas :`(
ok here I am again with a different test: While using OS "ubuntu 15.04x64" My current version of openfl was 3.1.4, then I updated it to openfl 3.3.6 and tested the app it worked and was taking input in neko and problem was solved 100%.
And just for testing/checking why it is buggy in "lubuntu" I installed openfl 3.2.2, then tested the app "openfl test neko" and the uncaught exception start appearing, then I went back to openfl 3.3.6 and tested, still "uncaught exception" is there and now I am unable to test the app again stuck with "uncaught exception" in ubuntu 15.04 as well :(
I will recommend you once install openfl 3.2.2 and test the app then again switch to 3.3.6 and test you will get error on your machine as well.