0

I have following code:

<netui:select dataSource="actionForm.myType" defaultValue="1">
    <netui:selectOption value="1">Not my stuff</netui:selectOption>
    <netui:selectOption value="2">My stuff</netui:selectOption>
    <netui:selectOption value="4">Random</netui:selectOption>
</netui:select>

I am expecting to get only 3 options for drop-down. Instead I am getting option 4, extra one is a 0 - zero and it is selected by default! Where is this zero coming from? How do I get rid of it? I tried to disable the option, I tried to select something else by default but zero option persists and behaves like a default option.

Here is resulting html:

<select name="somePortlet_2wlw-select_key:{actionForm.myType}">
    <option value="1">Not my stuff</option>
    <option value="2">My stuff</option>
    <option value="4">Random</option>
    <option value="0">0</option>
 </select>

P.S: Please no JavaScript work around, I know it is possible but not desirable right now.

MeIr
  • 7,236
  • 6
  • 47
  • 80
  • Check this, sounds like it answers your question: https://community.oracle.com/thread/803595?start=0&tstart=0 – Display Name is missing Mar 13 '14 at 21:39
  • I'll try tomorrow and will let you know. – MeIr Mar 14 '14 at 00:25
  • @better_use_mkstemp hey, I verified - solution works!!! Please can you take it and post it here (may be copy paste) part that is relevant so that if others search can find it. I'll accept your answer. P.S: also add the link to the answer just in case. Thanks!!!!!! – MeIr Mar 14 '14 at 14:35

1 Answers1

2

The solution to the problem ended up being the following:

In the JPF, for the form bean, are you declaring your id like this?

private int id;

If so, try declaring it with a valid value, like:

private int id = 1;

Found via: https://community.oracle.com/thread/803595?start=0&tstart=0

Display Name is missing
  • 6,197
  • 3
  • 34
  • 46