sql server 2008 - fetching data from combobox list in vaadin -


Please correct this code;

I have a combo box that has been developed in the Wideen framework and an SQL Server. There are 3 stable prices in the order of 3,3,1 years respectively, please help me connect the audience for these 3 options and tell me that when the value (X = 5 years) is chosen, it has been in the last 5 years Must show all the values ​​like 3 years and 1 year wise, please help me.

  comboDateOrigine.addListener (new property. Value Change Listener) {Change the public zero value (value variable event) {if (event.getProperty () GetValue ()! = Null) {If ( Event.getProperty (.) GetValue (). ToString () == "5 Answers") {comboDateOrigine.select (ListOptions.get (0)); WebProject's SELECT DateOrigine where dateOrigine = (current date - (5 years)) and If (ogargin = (current date - (3 years)) and (if) date (ogren =) (to date) (to 3 years); combo (date 3) "(3 years") combo dateoffin.accept (listoptis. Gate (1)); If (com Bodetagrine.get Value (). ToString () == "1 year") {comboDateOrigine.select (ListOptions.get (2)); WebProject from SELECT DateOrigine where dateOrigine = (current date - (1years))}} {} / Combo box combo dateoffin reset .set value (empty);}}}); ComboDateOrigine.setImmediate (true);  

Firstly I suggest using it

  comboDateOrigine AddValueChangeListener (New ValueChangeListener () {@Override Change Public Zero Value (ValueChangeEvent Event) {// ...});  

To get the chosen value, I do not know how this combo was created (custom made items, items are obtained from dbb), but

< Pre> comboDateOrigine.getValue ();

Gives the value of the property used in the form of "ID" if your combibox uses a "complex" object then you may get better assets to query, such as

  Item selected items = comboDateOrigine.getContainerDataSource (). GetItem (comboDateOrigine.getValue ()); Integer year = (integer) selected item .getItemProperty ("year"). GetValue ();  

There is a small snippet here for manipulative dates

  calendar c = calendar. GetInstance (); C.setTime (date); C.add (calendar.date, 1); C.getTime (); // -> Returns the date + 1  

About the actual query in the class created & amp; Cum It should be a good starting point.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -