-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
click button end text focus on mobile #19
Comments
Pay attention zebra on mobile is not something what is completed. It requires investment more time for testing and polishing.
Few examples of dummy test zebra mobile application can be found following the links below: |
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 |
Cannot understand the first part of question. 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"
})
}
}); |
root.find("//Button")._.add(function() {
console.log('' no works (: " )
});
var btn2 = new Panel(MouseListener,Composite, [
function mousePressed(e){
console.log('' works :)" )
}
]); |
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:
var button = new Button([
function mousePressed(e) {
this.$super(e); // don't forget call super implementation of the method
// put some code below
...
}
]);
zebra.ui.events.addListener(new MouseListener([
function mousePressed(e) {
if (e.source == myButton) {
...
}
}
])); |
after soluction 1 , how can I set name button , I don't find into apidoc Class zebra.ui.Button the property. thanks |
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"); |
var button = new Button([
function mousePressed(e) {
this.$super(e);
}
]);
console.log(button.kids) /// [] no children ? |
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);
...
}
]); |
thanks :) have you intension to open a forum about zebra ? |
No, I don't have enough time to host a forum |
hi
I test the page zebra-master/samples/richui.simpleapp.html on my devices android 4.0 (sony xperia and huawei tablet )
thanks
The text was updated successfully, but these errors were encountered: