Hi folks,

(so sorry this is a long one)
I have a combo box on one page that gets another users data (session bleed biz).
But the bleed doesn't happen every time. only when the user hits the 2 of the
buttons on this page than happen to cause the page to be reloaded. Only when
reloading the page does it get the other user's data in the ComboBox. I can't
for the life of me figure out what is causing it.

Below is an attachment and listing of the page's .java file. There's 4
comboBoxes on the page, by only ONE (CboBudgetTasks) is having this problem.

I'm guessing it might have something to do with this funny stuff I do to this
particular comboBox :
after I set its dyn criteria, I call execute() on it, then I loop thru each row
in the result set, and for each row I:
1. manually determine its display value and data value (I need to do this
because the data model is so over normalized I have to do some nasty stuff to
get the Display value)
2.then I do a:
cboTasks.addSelectable(sListLabel, sListValue);

When UserA hits with one of 2 buttons ( BtnContinue or button BtnAddFUT) on this
page, which reload the page, *and* if a UserB is concurrently retrieving the
page, I get the bleed; where userA sees userB's comboBox values.

I should also mention the 4 comboBoxes on this page are used to "drill down"
from the first combo to the last one. Meaning when page is first display, only
the top combo is displayed. rest are SKIP'ed. Then as user hits the correspondig
"Go" button next to each combo, they see an additional comboBox. The comboBox
giving me the problem is the very last one.

If you can take a look and send some advice it would be a tremendous help to me.

Thank you!
Janet
==================
// This file has been generated by NetDynamics Studio on Tue Apr. 06, 1999 09:35

package PrTITimeMgmt;

import java.awt.event.*;
import java.util.*;
import spider.event.*;
import spider.database.*;
import spider.visual.*;
import spider.*;
import spider.session.*;
import spider.util.*;
import spider.html.*;


//[[SPIDER_CLASS BEGIN
public class PgEnterTimeDay extends spider.visual.CSpPage
//]]SPIDER_CLASS END
{
     // This function returns a string that will be used in the INSERT
     public String setInsertHours()
     {
       String sReturn;
       String sMon = new String("0");
       String sTue = new String("0");
       String sWed = new String("0");
       String sThu = new String("0");
       String sFri = new String("0");
       String sSat = new String("0");
       String sSun = new String("0");

       sReturn = sMon + ", " + sTue + ", " + sWed + ", " + sThu + ", " +
          sFri + ", " + sSat + ", " + sSun + ", ";
       return sReturn;
     }

     // This function adds a time charge
     public int addRecord()
     {
       String sCurrProj, sCurrWorkplan, sCurrEndDate, sTaskValues;
       String sPhase, sSegment, sStep, sTask,sSubTask, sUserID;
       String sInsertHours, sSqlStatement;
       CSpSelect doUserActivities;
       int nRows;
       StringTokenizer st;
       String sETC = "null"; //JT 8-11-99

       // Get all information needed to add time
       // Get Project
       sCurrProj = CSpider.getUserSessionObject("soCurrProj").toString();

       // Get Workplan
       sCurrWorkplan =
CSpider.getUserSessionObject("soCurrWorkPlan").toString();

       // Get Week Ending Date
       sCurrEndDate = CSpider.getUserSessionObject("soWeekEndDate").toString();

       // Get activity info
       sTaskValues = getDisplayFieldValue("CboBudgetTasks").toString();
       st = new StringTokenizer(sTaskValues,",");
       sPhase = st.nextToken();
       sSegment = st.nextToken();
       sStep = st.nextToken();
       sTask = st.nextToken();
       sSubTask = st.nextToken();
       sUserID = CSpider.getUserSessionObject("soUserID").toString();

       // Check if row already exists
       doUserActivities = (CSpSelect)
CSpider.getDataObject("doActivityDisplay");
       doUserActivities.clearDynamicCriteria();
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.iproj_id = '" +
          sCurrProj.toString() + "'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.iproj_wp_nm = '"
 +
          sCurrWorkplan.toString() + "'");
       doUserActivities.addDynamicStrCriterion("iproj_wp.wp_phs_cd = '" + sPhase
 + "'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.wp_seg_cd = '" +
 sSegment + "'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.wp_step_cd = '"
+ sStep + "'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.wp_task_cd = '"
+ sTask + "'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.wp_sub_task_id =
 '"+sSubTask+"'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.user_id =
'"+sUserID+"'");
       doUserActivities.addDynamicStrCriterion("w_iproj_wp_user.wk_end_dt = '" +
 sCurrEndDate
          + "'");
       doUserActivities.execute();
       nRows = doUserActivities.getNumOfRows();

       //Either insert or update depending on existence of row
       if (nRows == 0){// If new task for the week

          //JT 8-11-99 commented next line since Rick never used it
//        sInsertHours = setInsertHours();

          //JT 8-11-99 add this if statement
          // if workplan is ADMIN, set ETC to zero so user won't have to enter
it
          if (sCurrWorkplan.equals("Administration") )
               sETC = "0";

          sSqlStatement = new String("INSERT INTO w_iproj_wp_user " +
          "(iproj_id, iproj_wp_nm, wp_phs_cd, wp_seg_cd, wp_step_cd, " +
          "wp_task_cd, wp_sub_task_id, user_id, wk_end_dt, " +
          //JT 8-11-99 replace next line to include ETC hrs in SQL
//        "apprv_flg) " +
          "user_task_etc_hrs, apprv_flg) " +
          "VALUES ('" + sCurrProj + "', '" + sCurrWorkplan + "', " + sPhase + ",
 " +
          sSegment + ", " + sStep +", " + sTask +", '" + sSubTask + "', '"
          //JT 8-11-99 replace next line to include ETC hrs in SQL
//        + sUserID + "', '" + sCurrEndDate + "', 'N')");
          + sUserID + "', '" + sCurrEndDate + "'," + sETC + ", 'N')");

          //CSpider.putUserSessionObject("soDisplay", new
CSpString(sSqlStatement));
          CSpDataObject.executeImmediate("dsTimeTrackDB",sSqlStatement);
       }
       else{// Task already has an entry for the week
          return 1;
       }
       return 0;
     }

     //this function populates the Task drop-down
     //it is called when:  user selects the ADMIN Project AND
     //when user hits GO after selecting a Workplan
     public void populateTaskDropDown(CSpValue vWorkplan)
     {
          int nPhase, nSegment, nStep, nTask, nSubTask, rows;
          CSpValue sPhaseCd, sSegmentCd, sStepCd, sTaskCd, sSubTaskId;
          String sIndex, sPhase, sSegment, sStep, sTask, sSubTask, sListLabel;
          CSpSelect doPhase,doSegment,doStep,doTask,doBudgetTasks;
          CSpSelect doAddlSeg, doAddlStep, doAddlTask;
          CSpValue vProjID;
          CSpComboBox cboTasks;
          CSpString sListValue;

          //Get the project
          vProjID = CSpider.getUserSessionObject("soCurrProj");

         //Clear the tasks list box
          cboTasks= (CSpComboBox)getDisplayField("CboBudgetTasks");
          cboTasks.removeAllChildren(true);
          cboTasks.addSelectable("<Select one>", new CSpString("none"));

         //Get the tasks for the workplan
          doBudgetTasks = (CSpSelect)CSpider.getDataObject("doBudgetTasks");
          doBudgetTasks.clearDynamicCriteria();

         //Set the select criteria
          doBudgetTasks.addDynamicStrCriterion("iproj_wp.iproj_id = '" +
            vProjID.toString() + "'");
          doBudgetTasks.addDynamicStrCriterion("iproj_wp.iproj_wp_nm = '" +
            vWorkplan.toString() + "'");

          CSpHtml.sendMessage("vProjID = " + vProjID.toString() + "<BR>");
          CSpHtml.sendMessage("vWorkplan = " + vWorkplan.toString() + "<BR>");

         //Execute the select
          doBudgetTasks.execute();

         //Get the data indices
          nPhase = doBudgetTasks.getDataFieldPosition(
            "wp_phs_cd");
          nSegment = doBudgetTasks.getDataFieldPosition(
            "informix_iproj_wp_bdgt_wp_seg_cd");
          nStep = doBudgetTasks.getDataFieldPosition(
            "informix_iproj_wp_bdgt_wp_step_cd");
          nTask = doBudgetTasks.getDataFieldPosition(
            "informix_iproj_wp_bdgt_wp_task_cd");
          nSubTask = doBudgetTasks.getDataFieldPosition(
            "informix_iproj_wp_bdgt_wp_sub_task_id");

         //Create the list box
          rows = doBudgetTasks.getNumOfRows();
          for(int i = 0; i < rows; i++){
            //get phase
            sPhaseCd = doBudgetTasks.getValue(i, nPhase);
            doPhase = (CSpSelect) CSpider.getDataObject("doPhase");
            doPhase.clearDynamicCriteria();
            doPhase.addDynamicStrCriterion("wp_phs_cd = '" + sPhaseCd + "'");
            doPhase.execute();
            if(vProjID.toString().compareTo("ADMIN")==0){
               sPhase = "";
            }
            else{
               sPhase = doPhase.getValue(0,
                 "informix_wp_phs_dspl_wp_phs_cd").toString();
            }

            //get segment
            sSegmentCd = doBudgetTasks.getValue(i,nSegment);
            if(sSegmentCd.intValue() != 0){// if segment
               doSegment = (CSpSelect) CSpider.getDataObject("doSegment");
               doSegment.clearDynamicCriteria();
               doSegment.addDynamicStrCriterion("wp_phs_cd = '" + sPhaseCd +
"'");
               doSegment.addDynamicStrCriterion("wp_seg_cd = '" + sSegmentCd +
"'");
               doSegment.execute();
               if(doSegment.getNumOfRows()>0){
                 sSegment = doSegment.getValue(0,
                    "informix_wp_seg_wp_seg_desc").toString();
               }
               else{
                 doAddlSeg = (CSpSelect)CSpider.getDataObject("doAddlSeg");
                 doAddlSeg.clearDynamicCriteria();
                 doAddlSeg.addDynamicStrCriterion("iproj_id = '" +
                    vProjID.toString() + "'");
                 doAddlSeg.addDynamicStrCriterion("iproj_wp_nm = '" +
                    vWorkplan.toString() + "'");
                 doAddlSeg.addDynamicStrCriterion("wp_phs_cd = " + sPhaseCd);
                 doAddlSeg.addDynamicStrCriterion("wp_addl_seg_cd = "+
sSegmentCd);
                 doAddlSeg.execute();
                 sSegment = doAddlSeg.getValue(0,
                    "wp_addl_seg_desc").toString();
               }
               //JT 9-20-99 if not the ADMIN, workplan, add Index as Prefix
               if (!vProjID.toString().equals("ADMIN")){
                 sIndex = sPhaseCd.toString() + "." + sSegmentCd.toString() + "
";
                 sSegment = sIndex + sSegment;
               }
            }
            else{
               sSegment = "";
            }

            //get step
            sStepCd = doBudgetTasks.getValue(i,nStep);
            if(sStepCd.intValue() != 0){// if step
               doStep = (CSpSelect) CSpider.getDataObject("doStep");
               doStep.clearDynamicCriteria();
               doStep.addDynamicStrCriterion("wp_phs_cd = '" + sPhaseCd + "'");
               doStep.addDynamicStrCriterion("wp_seg_cd = '" + sSegmentCd +
"'");
               doStep.addDynamicStrCriterion("wp_step_cd = '" + sStepCd + "'");
               doStep.execute();
               if(doStep.getNumOfRows() > 0){
                 sStep = doStep.getValue(0,
                    "informix_wp_step_wp_step_desc").toString();
               }
               else{
                 doAddlStep = (CSpSelect)CSpider.getDataObject("doAddlStep");
                 doAddlStep.clearDynamicCriteria();
                 doAddlStep.addDynamicStrCriterion("iproj_id = '" +
                    vProjID.toString() + "'");
                 doAddlStep.addDynamicStrCriterion("iproj_wp_nm = '" +
                    vWorkplan.toString() + "'");
                 doAddlStep.addDynamicStrCriterion("wp_phs_cd = " + sPhaseCd);
                 doAddlStep.addDynamicStrCriterion("wp_seg_cd = "+ sSegmentCd);
                 doAddlStep.addDynamicStrCriterion("wp_addl_step_cd = "
+sStepCd);
                 doAddlStep.execute();
                 sStep = doAddlStep.getValue(0,
                    "wp_addl_step_desc").toString();
               }
               //JT 9-20-99 if not the ADMIN, workplan, add Index as Prefix
               if (!vProjID.toString().equals("ADMIN")){
                 sIndex = "  " + sPhaseCd.toString() + "." +
sSegmentCd.toString() +
                          "." + sStepCd.toString()+ " ";
                 sStep = " -> " + sIndex + sStep;
               }
            }
            else{
               sStep = "";
            }

            //get task
            sTaskCd = doBudgetTasks.getValue(i,nTask);
            if(sTaskCd.intValue() != 0){ // if Task
               doTask = (CSpSelect) CSpider.getDataObject("doTask");
               doTask.clearDynamicCriteria();
               doTask.addDynamicStrCriterion("wp_phs_cd = '" + sPhaseCd + "'");
               doTask.addDynamicStrCriterion("wp_seg_cd = '" + sSegmentCd +
"'");
               doTask.addDynamicStrCriterion("wp_step_cd = '" + sStepCd + "'");
               doTask.addDynamicStrCriterion("wp_task_cd = '" + sTaskCd + "'");
               doTask.execute();
               if(vProjID.toString().compareTo("ADMIN")==0){
                 sTask = doTask.getValue(0,
                    "informix_wp_task_wp_task_desc").toString();
               }
               else{
                 if(doTask.getNumOfRows()>0){
                    sTask = doTask.getValue(0,
                      "informix_wp_task_wp_task_desc").toString();
                 }
                 else{
                    doAddlTask = (CSpSelect)CSpider.getDataObject("doAddlTask");
                    doAddlTask.clearDynamicCriteria();
                    doAddlTask.addDynamicStrCriterion("iproj_id = '" +
                      vProjID.toString() + "'");
                    doAddlTask.addDynamicStrCriterion("iproj_wp_nm = '" +
                      vWorkplan.toString() + "'");
                    doAddlTask.addDynamicStrCriterion("wp_phs_cd = " +
sPhaseCd);
                    doAddlTask.addDynamicStrCriterion("wp_seg_cd = "+
sSegmentCd);
                    doAddlTask.addDynamicStrCriterion("wp_step_cd = "+sStepCd);
                    doAddlTask.addDynamicStrCriterion("wp_addl_task_cd =
"+sTaskCd);
                    doAddlTask.execute();
                    sTask = doAddlTask.getValue(0,
                      "wp_addl_task_desc").toString();
                 }

               }
               //JT 9-20-99 if not the ADMIN, workplan, add Index as Prefix
               if (!vProjID.toString().equals("ADMIN")){
                 sIndex = "  " + sPhaseCd.toString() + "." +
sSegmentCd.toString() +
                          "." + sStepCd.toString() + "." + sTaskCd.toString() +
" ";
                 sTask = " -> " + sIndex + sTask;
               }
            }
            else{
               sTask = "";
            }

            //get sub task
            sSubTaskId = doBudgetTasks.getValue(i,nSubTask);
            if(sSubTaskId.toString().compareTo("0") != 0){
               sSubTask = " -> " + sSubTaskId.toString();
            }
            else{
               sSubTask = "";
            }

            //add final string
            sListLabel = sSegment + sStep + sTask +sSubTask;
            sListValue = new CSpString(sPhaseCd.toString() + "," +
               sSegmentCd.toString() + "," + sStepCd.toString() + "," +
               sTaskCd.toString() + "," + sSubTaskId.toString());

            //JT 9-20-99 if NOT the "Phase row", then add row to the ListBox
            if (! (sSegmentCd.equals("0")&& sStepCd.equals("0") &&
sTaskCd.equals("0"))){
               cboTasks.addSelectable(sListLabel, sListValue);
            }
          }
     }//end of populateTaskDropDown()

     //[[SPIDER_EVENTS BEGIN

     //[[SPIDER_EVENT<CboProjects_onBeforeDisplayEvent>
     public int CboProjects_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpComboBox cbo = (CSpComboBox)getDisplayField("CboProjects");
          cbo.doAutoFill();

          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");

          if(val.toString().compareTo("1")!=0)
          { //if not the first time page is displayed, default the Project
            CSpString currProj =
(CSpString)CSpider.getUserSessionObject("soCurrProj");
            setDisplayFieldValue("CboProjects",currProj);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<CboProjects_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnProject_onWebEvent>
     public int BtnProject_onWebEvent(CSpWebEvent event)
     {
          CSpValue vProjID = getDisplayFieldValue("CboProjects");
          CSpider.putUserSessionObject("soCurrProj", vProjID);

          //if user selected the ADMIN project
          if (vProjID.toString().equals("ADMIN"))
          {    //default the PhaseCd and Workplan session objects
               CSpider.putUserSessionObject("soCurrPhase", new CSpString("0"));
               CSpider.putUserSessionObject("soCurrWorkPlan",
                         new CSpString("Administration"));

               //set flag, which is used to: jump down to the Task drop-down,
               //and also hide both the Phase and Workplan drop-downs
               CSpider.putUserSessionObject("soTimeEntryFlag", new
CSpString("5"));

               //populate the Task drop-down, pass in the Workplan name
               populateTaskDropDown(new CSpString("Administration"));
          }
          else
          {    //set flag to display the Phase drop-down next
               CSpider.putUserSessionObject("soTimeEntryFlag", new
CSpString("2"));

               //set the dyn criteria to filter the Phase drop-down
               CSpSelect doGetPhases =
(CSpSelect)CSpider.getDataObject("doGetPhases");
               doGetPhases.clearDynamicCriteria();
               doGetPhases.addDynamicStrCriterion
                              ("iproj.iproj_id = '" + vProjID.toString() + "'");
          }

          int command = PROCEED;
          command = doAction(event);
          return(command);
     }
     //]]SPIDER_EVENT<BtnProject_onWebEvent>

     //[[SPIDER_EVENT<TxtPhase_onBeforeDisplayEvent>
     public int TxtPhase_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("5")==0){
            return(SKIP);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<TxtPhase_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<CboPhase_onBeforeDisplayEvent>
     public int CboPhase_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("5")==0){
            return(SKIP);
          }

          CSpComboBox cbo = (CSpComboBox)getDisplayField("CboPhase");
          cbo.doAutoFill();
          if( val.toString().compareTo("3")==0 ||
               val.toString().compareTo("4")==0){
            CSpString currProj =
(CSpString)CSpider.getUserSessionObject("soCurrPhase");

            //default the Phase
            setDisplayFieldValue("CboPhase",currProj);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<CboPhase_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnPhase_onBeforeDisplayEvent>
     public int BtnPhase_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("5")==0){
            return(SKIP);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<BtnPhase_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnPhase_onWebEvent>
     public int BtnPhase_onWebEvent(CSpWebEvent event)
     {
          String sProjID =
CSpider.getUserSessionObject("soCurrProj").toString();
          String sPhaseCd;

          //set the dyn criteria to filter the Workplan drop-down
          sPhaseCd = getDisplayFieldValue("CboPhase").toString();
          CSpSelect doWorkplan = (CSpSelect)
CSpider.getDataObject("doWorkplan");
          doWorkplan.clearDynamicCriteria();
          doWorkplan.addDynamicStrCriterion("iproj_wp.iproj_id = '" +  sProjID +
 "'");
          doWorkplan.addDynamicStrCriterion("iproj_wp.wp_phs_cd = '" + sPhaseCd
+ "'");

          CSpider.putUserSessionObject("soCurrPhase", new CSpString(sPhaseCd));
          CSpider.putUserSessionObject("soTimeEntryFlag", new CSpString("3"));

          int command = PROCEED;
          command = doAction(event);
          return(command);
     }
     //]]SPIDER_EVENT<BtnPhase_onWebEvent>

     //[[SPIDER_EVENT<TxtWorkplan_onBeforeDisplayEvent>
     public int TxtWorkplan_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("5")==0){
            return(SKIP);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<TxtWorkplan_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<CboWorkplans_onBeforeDisplayEvent>
     public int CboWorkplans_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("5")==0){
            return(SKIP);
          }

          CSpComboBox cbo = (CSpComboBox)getDisplayField("CboWorkplans");
          cbo.doAutoFill();

          if(val.toString().compareTo("4")==0){
           CSpString currProj =
               (CSpString)CSpider.getUserSessionObject("soCurrWorkPlan");

          //default the Workplan
          setDisplayFieldValue("CboWorkplans",currProj);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<CboWorkplans_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnWorkplan_onBeforeDisplayEvent>
     public int BtnWorkplan_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("5")==0){
            return(SKIP);
          }
          return (PROCEED);
     }
     //]]SPIDER_EVENT<BtnWorkplan_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnWorkplan_onWebEvent>
     public int BtnWorkplan_onWebEvent(CSpWebEvent event)
     {
          //Get the workplan
          CSpValue vWorkplan = getDisplayFieldValue("CboWorkplans");

          //populate the Task drop-down, pass in the Workplan name
          populateTaskDropDown(vWorkplan);

          CSpider.putUserSessionObject("soTimeEntryFlag", new CSpString("4"));
          CSpider.putUserSessionObject("soCurrWorkPlan", vWorkplan);

          int command = PROCEED;
          command = doAction(event);
          return(command);
     }
     //]]SPIDER_EVENT<BtnWorkplan_onWebEvent>

     //[[SPIDER_EVENT<TxtActivities_onBeforeDisplayEvent>
     public int TxtActivities_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("3")==0){
            return(SKIP);
          }
          return (PROCEED);//flag = 4 or 5
     }
     //]]SPIDER_EVENT<TxtActivities_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<CboBudgetTasks_onBeforeDisplayEvent>
     public int CboBudgetTasks_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("3")==0){
            return(SKIP);
          }

          //NOTE ND Forum helpers: I tried commenting out these next 2 line
          //but I still have the bleed problem.
          CSpComboBox cbo = (CSpComboBox)getDisplayField("CboBudgetTasks");
          cbo.doAutoFill();

          //if Add&Contnue or Add My Tasks buttons were pressed; i.e flag=true

if(CSpider.getUserSessionObject("soCurrTaskDefaultFlag").booleanValue()){

            CSpString sTask =
(CSpString)CSpider.getUserSessionObject("soCurrTask");

            //default the Task
            setDisplayFieldValue("CboBudgetTasks", sTask);

            //reset the flag
            CSpider.putUserSessionObject("soCurrTaskDefaultFlag", new
CSpBoolean(false));
          }

          return (PROCEED);//flag = 4 or 5
     }
     //]]SPIDER_EVENT<CboBudgetTasks_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnDone_onBeforeDisplayEvent>
     public int BtnDone_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("3")==0){
            return(SKIP);
          }
          return (PROCEED);//flag = 4 or 5
     }
     //]]SPIDER_EVENT<BtnDone_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnContinue_onBeforeDisplayEvent>
     public int BtnContinue_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("3")==0){
            return(SKIP);
          }
          return (PROCEED);//flag = 4 or 5
     }
     //]]SPIDER_EVENT<BtnContinue_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnAddFUT_onBeforeDisplayEvent>
     public int BtnAddFUT_onBeforeDisplayEvent(CSpDisplayEvent event)
     {
          CSpValue val = CSpider.getUserSessionObject("soTimeEntryFlag");
          if( val.toString().compareTo("1")==0 ||
               val.toString().compareTo("2")==0 ||
               val.toString().compareTo("3")==0){
            return(SKIP);
          }
          return (PROCEED);//flag = 4 or 5
     }
     //]]SPIDER_EVENT<BtnAddFUT_onBeforeDisplayEvent>

     //[[SPIDER_EVENT<BtnDone_onWebEvent>
     public int BtnDone_onWebEvent(CSpWebEvent event)
     {
          int error = addRecord();
          CSpButton btnAdd = (CSpButton)getDisplayField("BtnDone");
          if(error == 1){
            CSpString sErrMsg = new CSpString(
               "The task you are trying to add is already on<BR>the " +
               "current week's timesheet.");
            CSpider.putUserSessionObject("soErrMsg",sErrMsg);
            btnAdd.setTargetNDPage(new CSpCommonPageRef("PgErrorPage"));
            int command = PROCEED;
            command = doAction(event);
            return(command);
          }
          btnAdd.setTargetNDPage(new CSpCommonPageRef("PgEnterTimeCalendar"));

          int command = PROCEED;
          command = doAction(event);
          return(command);
     }
     //]]SPIDER_EVENT<BtnDone_onWebEvent>

     //[[SPIDER_EVENT<BtnContinue_onWebEvent>
     public int BtnContinue_onWebEvent(CSpWebEvent event)
     {
          CSpButton btnAdd = (CSpButton)getDisplayField("BtnContinue");
          int command = PROCEED;
          int error = addRecord();

          if(error == 1){
            CSpString sErrMsg = new CSpString(
               "The task you are trying to add is already on<BR>the " +
               "current week's timesheet.");
            CSpider.putUserSessionObject("soErrMsg",sErrMsg);

            command = load("PgErrorPage");
            return(command);
          }

          //JT 10-26-99
          // set flag to default Task when this page is reloaded
          CSpider.putUserSessionObject("soCurrTaskDefaultFlag", new
CSpBoolean(true));

          //Store display value the selected task so it can be restored when
          //this page is reloaded
          String sTask = getDisplayFieldValue("CboBudgetTasks").toString();
          CSpider.putUserSessionObject("soCurrTask", new CSpString(sTask));

          CSpHtml.sendMessage("sTask = " + sTask + "<BR>");

         //load same page...which will Default the Tasks drop-down to the one
the
         //user just selected.

          command = load("PgEnterTimeDay");
          return(command);
     }
     //]]SPIDER_EVENT<BtnContinue_onWebEvent>

     //[[SPIDER_EVENT<BtnAddFUT_onWebEvent>
     public int BtnAddFUT_onWebEvent(CSpWebEvent event)
     {
       String sCurrProj, sCurrWorkplan, sCurrEndDate, sTaskValues;
       String sPhase, sSegment, sStep, sTask,sSubTask, sUserID;
       String sInsertHours, sSqlStatement;
       CSpSelect doUserActivities;
       int nRows;
       StringTokenizer st;
       CSpButton btnAdd = (CSpButton)getDisplayField("BtnAddFUT");

       // Get all information needed to add time
       // Get Project
       sCurrProj = CSpider.getUserSessionObject("soCurrProj").toString();

       // Get Workplan
       sCurrWorkplan =
CSpider.getUserSessionObject("soCurrWorkPlan").toString();

       // Get Week Ending Date
       sCurrEndDate = CSpider.getUserSessionObject("soWeekEndDate").toString();

       // Get activity info
       sTaskValues = getDisplayFieldValue("CboBudgetTasks").toString();
       st = new StringTokenizer(sTaskValues,",");
       sPhase = st.nextToken();
       sSegment = st.nextToken();
       sStep = st.nextToken();
       sTask = st.nextToken();
       sSubTask = st.nextToken();
       sUserID = CSpider.getUserSessionObject("soUserID").toString();

      sSqlStatement = new String("INSERT INTO ttrk_user_iproj_wp " +
          "(iproj_id, iproj_wp_nm, wp_phs_cd, wp_seg_cd, wp_step_cd, " +
          "wp_task_cd, wp_sub_task_id, user_id) " +
          "VALUES ('" + sCurrProj + "', '" + sCurrWorkplan + "', " + sPhase + ",
 " +
          sSegment + ", " + sStep +", " + sTask +", '" + sSubTask + "', '"
          + sUserID +"')");

       //CSpider.putUserSessionObject("soDisplay", new
CSpString(sSqlStatement));
       CSpDataObject.executeImmediate("dsTimeTrackDB",sSqlStatement);

       //JT later...NOTE: Rick has NO SQL error chking here, not good!

       //JT 10-26-99
       // set flag to default Task when this page is reloaded
       CSpider.putUserSessionObject("soCurrTaskDefaultFlag", new
CSpBoolean(true));

       //Store display value the selected task so it can be restored when
       //this page is reloaded
       sTask = getDisplayFieldValue("CboBudgetTasks").toString();
       CSpider.putUserSessionObject("soCurrTask", new CSpString(sTask));

       CSpHtml.sendMessage("sTask = " + sTask + "<BR>");

       //load same page...which will Default the Tasks drop-down to the one the
       //user just selected.
       btnAdd.setTargetNDPage(new CSpCommonPageRef("PgEnterTimeDay"));

       int command = PROCEED;
       command = doAction(event);

       return(command);
     }
     //]]SPIDER_EVENT<BtnAddFUT_onWebEvent>

     //[[SPIDER_EVENT<BtnCancel_onWebEvent>
     public int BtnCancel_onWebEvent(CSpWebEvent event)
     {
          int command = PROCEED;
          command = doAction(event);
          return(command);
     }
     //]]SPIDER_EVENT<BtnCancel_onWebEvent>


     //[[SPIDER_EVENT<BtnMainMenu_onWebEvent>
     public int BtnMainMenu_onWebEvent(CSpWebEvent event)
     {
          int command = PROCEED;

          command = doAction(event);
          return(command);
     }
     //]]SPIDER_EVENT<BtnMainMenu_onWebEvent>

     //]]SPIDER_EVENTS END
}
====================================
(See attached file: PgEnterTimeDay.java)

PgEnterTimeDay.java

Reply via email to