xsharp.eu • Hopefully last question for a while. - Page 2
Page 2 of 3

Hopefully last question for a while.

Posted: Thu Apr 18, 2019 7:34 am
by lumberjack
Hi Jeff,
BiggyRat wrote:

Code: Select all

METHOD UpdateButton( ) CLASS JobInfo
LOCAL oTB as TextBox
IF self:server:RLOCK(self:server:RECNO)
  self:server:Commit()  // Why are you committing before you have done anything?
  self:oSFJobInfo_DETAIL:SingleLineEdit10 := ;
        ("$ " + AllTrim((Str(self:oSFJobInfo_DETAIL:RATE*self:oSFJobInfo_DETAIL:UNITS))))
  if self:oSFJobInfo_DETAIL:CurrentView == #FormView
    self:oSFJobInfo_DETAIL:FIELDPUT(#RateType, AllTrim(self:oSFJobInfo_DETAIL:ComboBox1))
  endif 
//  self:oSFJobInfo_DETAIL:
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:JOBDATE)
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBTIME, something.... )
  self:oSFJobInfo_DETAIL:server:Commit() 
  self:Browser:Refresh()
  self:oCCNewJobButton:Enable() 
ELSE
  oTB := TextBox{ self, cAppVersion,;
              "This record cannot be updated at present, as it is currently being accessed by another user"  }
  oTB:Type := BUTTONOKAY + BOXICONASTERISK
  oTb:Show()
ENDIF
RETURN NIL
Just an observation to make it easier to assist: You need to learn to extract the details out of your code that is applicable:

Code: Select all

METHOD Init(oWindow,iCtlID,oServer,uExtra) CLASS JobInfo_DETAIL 
  oDCDateTimePicker2 := DateTimePicker{SELF,ResourceID{JOBINFO_DETAIL_DATETIMEPICKER2,_GetInst()}}
  oDCDateTimePicker2:HyperLabel := HyperLabel{#DateTimePicker2,"DateTimePicker2",NULL_STRING,NULL_STRING}

  oDCDateTimePicker3 := DateTimePicker{SELF,ResourceID{JOBINFO_DETAIL_DATETIMEPICKER3,_GetInst()}}
  oDCDateTimePicker3:HyperLabel := HyperLabel{#DateTimePicker3,NULL_STRING,NULL_STRING,NULL_STRING}
RETURN self

METHOD UpdateButton( ) CLASS JobInfo
IF self:server:RLOCK(self:server:RECNO)
  self:server:Commit()  // Why are you committing before you have done anything?
  if self:oSFJobInfo_DETAIL:CurrentView == #FormView
    self:oSFJobInfo_DETAIL:FIELDPUT(#RateType, AllTrim(self:oSFJobInfo_DETAIL:ComboBox1))
  endif 
//  self:oSFJobInfo_DETAIL:
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:JOBDATE)
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBTIME, something.... )
  self:oSFJobInfo_DETAIL:server:Commit() 
  self:Browser:Refresh()
  self:oCCNewJobButton:Enable() 
ENDIF
RETURN NIL
Hope you understand... It makes it so much easier to assist and save all of us the frustration to try and unravel what you doing...

Hopefully last question for a while.

Posted: Thu Apr 18, 2019 12:05 pm
by BiggyRat
Well not really Johan... I have always believed (and was taught) it's better to give too much information than not enough. My concern is that if I leave out something, it could actually be the cause of my problem that is missing.

Hopefully last question for a while.

Posted: Thu Apr 18, 2019 12:30 pm
by FFF
Johan,
that's one of the reasons, why i was taught to put any "designer" generated into it's own mef - or prg these days ;) - and inherit in another file where all hand coding goes. Much easier to see what's what...

Karl

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 4:47 am
by lumberjack
Karl,
FFF wrote:that's one of the reasons, why i was taught to put any "designer" generated into it's own mef - or prg these days ;) - and inherit in another file where all hand coding goes. Much easier to see what's what...
It sounds like I was your mentor, I used that approach since early days of VO...

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 8:44 am
by FFF
;) - nope, it was the late Thomas Frey. Back in IIRC '94, first shy steps in 1.0beta...

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 11:19 am
by BiggyRat
umm, bot please?

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 11:20 am
by BiggyRat
umm, back on topic please?

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 1:31 pm
by FFF
umm, can't see you answered any of the questions asked...

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 2:03 pm
by lumberjack
Hi Jeff,
I am going to try and make logic of what I see. Is any of this actually working?

Code: Select all

METHOD UpdateButton( ) CLASS JobInfo
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBTIME, something.... )
  self:oSFJobInfo_DETAIL:server:Commit() 
You using SELF:oSFJobInfo_Detail:Server:Commit(), however you oSFJobInfo_DETAIL:FIELDPUT()...
My logic tells me the code should look like:

Code: Select all

//  self:oSFJobInfo_DETAIL:Server:FIELDPUT(#JOBTIME, something.... ) // Note the ":Server" injection
  self:oSFJobInfo_DETAIL:server:Commit() 
The other problem I see potentially:

Code: Select all

//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:JOBDATE)
Is this not one of your datetime picker controls? Then I would think the value will be retrieved as:

Code: Select all

//  self:oSFJobInfo_DETAIL:Server:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:oDTDatePicker2:Value...)

Hopefully last question for a while.

Posted: Fri Apr 19, 2019 2:14 pm
by BiggyRat
Hi Johan, yes you're 99% correct, except Jobtime and jobndate are fields, not datetime pickers. That's the entire problem. I have a date picker and a time picker (Datetimepicker2 and 3) the return value of which I want to assign to my fields jobtime and jobdate. Problem is the dtp 's are not in scope and unreachable. I put an export for both of them in the jobinfo class, making them accessible, but not initialized...