jsf - Problem in filling SelectOneMenu with data -


In my ApplicationBean1.java class, I have an option [] attribute year and a filling method:

< Pre> Public Zero Construction Year () {} Initial Year = 1900; Int present = calendar.justinstance (). Get (Calendar. IEER); Int i = 0; For (int y = initial year; y & lt; current year; y ++) {option op = new option (y, integer.tustin (y)); Year [i] = op; I ++; }}

And this is my jsp page which is using icefax:

   & Lt; / Ice: selectOneMenu>  

My problem is that in the current year (2010) from the year 1900 are not appearing in the drop downlists (SelectionOpen menu).

Anyone help me understand this?

I do not have icefaces, so it can work differently I do not know, but you Generally, do not feed f: select item with one, or option [] or whatever, whatever.

This should work:

  Private list & lt; SelectItem & gt; Years; // + Recipient Public Zero Construction Year () (Last Interval Initial Year = 1900; Final Interval Current = Calendar. Get Instance (). (Calendar .YEAR); (Initial Year = Initial Year; Year and Lieutenant; Current year; year ++) {years.add (new selection item (year, string.value (year));}}  

if it is still not giving anything , Then you are probably calling buildYearOptions () at the wrong moment or maybe Are not calling


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -