Mobile widgets [message #917838] |
Thu, 20 September 2012 09:36  |
Eclipse User |
|
|
|
Hi,
I have a small problem with the datepicker widget. When include other handlers like this "ui div{children = [logon.ui]}" in my application the datepicker stops working properly. This happens also when using infobus. Date is set to 1972 Mar 3 and the application tends to freeze. This is solved by defining the datepicker in a function so it is not crated initially, but that makes it difficult to refer to selected date elsewhere. Anyone knows if this is a bug or have some ideas how to avoid the "1972" problem?
/Trond
|
|
|
Re: Mobile widgets [message #918653 is a reply to message #917838] |
Fri, 21 September 2012 03:59   |
Eclipse User |
|
|
|
Hi Trond,
I can't reproduce the problem. Here is the code snippet I used.
handler demo type RUIhandler{initialUI = [ ui], onConstructionFunction = start, cssFile = "css/Datepicker.css", title = "index"}
ui div{children = []};
function start()
_logonHandler logon{};
ui.children = [_logonHandler.ui];
end
end
handler logon type RUIhandler{initialUI =[ui
], onConstructionFunction = start, cssFile = "css/Datepicker.css", title = "logon"}
ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children = [ DatePicker ]};
DatePicker DojoMobileDatePicker{ layoutData = new GridLayoutData{ row = 1, column = 1 } };
function start()
end
end
Would you mind pasting a code snippet here to show us how do you use the widget? It would help us to resolve your problem.
Regards,
Smyle
|
|
|
Re: Mobile widgets [message #918730 is a reply to message #918653] |
Fri, 21 September 2012 05:38   |
Eclipse User |
|
|
|
Hi Smyle,
Thank you for looking into this! Your code worked fine here too, but here is an example of my failing code:
import org.eclipse.edt.rui.infobus.InfoBus;
import org.eclipse.edt.rui.widgets.Div;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import dojo.mobile.widgets.DojoMobileDatePicker;
handler x2 type RUIhandler{initialui =[ui], onConstructionFunction = start, cssFile = "css/com.ibm.egl.rui.dojo.mobile.samples.css", title = "DojoMobileViewSample"}
x1 x1{};
ui div{children = [ x1.ui ]};
divx div{layoutData = new GridLayoutData{row = 1, column = 1}, children =[
]};
DatePicker DojoMobileDatePicker{ };
function start()
InfoBus.subscribe("LOGON", start2);
end
function start2(eventName string in, data any in)
ui.children = [datepicker];
end
end
import org.eclipse.edt.rui.infobus.InfoBus;
import org.eclipse.edt.rui.widgets.GridLayout;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import dojo.mobile.widgets.DojoMobileButton;
handler x1 type RUIhandler{initialUI =[ui
], onConstructionFunction = start, cssFile = "css/SelectM.css", title = ""}
ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children =[Button]};
Button DojoMobileButton{layoutData = new GridLayoutData{row = 2, column = 2}, text = "Button", width = "100", onClick ::= Button_onClick};
returnP string = "BAD";
function start()
end
function Button_onClick(event Event in)
returnP = "OK";
InfoBus.publish("LOGON", returnP);
end
end
/Trond
|
|
|
Re: Mobile widgets [message #922678 is a reply to message #918730] |
Tue, 25 September 2012 04:20   |
Eclipse User |
|
|
|
Hi Trond,
I reproduced ur problem. I think it is probably due to the missing of parent when it is being initialized. You can work around it by adding a fake parent, here is my modified code based on the code you provided.
import org.eclipse.edt.rui.infobus.InfoBus;
import org.eclipse.edt.rui.widgets.Div;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import dojo.mobile.widgets.DojoMobileDatePicker;
handler x2 type RUIhandler{initialui =[ui,fakeParent], onConstructionFunction = start, cssFile = "css/com.ibm.egl.rui.dojo.mobile.samples.css", title = "DojoMobileViewSample"}
x1 x1{};
ui div{children = [ x1.ui ]};
fakeParent div{ style="display:none", children=[DatePicker]};
divx div{layoutData = new GridLayoutData{row = 1, column = 1}, children =[
]};
DatePicker DojoMobileDatePicker{ };
function start()
InfoBus.subscribe("LOGON", start2);
end
function start2(eventName string in, data any in)
ui.children = [ DatePicker ];
end
end
Regards,
Smyle
|
|
|
|
Powered by
FUDForum. Page generated in 0.08167 seconds