on 06-04-2009 6:40 AM
Hello All.
I am designing a page where the date should be made available in a selection drop down which has a calendar from where the user could select the date. Right now I am able to get the whole calendar.
regards,
SampathKumar G.
Hi,
In order to show the dates in dropdown first you need to have clear requriement as Howmany months/dates can be shown. Do you want to show dates of 1particular year/current year...
Showing the calendar values in the dropdown is not a good design as the dropdown values can be too long. To select a value from dropdown looks cumbersome, not feasible to select the values.
You need to restirct the dates to be shown in the dropdown depending on the requirment.
How about using a date navigator UI element.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the WDCONTEXT->get_attribute( 'DATE' )-if attribute is bound directly to root node) so that you can get the value or use the code wizard and read the attribute.
Based on this value disbale the fields/values as per your requirement.
Are you showing data based on this given date. What are the other UI elements are you using .
Regards,
Lekha.
Hi Sampath,
This seems to be a simple task. Let me try to say what I understood about your task. You have an input field on your screen which accepts a date from the user. You want to read the date entered by the user and displayed the corresponding data in the table below. Right?
Something like the user enters FLDATE in the input field and you want to display all SFLIGHT information where FLDATE = <your input> Is this the case?
If yes then you just bind your input field to an context attribute of type date. Place a button up on pressing which you want the value in the input field to be read & the table to be populated.
ex: I have 2 context nodes INPUT & SFLIGHT. INPUT has a cardinality of 1..1 and has just 1 context attribute DATE of type SYDATUM under it. The node SFLIGHT has a cardinality of 0..n and has CARRID, CONNID, FLDATE & PRICE as attributes under it.
Now I placed an input field on my layout and bound its "value" property to the context attribute DATE. I place a table and create a data binding with the context node SFLIGHT. I have a push button up on pressing which I want to read the date entered by the user & populate my table. I associate an eventhandler FETCH_DATA with the onAction event of my table. Below is the coding within my event handler:
METHOD onactionfetch_data .
DATA: wd_node TYPE REF TO if_wd_context_node,
lt_sflight TYPE wd_this->elements_sflight,
lv_date TYPE wd_this->element_input-date.
wd_node = wd_context->get_child_node( name = 'INPUT' ).
wd_node->get_attribute( EXPORTING name = 'DATE'
IMPORTING value = lv_date ).
wd_node = wd_context->get_child_node( name = 'SFLIGHT' ).
SELECT carrid
connid
fldate
price FROM sflight INTO TABLE lt_sflight WHERE fldate = lv_date.
wd_node->bind_table( new_items = lt_sflight ).
ENDMETHOD.
Now when the user enters a date and presses on the push button the SELECT gets executed & fill the table with any rows that it might match. Please note that in order to keep the example simple I am not handling any special cases like the user pressing the push button without entering any date, the user entering an invalid date format, no flights existing in SFLIGHT with the date entered by the user...
You would have to consider all such cases and use throw out relevant messages to the user.
Regards,
Uday
Hi All.
Thanks for the response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.