source: tol/TolJava/WebTOLJavaDEMO/src/java/com/hcarralero/toljava/demo/Series.java @ 9887b93

1941-docker-image-to-testdevel
Last change on this file since 9887b93 was 9887b93, checked in by Humberto Carralero <hacarralero@…>, 15 years ago

Importing TolJava

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3900 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package com.hcarralero.toljava.demo;
7
8import com.sun.rave.web.ui.appbase.AbstractPageBean;
9import com.sun.webui.jsf.component.StaticText;
10import javax.faces.FacesException;
11
12/**
13 * <p>Page bean that corresponds to a similarly named JSP page.  This
14 * class contains component definitions (and initialization code) for
15 * all components that you have defined on this page, as well as
16 * lifecycle methods and event handlers where you may add behavior
17 * to respond to incoming events.</p>
18 *
19 * @version Docs.java
20 * @version Created on Nov 28, 2010, 1:55:24 PM
21 * @author hcarralero
22 */
23
24public class Series extends AbstractPageBean {
25    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
26
27    /**
28     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
29     * This method is automatically generated, so any user-specified code inserted
30     * here is subject to being replaced.</p>
31     */
32    private void _init() throws Exception {
33    }
34
35    private StaticText accVerGrafico = new StaticText();
36
37    public StaticText getAccVerGrafico() {
38        return accVerGrafico;
39    }
40
41    public void setAccVerGrafico(StaticText st) {
42        this.accVerGrafico = st;
43    }
44
45    // </editor-fold>
46
47    /**
48     * <p>Construct a new Page bean instance.</p>
49     */
50    public Series() {
51    }
52
53    /**
54     * <p>Callback method that is called whenever a page is navigated to,
55     * either directly via a URL, or indirectly via page navigation.
56     * Customize this method to acquire resources that will be needed
57     * for event handlers and lifecycle methods, whether or not this
58     * page is performing post back processing.</p>
59     *
60     * <p>Note that, if the current request is a postback, the property
61     * values of the components do <strong>not</strong> represent any
62     * values submitted with this request.  Instead, they represent the
63     * property values that were saved for this view when it was rendered.</p>
64     */
65    @Override
66    public void init() {
67        // Perform initializations inherited from our superclass
68        super.init();
69        // Perform application initialization that must complete
70        // *before* managed components are initialized
71        // TODO - add your own initialiation code here
72       
73        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
74        // Initialize automatically managed components
75        // *Note* - this logic should NOT be modified
76        try {
77            _init();
78        } catch (Exception e) {
79            log("Docs Initialization Failure", e);
80            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
81        }
82       
83        // </editor-fold>
84        // Perform application initialization that must complete
85        // *after* managed components are initialized
86        // TODO - add your own initialization code here
87        MenuIzquierdo mi= (MenuIzquierdo)this.getBean("MenuIzquierdo");
88        if (mi!=null) {
89            mi.getTrMenuIzquierdo().setSelected("tnDocs");
90        }
91    }
92
93    /**
94     * <p>Callback method that is called after the component tree has been
95     * restored, but before any event processing takes place.  This method
96     * will <strong>only</strong> be called on a postback request that
97     * is processing a form submit.  Customize this method to allocate
98     * resources that will be required in your event handlers.</p>
99     */
100    @Override
101    public void preprocess() {
102    }
103
104    /**
105     * <p>Callback method that is called just before rendering takes place.
106     * This method will <strong>only</strong> be called for the page that
107     * will actually be rendered (and not, for example, on a page that
108     * handled a postback and then navigated to a different page).  Customize
109     * this method to allocate resources that will be required for rendering
110     * this page.</p>
111     */
112    @Override
113    public void prerender() {
114    }
115
116    /**
117     * <p>Callback method that is called after rendering is completed for
118     * this request, if <code>init()</code> was called (regardless of whether
119     * or not this was the page that was actually rendered).  Customize this
120     * method to release resources acquired in the <code>init()</code>,
121     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
122     * acquired during execution of an event handler).</p>
123     */
124    @Override
125    public void destroy() {
126    }
127
128    /**
129     * <p>Return a reference to the scoped data bean.</p>
130     *
131     * @return reference to the scoped data bean
132     */
133    protected ApplicationBean1 getApplicationBean1() {
134        return (ApplicationBean1) getBean("ApplicationBean1");
135    }
136
137    /**
138     * <p>Return a reference to the scoped data bean.</p>
139     *
140     * @return reference to the scoped data bean
141     */
142    protected SessionBean1 getSessionBean1() {
143        return (SessionBean1) getBean("SessionBean1");
144    }
145
146    /**
147     * <p>Return a reference to the scoped data bean.</p>
148     *
149     * @return reference to the scoped data bean
150     */
151    protected RequestBean1 getRequestBean1() {
152        return (RequestBean1) getBean("RequestBean1");
153    }
154
155    public String button1_action() {
156            this.accVerGrafico.setText("<script type=\"text/javascript\">dibujarGrafico();</script>");
157            return null;
158        }
159
160    public String button2_action() {
161            this.accVerGrafico.setText("<script type=\"text/javascript\">drawChart();</script>");
162        return null;
163    }
164
165    }
166
Note: See TracBrowser for help on using the repository browser.