cancel
Showing results for 
Search instead for 
Did you mean: 

selectedKey and SelectedDate always null

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Armin,

Thank you for the quick response. I can see the radiobutton group at runtime and the selected key property is correctly linked at designtime. however no succes so far, when I try to used the selectedKey context element it is Null.

Regards,

Alperen

Former Member
0 Kudos

Can you post your exact context structure?

Armin

Former Member
0 Kudos

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

Former Member
0 Kudos

The lead-selection? The *ByKey elements do not use the lead-selection.

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

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