Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EGL Development Tools » Mobile widgets(Datepicker)
Mobile widgets [message #917838] Thu, 20 September 2012 13:36 Go to next message
Trond Einar Nilsen is currently offline Trond Einar NilsenFriend
Messages: 36
Registered: December 2011
Member
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 07:59 Go to previous messageGo to next message
Smyle H is currently offline Smyle HFriend
Messages: 58
Registered: September 2012
Member
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 09:38 Go to previous messageGo to next message
Trond Einar Nilsen is currently offline Trond Einar NilsenFriend
Messages: 36
Registered: December 2011
Member
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 08:20 Go to previous messageGo to next message
Smyle H is currently offline Smyle HFriend
Messages: 58
Registered: September 2012
Member
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
Re: Mobile widgets [message #924461 is a reply to message #922678] Wed, 26 September 2012 21:45 Go to previous message
Trond Einar Nilsen is currently offline Trond Einar NilsenFriend
Messages: 36
Registered: December 2011
Member
Thank you Smyle, this helped me solve the problem
Rgds Trond
Previous Topic:Library From Database problem
Next Topic:Rosetta Code
Goto Forum:
  


Current Time: Wed Apr 24 20:16:05 GMT 2024

Powered by FUDForum. Page generated in 0.02352 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top