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

asked 07 Feb '14, 03:55

Raymond's gravatar image

Raymond
24328
accept rate: 0%


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,
Yalim

link

answered 09 Feb '14, 01:50

Yalim's gravatar image

Yalim ♦♦
2.8k5
accept rate: 21%

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

   select action_date, trunc(action_date) just_date, to_char(action_date,'24hr') hours,
          to_char(action_date,'mi') minutes 
   from  my_table.

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.

action_date := to_date(:just_date||' '||:hours||':'||:minutes,'dd-mon-rrrr hh24:mi')

Regards Raymond

link

answered 09 Feb '14, 02:59

Raymond's gravatar image

Raymond
24328
accept rate: 0%

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 ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7
×4
×3

Asked: 07 Feb '14, 03:55

Seen: 1,162 times

Last updated: 10 Feb '14, 10:02


© Copyright Gerger 2017