on 05-25-2009 11:54 AM
Hi,
I'm using an radiobuttongroupbykey and a datenavigator. I've assigned a context element to the respective selectedKey and selectedDate properties of the UI elements. however the context elements are allways null.
is there a chance I need to create these context elements when first run? if so how do I create a value node in the context root? and if not what might be the problem here?
thanks in advance.
Regards,
Alperen
For using a RadioButtonGroupByKey you need a datatype with a value set. The "selectedKey" property must be bound to a context attribute (can be at root-level) of that datatype. Initially this context attribute has value NULL. When you select a radio button of the group, the attribute value will contain the corresponding key from the value set.
Have you bound the selectedKey property correctly? Do you see the radio buttons at runtime?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have solved the datenavigator issue. now the field I assigned to the lastselecteddate and firstselected date is filled with the date I select and not null anymore.
however the selectedKey property still has a null value. so I solved this problem by running over the node containing the values and finding the leadselection.
Regards,
Alperen
Hi,
Regarding the selectedDate:
In WebDynpro you can use DateNavitor UI element to show the calander for more than one month at a time.
For this UI element you need to bind the context attributes of type (date) to the below properties
1. FirstSelectedDate
2. LastSelectedDate
Or
You can simply take a inputfield and bind a context attribute of type date and bind that context attribute to that inputfield.
Automatically date navigator will be displayed along with that input field at run time.
Note: In both the cases you need not to initialize the context attributes.
Whenever user selects a date on the screen automatically these context attributes will be filled with selected date.
You can get that selected date using the below code.
For example, if the context attribue created is SelectedDate(type: date)
wdContext.currentContextElement().getSelectedDate();
Regarding SelectedKey for RadioButton Group
As Armin said, You need to create a simple type first.
For example create a simple type "Choice" and in Enumeration tab enter the choces as Value & Description pairs.
Value Description
Y Yes
N No
Create one context attribute of name "Choice" and in the type property select "Choice" simple type from local dictionary.
And create RadioButtonGroup UI element and bind this attribute to "selectedKey" property
At runtime, two radio buttons will be displayed in the group with Descriptions as labels.
When you try to get the selected choice using the below code
wdContext.currentContextElement().getChoice();
The above code will give the values (Y/N) not the descriptions.
Regards,
Charan
Edited by: SRI KRISHNA CHARAN on May 25, 2009 3:04 PM
Edited by: SRI KRISHNA CHARAN on May 25, 2009 3:09 PM
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 | |
9 | |
7 | |
7 | |
6 | |
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.