on 08-24-2004 5:41 PM
Hello everybody,
can anybody tell me how to make use of the DateNavigator UI element? I'm looking for code examples or a tutorial.
Thanks,
Christian
Hi Christian,
i'm afraid, there is no tutorial using it available so far. The most comprehensive documentation i found is available in the NWDS help (and an identical one in help.sap.com), if you search for the terms "Web Dynpro DateNavigator IWDDateNavigator".
So i suggest to build a sample application and to return to the forum, if you run into problems. Usage is not that complex IMHO.
Hope that helps.
Best regards
Stefan
@Pran & Vishnu: The DatePicker (control) is <b>not</b> the DateNavigator (UI element) as you both know for sure already
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
I have attached the code snippet that might help you. Put this code in wdDoModifyView method in the view.
IWDTransparentContainer root = (IWDTransparentContainer)view.getRootElement();
if(firstTime){
IWDDateNavigator dn = (IWDDateNavigator)view.createElement(IWDDateNavigator.class, "Date_Navigator");
dn.setFirstSelectedDate(new java.sql.Date(2004-01-01));
dn.setMonthsPerColumn(2);
dn.setMonthsPerRow(2);
dn.setLastSelectedDate(new java.sql.Date(2004-12-31));
dn.setSelectionMode(WDDateSelectionMode.SINGLE);
root.addChild(dn);
}
Also, thanks to Stefan in pointing out that Date Picker and Date Navigator are different. I thought both of them meant the same UI Element.
Thanks and Regards,
Vishnu Prasad Hegde
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you all, the NW04 documentation on help.sap.com was very helpful.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
As mentioned by Pran, this is how you use DateNavigator:
<u>If you want to use it statically:</u>
1) Create a value attribue in the view context. Let its type be "Date"(you can set this in the properties for this value attributes.)
2) Create an InputField. In the Element properties of this InputField Element, bind the "value" property to the value attribute that you just created. You are done...
<u>If you want to use it dynamically:</u>
1) Create a value attribute in the view context. Say, its name is "Val1"
2) in "wdDoModifyView" of the view, create the input field dynamically and bind its value to the value attribute in the context.
IWDTransparentContainer root = (IWDTransparentContainer)view.getRootElement();
if(firstTime){
IWDInputField ip1 = (IWDInputField)view.createElement(IWDInputField.class, "UI_Test"); //Here "UI_Test" is just a Unique Identifier
ip1.bindValue("Val1"); //here bindValue(String path) is used
/**** Note that path represents path in the context. Suppose, you had created value attribute "Val1" as the child of a node, say "Node1", then the parameter for the above method would be "Node1.Val1" ****/
root.addaddChild(ip1);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I assume if you define your value attribute to be of the type date and bind you input field to that attribute then it automatically comes with a date picker.
Regards
Pran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.