cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get user input from dynpage component

Former Member
0 Kudos

Hi!

What I am basically trying to do here is have a dynpage with a drop-down list of choices. I have the drop-down list placed within a gridlayout in the doProcessBeforeOutput() method where I assign an id to it. In my onSubmit() method I try to get the chosen input from the list like this:

AbstractDataType drop_down = context.getDataForComponentId("date_operators");

String str = drop_down.toString();

This is using the exact same id as when I first created the drop-down list, but for some reason drop_down in the code above is null. Why is this happening? Is it maybe because the list is in a GridLayout? Am I placing the calls in the wrong dynpage method? I would really appreciate any ideas on this.

Cheers,

--Sebastian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sebastian,

Try this;

DropdownListBox dropdown = (DropdownListBox)this.getComponentByName("date_operators");

String selection = dropdown.getSelection();

I hope it helps,

Patrick.

Answers (2)

Answers (2)

Former Member
0 Kudos

Fixed it! Mistyped an integer name!

Former Member
0 Kudos

I don't think my previous post got through. Our server is acting funny. What I said was: thanks a lot, it really worked. I tried the same approach on an InputField, of course using the toString() method, but although I type things in the field, only null is found. I can't understand it, really. Maybe you have some ideas about this as well?

Cheers,

--Sebastian