The Init() method of abstract pagebean always it excute, and i lost data.

Hi,
I have applicaction to buid in NetBean 6.1 and JDK 1.6 using Visual Web Java Server Pages. This application to present a view that have a 2 calendar component, 1 dropdownlist, button component and table component.
The table component show rows where calendar1.date > date1 and calendar2.date < date2 and estado(DropDownList)= status1
In the init() method of abstractpagebean i set de initial calendar's date that follow
java.util.Calendar dateAntes = GregorianCalendar.getInstance();
java.util.Calendar date = GregorianCalendar.getInstance();
dateAntes.add(java.util.Calendar.MONTH, -1);
GregorianCalendar gc = new GregorianCalendar(2000, 11, 20);
//tablePhaseListener = getSessionBean1().getTablePhaseListener();
calendar1.setSelectedDate(dateAntes.getTime());
calendar2.setSelectedDate(date.getTime());
With this initial dates dates i show the table row thw follow
String command = "SELECT ALL codreqgmc, fechareq,cliente.nomclie,estado.Descripcion as Estado, " +
"requerimiento.codtecnico, requerimiento.rutclie, requerimiento.codestado " +
"FROM requerimiento,cliente,estado " +
"WHERE requerimiento.rutclie=cliente.rutclie and requerimiento.codestado=estado.codestado and fechareq>=" + "'" + formatoFecha.format(calendar1.getSelectedDate()) + "'" +
"AND fechareq<=" + "'" + formatoFecha.format(calendar2.getSelectedDate()) + "'";
try {
getSessionBean1().getRequerimientoRowSet().setCommand(command);
getSessionBean1().getRequerimientoRowSet().getCommand();
getSessionBean1().getRequerimientoDataProvider().refresh();
} catch (Exception e) {
error("No puede levantar comando");
log("Cannot switch to person " +
estados.getSelected().toString(), e);
The DropDownList implement the ProcessValueChange Event with AutoSubmit On Change properties. At Change choise of DropDown List Component it trigger a event that and execute estados_processValueChange method that to show a table rows accord to the new filter (include the new calendar date if necessary that follow:
String command = "SELECT ALL codreqgmc, fechareq,cliente.nomclie,estado.Descripcion as Estado, " +
"requerimiento.codtecnico, requerimiento.rutclie, requerimiento.codestado " +
"FROM requerimiento,cliente,estado " +
"WHERE requerimiento.rutclie=cliente.rutclie and requerimiento.codestado=estado.codestado and fechareq>=" + "'" + formatoFecha.format(calendar1.getSelectedDate()) + "'" +
"AND fechareq<=" + "'" + formatoFecha.format(calendar2.getSelectedDate()) + "'";
try {
getSessionBean1().getRequerimientoRowSet().setCommand(command + " AND requerimiento.codestado =" + "'" + (String) estados.getSelected() + "'");
getSessionBean1().getRequerimientoRowSet().getCommand();
getSessionBean1().getRequerimientoDataProvider().refresh();
} catch (Exception e) {
error("No puede levantar comando");
log("Cannot switch to person " +
estados.getSelected().toString(), e);
The Table component have a column of checkbox type for select a particular(s) row(s). With a Button it to choose all the rows that has been to set checkbox, in the session bean to save this selected rows and link to another page that show the details about seletec rows.
The Problem
Every time that i press the button, after to the select the rows, for another page showme detail, this page is empty because it execute the init method before the button_action, to re initialize and erase the user selection and lost it
I try with another component that trigger event, por exmaple dropdownlist, and it the same, even to press the pagin in teh table it execute init meth, re-initialize and erase all.
Result prove
1.- I execute the application for first time:
          Execute      Init()
2.- I Chage choos en the DropDownList
          Execute      Init() and
          after           estado_processValueChange()
3.- I change choos again in the DropDownList
          Execute      Init() and
          after           estado_processValueChange()
4.- I press pagin button in table
          Execute      Init()
5.- I press button detail, for detail
     Execute      Init() ----> I reinitialize and lost the user select.
     after          Butoon_action
How ia can to preven that every time it execute init(),
Why alway it execute init method?, the init methd() is for initialize application and not RE INTIALIZED
Why is the relation INIT(); PREPROCESS(), PRERENDER(), PROCESSVALUECHANGE, BUTTON_ACTION. What it execute first, what secodn?
I need execute init method only one , at first time
I hope i undertandme, i not native english.
Thank for advance

Anupama,
Do you mean init or wdDoInit? You cannot call the later as well as you cannot call any WD-framework methods that start with "wd" prefix.
By the way, wdDoInit in component controller (do not confuse with custom controller or interface controller) is called before any other method in any controller. So I hardly believe that it is not called when your view become available.
Valery Silaev
SaM Solutions
http://www.sam-solutions.net

Similar Messages

  • The init() method

    hi,
    i'm reading a book that in the beginning showed the init method as:
    public void init(ServletConfig config) throws ServletExceptionbut later when discussing jdbc the author mentions that loading the driver should be done in the init method since this way it can be loaded once the servlet is loaded, but in that example the init method signature is:
    public void init() {
    }there's no parameter or error thrown.
    so i'm confused are both signatures ok, or is one wrong?

    Both is correct, and init() is a shortcut. See http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/GenericServlet.html#init()

  • How do I find music that has been uploaded to iTunes from a purchased CD and iTunes is "unable to find the original file?" I no longer have the CD. I have tried all the usual methods of looking in my iTunes library and through Find. No Luck.

    How do I find music that has been uploaded to iTunes from a purchased CD and iTunes is “unable to find the original file?” I no longer have the CD. I have tried all the usual methods of looking in my iTunes library and through Find. No Luck.

    Backup drive?
    Subscribe to iTunes Match?
    If neither of the above and you don't have the CD and can't find your tracks on the computer then they you're stuck.  A file recovery utility will cost $100, plus another $100 for an external drive to which to resue the files, and may not even work.  You can buy a lot of CDs for $200.

  • My iphone 4 got stuck on the itunes logo. I had to restore it and have lost everything. Is there anything I can do to get my photos back?

    Hello. My iphone 4 got stuck on the itunes logo. I had to restore it and have lost everything. Is there anything I can do to get my photos back?

    Not easily, the recovery mode erases the device, but you can see if any of these data recovery tools may work: https://discussions.apple.com/docs/DOC-1689

  • I have uninstalled Lightroom and need to re-install it on the same computer. I cannot find where to re-install it. The CC popup window says that it is installed and Up to date.

    I have uninstalled Lightroom and need to re-install it on the same computer. I cannot find where to re-install it. The CC popup window says that it is installed and Up to date.

    CC desktop lists applications as "Up to Date" when not installed
    http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html

  • The HD was recently changed on my MacBook Pro and I lost my iTunes library (Time Capsule also died!) but have all my songs on my iPhone.  How can I copy them to my laptop?

    The HD was recently changed on my MacBook Pro and I lost my iTunes library (Time Capsule died also!) but all my songs are still on my iPhone4.  How can I copy them back to my laptop? Tks

    Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself properly backed up against loss.  Syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchases which can be transferred to a computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only purchases from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software.  See this document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991

  • I would like to disconnect the authorize from all computers , because i have five and i lost two. pleaes i want disconnect all  authorize becaues i need more.

    i would like to disconnect the authorize from all computers , because i have five and i lost two. pleaes i want disconnect all  authorize becaues i need more.

    If you no longer have the computer(s) you want to deauthorise,
    Log in to iTunes,  go to "view your account info" on the itunes store,  deauthorise all five, (Please Note: this can only be done Once every 12 months)  and then re-authorize your current Computer(s) one at a time.
    Authorise / Deauthorise About
    http://support.apple.com/kb/HT1420

  • HT1414 having bought a new MacBook, I wanted to Sync my iPhone4 to it, but it insists the only method to do so is to "Erase and Sync" or "Cancel" which leaves no option to just use iTunes on the new MacBook Pro - how annoying is that???

    I have had the iphone4 for 2 years now and I bought a new MacBook Pro, opened iTunes and it knew I already had other machines with iTunes sync'ed with it but it still insisted on offering one option or sync'ing with new MacBook - "Erase and Sync", which means deleting EVERYTHING on the iphone. What if I want my iPhone to dictate and get iTunes on the Macbook to match up with the iPhone??? Or at least get iTunes to relate to what my iTunes account obviously has on it and update that way. Come on Apple, as per usual, very pretty but not very practical!!!

    You can only sync everything with your one syncing computer/iTunes library. Yu can:
    - Make this your syncing computer by:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities
    - Use the manual method to copy music and videos from any computer/iTunes library to the iPod. See the manual method included here:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • The first tab in my browser always shows loading and cannot close it, Why?

    When my browser is open and have multiple tabs open, the first tab has the animated circle that shows that page is loading, and if I try to close that tab it does not close. I have tried to uninstall and reinstall but have not been able to clear this issue up, Please help!

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • The "More Everything Plan" is ruining my life!  (and adding random data charges to my bill)

    Hello,
    I recently changed my data plan a few months ago to the 6 GB Data plan with 2 phones tied to my service when I upgraded my phone to the Samsung Galaxy 5.  For the most part my wife and I have been doing pretty good at keeping the our monthly data usage down to the 6 GB.  On Nov 4th was I upgraded to the new 10 GB my everything plan and ever since that change, my account has been making RANDOM data charges at all hours of the night!  I pulled both my wife's Data Usage report and my own and compared them. 
    Looking at my wife's data usage below, you can clearly see that there are automated data spikes that her phone went through on the same exact time on different days!  Looking at the dates, these spikes did not start to automatically occur until we upgraded our plan on Nov 4th.  The same goes for my data usage below.  There are multiple days that my phone surged on the same exact time with large spikes of data!  These reports were organized by largest "Unbilled Data Usage" spikes.
    These spikes SHOULD NOT be occurring and have nothing to do with what apps we have installed our phones.  We have both filtered our usage by apps on our phones and they do not add up.  What's the point of having a larger data plan, if that data plan just steals MG randomly off your phone for no reason???  Because of these spikes, I have add to pay over $100 in overage fees and in November, I have already had to buy MORE DATA ($20 for 5 GB more) because I was already at 90% of my usage with 2 weeks still to go in the billing cycle!  I need actions and not suggestions.  I'm not the only one with these problems and this needs to be addressed.
    Please help!!!!!
    (Wife's Data Usage)
    (My Data Usage)

    You're right, data usage can be confusion...especially when your response above doesn't make sense.
    If data usage is counted in 6 hour blocks, then how in the world did Nov. 5th last 138 hours???  Data was calculated 23 times on 11/5/14 and 14 times on on 11/4.  These are just 2 examples of when the data was pulled in in "6 hour blocks of time". Nearly every day in my pulled report this month shows 2 dozen or more times the data was recorded and billed each day. (see below)
    Further more, if data usage actually was counted in 6 hour intervals, that still doesn't explain why my phone randomly surged 1.27 GB of data at 5:36 AM in the morning on 11/12/14.  Even if this counted data since 11:36 PM the night before on 11/11/14 night, there's no way I would have used this much data!  Since I work during the weekdays 9-5, I am already in bed at this time and not using my phone.  And it can't be recorded data usage after 5:36 AM, because then what would be the point of having a time stamp in the report?  Where was this data coming from???  (see below)
    The timing of my spike in data is just way too coincidental of when I upgraded my data to 10 GB earlier this month.  If you compare our data usage against other months (when I had 6 GB) we didn't have random spikes like we are seeing now.  There is something wrong with the new data plan on our phones, and I really wish someone could clearly point out where these additional charges are coming from.  Please have a representative contact me at your earlier convenience.
    6 Hour Blocks of Time?
    Data pulled at 5:36 AM
    Data Spike in the Past Months

  • How can I get rid of 'Ask' in the list of search engines, which always comes back (and at the top of the list) even though I check the 'Remove' box in 'Manage Search Engines'?

    I don't think I can add anything relevant to the question

    You can open the <b>about:config</b> page via the location bar and do a search for <i>ask.com</i> via the Filter at the top of that page.<br />
    You can reset all <i>ask.com</i> related prefs via the right-click context menu to their default values.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • F.F. keeps telling me i need an ActiveX Plug-in but i can not find one for 3.5.11. This is the first time i have ever had a problem and totally lost here...please help. Jared

    I was going to add some new ringtones to my cell and in trying to listen to the samples i keep getting the Firefox needs to an ActiveX Plug-in would i like to be directed to where it is but nothing there matches....
    == This happened ==
    Just once or twice
    == Every time i have tried to go to site to review ring tones...

    Firefox, and most other browsers except IE, does not use ActiveX. See [[ActiveX]]
    You can try this add-on to see if it will allow you to listen to the ring tones by using IE's rendering engine in a Firefox tab:
    https://addons.mozilla.org/en-US/firefox/addon/92382/
    Note that the support for your version of Firefox is scheduled to end in August 2010 (see info at top of this page: https://www.mozilla.com/en-US/firefox/all-older.html . You may want to consider upgrading to the more current version: http://www.mozilla.com/en-US/firefox/all.html
    Also see:
    http://support.mozilla.com/en-US/kb/Upgrading+to+Firefox+3.6#What_s_new_in_Firefox_3_6_
    http://support.mozilla.com/en-US/kb/Updating+Firefox
    http://support.mozilla.com/en-US/kb/Installing+Firefox
    https://support.mozilla.com/en-US/kb/Custom+installation+of+Firefox+on+Windows
    <u>'''''Other Issues'''''</u>: ~~red:You have installed plug-ins with known security issues. You should update them immediately.~~
    <u>'''Update Java'''</u>: your ver. 1.6.0.19; current ver. 1.6.0.20 (<u>important security update 04-15-2010</u>)
    (Firefox 3.6 and above requires Java 1.6.0.10 or higher; see: http://support.mozilla.com/en-US/kb/Java-related+issues#Java_does_not_work_in_Firefox_3_6 )
    ''(Windows users: Do the manual update; very easy.)''
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates Updating Java]'''
    Do the update with Firefox closed.
    <u>'''NOTE:'''</u> Java version 1.6.0.21 has been released. It is mainly an update for developers of Java applications and most users do not need to be concerned about downloading version 1.6.0.21. <u>'''''At this time'''''</u>, the update option in existing installations of Java 1.6.0.20 are not updating to version 1.6.0.21; <u>'''''at this time'''''</u>, it must be manually downloaded and installed. According to the Java release notes:
    ''"'''Bug Fixes'''''
    ''Java SE 6 Update 21 does not contain any additional fixes for security vulnerabilities to its previous release, Java SE 6 Update 20. Users who have Java SE 6 Update 20 have the latest security fixes and do not need to upgrade to this release to be current on security fixes."'' Source: http://java.sun.com/javase/6/webnotes/6u21.html
    <u>'''Install/Update Adobe Flash Player for Firefox (aka Shockwave Flash)'''</u>: your ver. 10.~~red:0 r32~~; current ver. 10.1 r53 ('''important security update 2010-06-10'''; see: http://www.adobe.com/support/security/bulletins/apsb10-14.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash Updating Flash]'''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    -exit Firefox (File > Exit)
    -''<u>In Windows,</u>'' check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -''<u>In Windows,</u>'' double-click on the Adobe Flash installer you just downloaded to install/update Adobe Flash
    -when the Flash installation is complete, start Firefox, and test the Flash installation here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507&sliceId=1
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version of Flash. To install/update the IE ActiveX Adobe Flash Player, same instructions as above, except use IE to download the ActiveX Flash installer. See: [[ActiveX]]
    *Also see: http://kb.mozillazine.org/Flash ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]
    <u>'''You '''</u>~~red:<u>'''MAY'''</u>~~<u>''' need to Update Adobe Reader for Firefox (aka Adobe PDF Plug-In For Firefox)'''</u>: your ver. N/A; current ver. 9.3.3 (important security update release 06-29-2010; see: http://www.adobe.com/support/security/bulletins/apsb10-15.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: http://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox#Installing_and_updating_Adobe_Reader
    ''<u>You may be able to update from the Adobe Reader installed on your system</u>'' instead of going to the Adobe site and downloading. Open the Adobe Reader installed on your system (''in Windows, Start > Program Files, find and click Adobe Reader to open''), click Help, click Check for Updates. Allow the download/update to occur. If you use this method, no need to proceed with the instructions below, <u>'''but'''</u> do look at the two bulleted items at the bottom "'''<u>NOTE for IE:</u>'''" and "Also see:". Restart Firefox and check your new version here: http://www.mozilla.com/en-US/plugincheck/
    ''<u>If you go to the Adobe site to download the current Adobe Reader:</u>''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    ~~red:-See the images at the bottom left of this post to see the steps to take on the Adobe site~~
    -exit Firefox (File > Exit)
    -In Windows: check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -In Windows: double-click on the Adobe Reader installer you just downloaded to install/update Adobe Reader
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version. To install/update the IE ActiveX version, same instructions as above, except use IE to download the ActiveX installer. See: [[ActiveX]]
    *Also see: http://kb.mozillazine.org/Adobe_Reader ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]

  • How do I search for words inside documents, rather than the title? I have OS 10.9.4 and have lost this feature a few OS updates back.

    Sometimes titles do not match the content. If I have a bunch of files with similar title, i.e. Chapter 1, 2, etc., but I want to find the chapter with the jabberwock in it, I used to be able to type "jabberwock" and it would come up in my search window.  Now it's only finding titles. I have so many files on my puter that it's taking me forever to find important documents.  Where did they hide this feature??? Tearing my hair out.

    Spotlight Alternatives
    EasyFind – Spotlight Replacement
    Find Any File

  • How i cand change the password on my imac if i forget it and i lost the recobvery dvd

    how i can change my password or getting a new one if a forgot my password and i dont have the dvd

    You need the DVD, if you lost your original then contact AppleCare and for a nominal cost they will ship you another.

  • Init() method: private vs. public

    I have a question:
    What is the difference in defining your init() method in a servlet as private vs. public since it is automatically executed when the class is instantiated?
    thanks

    cbreneman,
    For future reference,
    public void foo() {
        method vailable to all
    protected void foo() {
        method vailable to pacakge
    private void Foo() {
        method vailable to this
    }You can do this:
    public String bar;
    protected String bar;
    private String bar;You cannot do this:
    private void Foo() {
        public String bar = "Oops!";
    }For an Applet, init() is inherited when you extend the Applet class. It must be overidden if you have work to do before your subclass becomes active. It is defined by the superclass as public and void. If you were to create an init() method that was private and returned a String, you might (the compiler will stop you if you try to define init() twice) have a different method, but you would not have overidden public void init(). If you tried something like private void init() the compiler would stop you:
    init() in FooBar cannot override init() in java.applet.Applet; attempting to assign weaker access privileges; was public
    private void init() {
    ^
    1 error
    Make sense?
    With servlets, the init() method is there for slightly different reasons and to be honest, I am not sure that you inherit it? I believe it acts as a special constructor? I don't write many servlets, so I'll shut up and let someone who does give a better answer.
    Hope this helps.

Maybe you are looking for