Jan,
I have the comboboxes set via refreshlist statements. My problem
is the check boxes. I was originally setting them with:
SET VAR vmyckboxvar = 'T'
RECALC variables
After I read your message, I checked my comboxbox settings and saw
that I was already using refreshlist. I had never thought about doing
something similar for the check boxes, but I ran into problems. The
check boxes have a status and a checked property, but using either one
causes a recalc. I just tried replacing the check boxes with pus
buttons and extra code to simulate the check box effect. That works,
but it is a little clunky.
Thanks,
Jason
Jason Kramer
University Archives and Records Management
002 Pearson Hall
(302) 831 - 3127 (voice)
(302) 831 - 6903 (fax)
On 4/6/2010 10:35 AM, jan johansen wrote:
Jason,
I am using V8 but I know this works in 7.6.
I am using this with a VariableListView. I do not use a
recalc variables.
If I understand you correctly you may be using a Variable Lookup
Combo Box.
Try replacing your recalc variables with a
PROPERTY yourcombolookupcomponentid
LOOKUPWHERECLAUSE .vwhereclause
PROPERTY yourcombolookupcomponentid REFRESHLIST 'TRUE'
Jan
-----Original
Message-----
From: Jason Kramer <[email protected]>
To: [email protected] (RBASE-L Mailing List)
Date: Tue, 06 Apr 2010 09:55:55 -0400
Subject: [RBASE-L] - Re: ON KEYPRESS question
To see if the problem with spaces I am having is just my code, I
took Razzak's code and added a RECALC VARIABLES statement. As soon as
I did that, I have the problem of the cursor jumping back to the
beginning of the VE when a space is entered, if I take out the RECALC
statement, I have no problem. The code is below. It is just as Razzak
originally wrote it with the exception of the RECALC statement towards
the bottom. It is between the PROPERTY refreshlist and LABEL done
statements.
Jan, are you using 8 or 9 instead of 7? Are you sure your RECALC
VARIABLES statment is getting executed when a space is entered?
Thanks,
Jason
-- OnKeyPress EEP
-- A. Razzak Memon
-- July 4, 2009
GETPROPERTY keyword textvalue vkeyword
IF vkeyword = '*' OR vkeyword = '%' THEN
-- Define Where Clause
SET VAR vwhereclause = ('Company IS NOT NULL')
PROPERTY lv_customers refreshlist 'TRUE'
PROPERTY lv_customers set_focus 'TRUE'
PROPERTY exportresultsas enabled 'TRUE'
GOTO done
ENDIF
-- Pre-define variables
SET VAR vquotes = (CVAL('QUOTES'))
SET VAR vmany = (CVAL('MANY'))
SET VAR vsearchstring TEXT = NULL
SET VAR vwhereclause TEXT = NULL
SET VAR vsearchstring = (.vquotes+.vkeyword+.vmany+.vquotes)
-- Define Where Clause
SET VAR vwhereclause = +
('Company LIKE'&.vsearchstring&'OR ' + +
'CustAddress LIKE'&.vsearchstring&'OR ' + +
'CustCity LIKE'&.vsearchstring&'OR ' + +
'CustState LIKE'&.vsearchstring&'OR ' + +
'CustZip LIKE'&.vsearchstring&'OR ' + +
'CustPhone LIKE'&.vsearchstring&'OR ' + +
'CustFax LIKE'&.vsearchstring&'OR ' + +
'CustURL LIKE'&.vsearchstring)
PROPERTY lv_customers refreshlist 'TRUE'
RECALC VARIABLES
LABEL done
CLEAR VAR iv%
RETURN
Jason Kramer
University Archives and Records Management
002 Pearson Hall
(302) 831 - 3127 (voice)
(302) 831 - 6903 (fax)
On 4/5/2010 6:44 PM, jan johansen wrote:
Jason,
The answer to your question is yes.
I checked my on key press eep and it handles spaces just
fine.
Jan
-----Original
Message-----
From: Jason Kramer <[email protected]>
To:
[email protected] (RBASE-L Mailing List)
Date: Mon, 05 Apr 2010 16:30:53 -0400
Subject: [RBASE-L] - Re: ON KEYPRESS question
Dear Albert, Razzak, and Jan,
Thank you for writing back. I had some non-R:BASE things to work
on so it took me until this afternoon to try your suggestions.
I am using 7.6.8.30331.
I'm pretty sure that NULL is set to NULL, not space. How would I check
to be certain?
I was already doing something similar to SET VAR vMyVar =
(.vQuotes+.vMyVar+.vMany+.vQuotes) because I was basing my form on the
OnKeyPress sample Razzak mentioned.
I finally found my problem, but I can't come up with a solution. I
have a RECALC VARIABLES in my EEP, and this causes the cursor to jump
to the beginning of the VE and drops the last space. I have the RECALC
VARIABLES in there because if the users enters a search string that
will result in only one possible value for some Variable Lookup Combo
Boxes, then I set them and and also set a check box to show they are in
use. If the user deletes some characters from the search box VE such
that there are now multiple possible values in the VLCBs where there
was previously only one, then the check boxes are cleared, and the VLCB
is nullified to reflect that.
I don't know if my explanation above made sense, so if not, let me
know and I will work on it, and add an example.
So my question now is, Is there a way to use a VE with an On
KeyPress EEP and handle situations where there is a space in the input,
and there is a need to recalc variables during the input?
Thanks,
Jason
Jason Kramer
University Archives and Records Management
002 Pearson Hall
(302) 831 - 3127 (voice)
(302) 831 - 6903 (fax)
On 4/1/2010 7:08 PM, Albert Berry wrote:
A thought, Jason - do you have NULL set to a space while
the form is in use?
Albert
Jason Kramer wrote:
I am trying to write a form that will
display a steadily refined list of names. I have a variable edit and a
variable lookup list box. As the user types in a name I wan the list
in the list box to update by dropping all the invalid names. For
example, if my list of names is:
John Doe
Jason Kramer
James A Garfield
James Joyce
And the user types J, nothing will be changed, but if the user types
Ja, then John Doe should be dropped. The problem I am running into is
when the user gets to the point that there is a space in the name.
After the user types a space, the cursor jumps back to the first
position in the Variable Edit and the trailing space is dropped. So
far the only way I can find to work with a space is to type the first
and last name together (JamesJ) and then go back and add the space
(James J). The is probably not going to go over well with the end
users.
I am currently using an ON KEYPRESS EEP that starts by getting the
TEXTVALUE of the variable edit and putting it into a variable
(GETPROPERTY vesearchbox TEXTVALUE vmyvar) and then using vmyvar to
refine the list:
SELECT COUNT names INTO vnamecount FROM mytable WHERE fname = .vmyvar.
Does anyone know of a way to handle a name (or other string) with a
space in it and retain the space using ON KEYPRESS? I can rewrite the
form so that the search limit is entered and then a button (or an on
exit EEP is fired) to trigger the search, but I thought that a slicker
implementation would have the list being refined automagically (at
least as far as the end user is concerned).
Thanks,
Jason
--
Jason Kramer
University Archives and Records Management
002 Pearson Hall
(302) 831 - 3127 (voice)
(302) 831 - 6903 (fax)
|