Comments (11)
Pay attention zebra on mobile is not something what is completed. It requires investment more time for testing and polishing.
- I am testing the latest version of zebra that has to be released soon and will solve such sort of problem
- It is impossible to use custom written zebra.ui.TextField component on mobile platform ("thanks" to bloody android ), but you can try to use zebra.ui.HtmlTextField component. zebra.ui.HtmlTextField is wrapped as zebra UI component standard HTML text input element.
Few examples of dummy test zebra mobile application can be found following the links below:
http://zebkit.org/samples/richui.mobile.longlist2.html (you can see zebra implemented inertial scrolling)
http://zebkit.org/samples/richui.mobile.designer.html
http://zebkit.org/samples/richui.mobile.edit.html (here you can see native input text element usage to enter text)
from zebkit.
ok
About the button , if I use :
root.find("//Button")._.add(function() {
});
don't work , instead if I add MouseListener to a component it works.
How can I add a MouseListener to a button component ?
another question :)
If I need to search a children into a zebra.ui.Panel with find( path ) , how can I ? where I set id property into the child ?
Thanks
from zebkit.
Cannot understand the first part of question.
What do you mean saying "if I add MouseListener to a component it works." ?
you can use the following construction to find a children by its property:
yourPanel.find("//*[@id='MyComp']")
the id can be assigned just as a component instance property:
var comp = new Label("My Label");
comp.id = "MyLabel";
or if you are defining your UI in JSON file:
{
"layout": { "$zebra.layout.BorderLayout": [] },
"kids": {
"TOP": {
"$zebra.ui.Label": [ "MyLabel" ],
"id": "MyLabel"
}
}
}
or if you declare your UI following JSON JavaScript style:
root.properties({
layout: new BorderLayout(),
kids: {
TOP: new Label("MyLabel").properties({
id: "MyLabel"
})
}
});
from zebkit.
root.find("//Button")._.add(function() {
console.log('' no works (: " )
});
var btn2 = new Panel(MouseListener,Composite, [
function mousePressed(e){
console.log('' works :)" )
}
]);
from zebkit.
In the first case you have registered not a mouse listener but a button event listener. The button event is logical, specific for the given component event that is fired when a button has been pressed. If, for some reason, you need to catch button mouse events you can:
- override appropriate mouse event handlers methods of the button component:
var button = new Button([
function mousePressed(e) {
this.$super(e); // don't forget call super implementation of the method
// put some code below
...
}
]);
- You can register global a listener and filter only mouse events that are designated to your particular button component. It can be done via zebra events manager:
zebra.ui.events.addListener(new MouseListener([
function mousePressed(e) {
if (e.source == myButton) {
...
}
}
]));
from zebkit.
after soluction 1 , how can I set name button , I don't find into apidoc Class zebra.ui.Button the property.
thanks
from zebkit.
if you mean a button textual title updating you can do it as follow:
button.kids[0].setValue("New text");
Not very elegant solution, but it is done for the sake of flexibility of button component look and feel customization: every UI component can be used as the button title element. Slightly better looking solution can be the following:
var title = new Label("Button text");
var button = new Button(title);
...
title.setValue("New button text");
from zebkit.
var button = new Button([
function mousePressed(e) {
this.$super(e);
}
]);
console.log(button.kids) /// [] no children ?
from zebkit.
Of course, you have not added any title to the button :). Do it as follow:
var button = new Button("MyTitle", [
function mousePressed(e) {
this.$super(e);
...
}
]);
from zebkit.
thanks :)
have you intension to open a forum about zebra ?
from zebkit.
No, I don't have enough time to host a forum
from zebkit.
Related Issues (20)
- Rotation sample HOT 7
- Keyboard Event error when run in CEF framework HOT 2
- How to trigger the tree and Combo box selected event HOT 5
- How to refresh page after I have updated the UI component? HOT 7
- The zebkit canvas will block the html event.
- Calendar can't choose time, minute and second HOT 2
- ui.Lable and grid cells and captions alignment is changed in latest chrome HOT 9
- Is there a possibility to export hierarchy of UI components to ZSON? HOT 2
- INPUT fields: Unable to enter special / national characters HOT 2
- How to stop event in zebra?
- Does zebkit works with webpack?
- Error on display text, this is empty in Edge and Internet Explorer version 11-10
- Resizing the left caption of Grid
- When We create Object of new ui.zCanvas(element,width,height) except chrome other browser throw type undefine or null error. HOT 2
- Issue regarding margin left or padding left to label.
- HtmlTextField can't works in modal window HOT 1
- Future of Zebkit HOT 2
- HtmlElement Placed In ShaperPan Is Not Visible
- how can I change the text label of a button? HOT 4
- setFullSize causing an issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zebkit.