1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
|
/*
* Index.java
*
* Created on 8 juin 2007, 11:09
* Copyright
*/
package webapplication1;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Button;
import com.sun.rave.web.ui.component.DropDown;
import com.sun.rave.web.ui.component.Form;
import com.sun.rave.web.ui.component.Head;
import com.sun.rave.web.ui.component.Html;
import com.sun.rave.web.ui.component.Link;
import com.sun.rave.web.ui.component.Page;
import com.sun.rave.web.ui.component.StaticText;
import com.sun.rave.web.ui.component.Table;
import com.sun.rave.web.ui.component.TableColumn;
import com.sun.rave.web.ui.component.TableRowGroup;
import com.sun.rave.web.ui.model.DefaultOptionsList;
import com.sun.rave.web.ui.model.DefaultTableDataProvider;
import com.sun.rave.web.ui.model.SingleSelectOptionsList;
import com.sun.rave.web.ui.util.MessageUtil;
import javax.faces.FacesException;
import com.sun.rave.web.ui.model.Option;
import javax.faces.event.ValueChangeEvent;
//import com.hxtt.sql.paradox.ParadoxDriver;
import com.sun.data.provider.impl.ObjectArrayDataProvider;
import com.sun.rave.web.ui.model.DefaultTableDataProvider.Data;
import com.sun.rave.web.ui.util.MessageUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.naming.Context;
/**
* <p>Page bean that corresponds to a similarly named JSP page. This
* class contains component definitions (and initialization code) for
* all components that you have defined on this page, as well as
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.</p>
*/
public class Index extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <p>Automatically managed component initialization. <strong>WARNING:</strong>
* This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced.</p>
*/
private void _init() throws Exception {
table1.setInternalVirtualForm(true);
}
private Page page1 = new Page();
public Page getPage1() {
return page1;
}
public void setPage1(Page p) {
this.page1 = p;
}
private Html html1 = new Html();
public Html getHtml1() {
return html1;
}
public void setHtml1(Html h) {
this.html1 = h;
}
private Head head1 = new Head();
public Head getHead1() {
return head1;
}
public void setHead1(Head h) {
this.head1 = h;
}
private Link link1 = new Link();
public Link getLink1() {
return link1;
}
public void setLink1(Link l) {
this.link1 = l;
}
private Body body1 = new Body();
public Body getBody1() {
return body1;
}
public void setBody1(Body b) {
this.body1 = b;
}
private Form form1 = new Form();
public Form getForm1() {
return form1;
}
public void setForm1(Form f) {
this.form1 = f;
}
private DropDown dropDownList1 = new DropDown();
public DropDown getDropDownList1() {
return dropDownList1;
}
public void setDropDownList1(DropDown dd) {
this.dropDownList1 = dd;
}
private StaticText staticText1 = new StaticText();
public StaticText getStaticText1() {
return staticText1;
}
public void setStaticText1(StaticText st) {
this.staticText1 = st;
}
private SingleSelectOptionsList dropDownList1DefaultOptions = new SingleSelectOptionsList();
public SingleSelectOptionsList getDropDownList1DefaultOptions() {
return dropDownList1DefaultOptions;
}
public void setDropDownList1DefaultOptions(SingleSelectOptionsList ssol) {
this.dropDownList1DefaultOptions = ssol;
}
private DropDown dropDownList2 = new DropDown();
public DropDown getDropDownList2() {
return dropDownList2;
}
public void setDropDownList2(DropDown dd) {
this.dropDownList2 = dd;
}
private StaticText staticText2 = new StaticText();
public StaticText getStaticText2() {
return staticText2;
}
public void setStaticText2(StaticText st) {
this.staticText2 = st;
}
private SingleSelectOptionsList dropDownList2DefaultOptions = new SingleSelectOptionsList();
public SingleSelectOptionsList getDropDownList2DefaultOptions() {
return dropDownList2DefaultOptions;
}
public void setDropDownList2DefaultOptions(SingleSelectOptionsList ssol) {
this.dropDownList2DefaultOptions = ssol;
}
private StaticText staticText3 = new StaticText();
public StaticText getStaticText3() {
return staticText3;
}
public void setStaticText3(StaticText st) {
this.staticText3 = st;
}
private StaticText staticText5 = new StaticText();
public StaticText getStaticText5() {
return staticText5;
}
public void setStaticText5(StaticText st) {
this.staticText5 = st;
}
private Button rechercherbtn = new Button();
public Button getRechercherbtn() {
return rechercherbtn;
}
public void setRechercherbtn(Button b) {
this.rechercherbtn = b;
}
private Button inscrirebtn = new Button();
public Button getInscrirebtn() {
return inscrirebtn;
}
public void setInscrirebtn(Button b) {
this.inscrirebtn = b;
}
private Button newparam = new Button();
public Button getNewparam() {
return newparam;
}
public void setNewparam(Button b) {
this.newparam = b;
}
private Table table1 = new Table();
public Table getTable1() {
return table1;
}
public void setTable1(Table t) {
this.table1 = t;
}
private TableRowGroup tableRowGroup1 = new TableRowGroup();
public TableRowGroup getTableRowGroup1() {
return tableRowGroup1;
}
public void setTableRowGroup1(TableRowGroup trg) {
this.tableRowGroup1 = trg;
}
private TableRowGroup tableRowGroup2 = new TableRowGroup();
public TableRowGroup getTableRowGroup2() {
return tableRowGroup2;
}
public void setTableRowGroup2(TableRowGroup trg) {
this.tableRowGroup2 = trg;
}
private DefaultTableDataProvider defaultTableDataProvider = new DefaultTableDataProvider();
public DefaultTableDataProvider getDefaultTableDataProvider() {
return defaultTableDataProvider;
}
public void setDefaultTableDataProvider(DefaultTableDataProvider dtdp) {
this.defaultTableDataProvider = dtdp;
}
private Button rechercherbtn1 = new Button();
public Button getRechercherbtn1() {
return rechercherbtn1;
}
public void setRechercherbtn1(Button b) {
this.rechercherbtn1 = b;
}
private Button rechercherbtn2 = new Button();
public Button getRechercherbtn2() {
return rechercherbtn2;
}
public void setRechercherbtn2(Button b) {
this.rechercherbtn2 = b;
}
private Button zoombtn = new Button();
public Button getZoombtn() {
return zoombtn;
}
public void setZoombtn(Button b) {
this.zoombtn = b;
}
private StaticText staticText4 = new StaticText();
public StaticText getStaticText4() {
return staticText4;
}
public void setStaticText4(StaticText st) {
this.staticText4 = st;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public InscriptionClass inscriptionClass ;
public Index() {
}
/**
* <p>Callback method that is called whenever a page is navigated to,
* either directly via a URL, or indirectly via page navigation.
* Customize this method to acquire resources that will be needed
* for event handlers and lifecycle methods, whether or not this
* page is performing post back processing.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log("Index Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
MyUtilBdd myUtilBdd = new MyUtilBdd();
String Sqltxt ="SELECT LIBELLE_PARAM AS LIBELLE FROM TB_Param";
dropDownList1.setItems(myUtilBdd.RemplieDropDown(Sqltxt));
}
/**
* <p>Callback method that is called after the component tree has been
* restored, but before any event processing takes place. This method
* will <strong>only</strong> be called on a postback request that
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
}
/**
* <p>Callback method that is called just before rendering takes place.
* This method will <strong>only</strong> be called for the page that
* will actually be rendered (and not, for example, on a page that
* handled a postback and then navigated to a different page). Customize
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the <code>init()</code>,
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
public String inscrirebtn_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
getSessionBean1().saveData("competition",dropDownList1.getSelected().toString());
getSessionBean1().saveData("epreuve",dropDownList2.getSelected().toString());
//getSessionBean1().
/*
inscriptionClass = new InscriptionClass();
inscriptionClass.strcompetition = dropDownList1.getSelected().toString();
inscriptionClass.strepreuve = dropDownList2.getSelected().toString();
*/
return "case2";
}
public String newparam_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
return "case1";
}
public String rechercherbtn1_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
MyUtilBdd myUtilBdd = new MyUtilBdd();
int idcompetition = myUtilBdd.getIdParam(dropDownList1.getSelected().toString(),"COMPETITION");
librairieUtility LibrairieUtility = new librairieUtility();
String SqlTxt = "SELECT DISTINCT EPREUVE AS LIBELLE FROM TB_COMPETITION "
+" WHERE ID_COMPETITION="+LibrairieUtility.IntToStr(idcompetition);
dropDownList2.setItems(myUtilBdd.RemplieDropDown(SqlTxt));
SqlTxt = "SELECT DISTINCT Date_EPREUVE AS LIBELLE FROM TB_COMPETITION "
+" WHERE ID_COMPETITION="+LibrairieUtility.IntToStr(idcompetition);
staticText3.setText(myUtilBdd.RemplieText(SqlTxt));
return null;
}
public void dropDownList1_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
//String SqlTxt = "SELECT DISTINCT EPREUVE AS LIBELLE FROM COMPETITION "+" WHERE COMPETITION="+"'"+dropDownList1.getSelected().toString()+"'";
//dropDownList2.setItems(RemplieDropDown(SqlTxt));
}
public String rechercherbtn_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
String SqlTxt = "SELECT * FROM PSN" ;
MyUtilBdd myUtilBdd = new MyUtilBdd();
myUtilBdd.RemplieTable(SqlTxt,zoombtn.getAction());
return null;
}
public String zoombtn_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
return "case4";
}
public String rechercherbtn2_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
return null;
}
} |
Partager