Hi Team, Yes I know there is no date time picker. So need to break it up in 3 fields, date , hour combo and minutes combo. What is the best way to handle this in the screen and database. Do something clever on a post change event, or do I create 3 fields in the table (yuk). How do I deal with it on the query populate the hour and min field. And how do I handle it within an editable grid. Thanks Raymond |
Hi Raymond, I would create one date field in the table (TABLE1.DATEFIELD1). (Best to to my knowledge a column of type date can store time down to the second.) In order to display the value of DATEFIELD1, I'd parse it and extract the day month time, hours and minutes. I'd display these on the screen in three fields: A date picker and two combos one for hours and one for minutes. To save any changes made on the screen back to the database, I'd put together these three values and create a value of type Date. I'd update the DATEFIELD1 in the Datasource Definition representing TABLE1 and commit the Datasource (or the application). You'd need a view with function to parse and display the information. I'd do the construction of the date value in an instead of trigger on the View. Hope this helps. Kind Regards, |
Hi Yalim, I was hoping for something simpler then a view with an instead of trigger. Can I do something like having 4 fields; date, hour, minutes and the real date field but make it hidden. The query would do something like
Then on a post-change (or whatever the event is) of any of the 3 fields assign to changed date/time to the real hidden field.
Regards Raymond Hi Raymond, Yes you can. You don't even need a hidden field. Just update the datasource column (action_date) using api_datasource.setColumnValue in the valueChanged events.
(10 Feb '14, 10:02)
Yalim Gerger ♦♦
|