This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1]
1
Web Server - Ask For Help / Re: EIP Select new field based on value after EIP accepted
« on: September 06, 2016, 01:58:26 PM »
Bruce provided an answer in a NetTalk webinar.
Assume that the table being browsed is:
MyFileID LONG ! Primary key
Col_1 STRING(20)
Col_2 STRING(20)
Col_3 STRING(20)
Col_4 STRING(20)
Col_5 STRING(20)
And the browse for this table is BrowseMyFile
The javascript to select a different field is:
p_web.script('$("#' & 'inp'& field to select & '").focus();')
field to select looks like this:
p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID)
Where:
BrowseMyFile is the name of the browse
_pre:Col_4 is the name of the field to select (with a leading underscore)
pre:MyFileID is the unique ID (primary key)
The complete javascript is:
p_web.script('$("#' & 'inp'& p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID) & '").focus();')
or without formatting:
p_web.script('$("#' & 'inp'&p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID & '").focus();')
Put this code in
Validate::pre:Col_2
! Start of "After Validate New Value"
! [Priority 5000]
IF p_web.GSV('pre:Col_2') = 'NEED COL 4'
p_web.script('$("#' & 'inp'&p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID & '").focus();') ! Select pre:Col_4
ELSE
p_web.script('$("#' & 'inp'&p_web.crc32('BrowseMyFile_pre:Col_5'&pre:MyFileID & '").focus();') ! Select pre:Col_5
END
NOTE: Spelling and case are important, follow what is in the dictionary.
Cheers,
Paul
Assume that the table being browsed is:
MyFileID LONG ! Primary key
Col_1 STRING(20)
Col_2 STRING(20)
Col_3 STRING(20)
Col_4 STRING(20)
Col_5 STRING(20)
And the browse for this table is BrowseMyFile
The javascript to select a different field is:
p_web.script('$("#' & 'inp'& field to select & '").focus();')
field to select looks like this:
p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID)
Where:
BrowseMyFile is the name of the browse
_pre:Col_4 is the name of the field to select (with a leading underscore)
pre:MyFileID is the unique ID (primary key)
The complete javascript is:
p_web.script('$("#' & 'inp'& p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID) & '").focus();')
or without formatting:
p_web.script('$("#' & 'inp'&p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID & '").focus();')
Put this code in
Validate::pre:Col_2
! Start of "After Validate New Value"
! [Priority 5000]
IF p_web.GSV('pre:Col_2') = 'NEED COL 4'
p_web.script('$("#' & 'inp'&p_web.crc32('BrowseMyFile_pre:Col_4'&pre:MyFileID & '").focus();') ! Select pre:Col_4
ELSE
p_web.script('$("#' & 'inp'&p_web.crc32('BrowseMyFile_pre:Col_5'&pre:MyFileID & '").focus();') ! Select pre:Col_5
END
NOTE: Spelling and case are important, follow what is in the dictionary.
Cheers,
Paul
2
Web Server - Ask For Help / EIP Select new field based on value after EIP accepted
« on: August 08, 2016, 08:37:32 AM »
I have a browse that has EIP turned on for several fields. I would like to select a specific EIP field based on the entry I make in an EIP field.
Example:
Browse
_____________________________
| Col 1 | Col 2 | Col 3 | Col 4 | Col 5 |
_____________________________
After entering a value in "Col 2" based on that value (in "Col 2") I need to either go to "Col 3" (normal behaviour) or to "Col 4" (what I am asking about).
I can trap the "eipaccepted" event but am not sure how to select the desired EIP field. Have tried:
p_web.SetValue('SelectField',clip(loc:formname)& '.' & p_web.NoColon('pre:col4'))
p_web.SetValue('_eipclm_', 'pre:col4')
do CallEip
This brings up an alert I've set for the field "Col 4" but doesn't stay on field "Col 4".
Thanks,
Paul
Example:
Browse
_____________________________
| Col 1 | Col 2 | Col 3 | Col 4 | Col 5 |
_____________________________
After entering a value in "Col 2" based on that value (in "Col 2") I need to either go to "Col 3" (normal behaviour) or to "Col 4" (what I am asking about).
I can trap the "eipaccepted" event but am not sure how to select the desired EIP field. Have tried:
p_web.SetValue('SelectField',clip(loc:formname)& '.' & p_web.NoColon('pre:col4'))
p_web.SetValue('_eipclm_', 'pre:col4')
do CallEip
This brings up an alert I've set for the field "Col 4" but doesn't stay on field "Col 4".
Thanks,
Paul
3
Web Server - Ask For Help / Re: Problem with GetDescription
« on: September 22, 2014, 10:23:49 PM »
Hi Bruce,
Using NetDebugView, I see that the correct values are set when using the new switch. However, nothing is displayed on screen.
I have attached a demo app. It is complied with the switch set. Try it both ways. The problem field is Labour Code.Type in each of these codes 32, 32, 57 and 95. That will show you what is happening.
Cheers,
Paul
[attachment deleted by admin]
Using NetDebugView, I see that the correct values are set when using the new switch. However, nothing is displayed on screen.
I have attached a demo app. It is complied with the switch set. Try it both ways. The problem field is Labour Code.Type in each of these codes 32, 32, 57 and 95. That will show you what is happening.
Cheers,
Paul
[attachment deleted by admin]
4
Web Server - Ask For Help / Re: Problem with GetDescription
« on: September 22, 2014, 08:27:31 AM »
Thanks Bruce!
I'll give it a workout and report back, with an example if needed.
Cheers,
Paul
I'll give it a workout and report back, with an example if needed.
Cheers,
Paul
5
Web Server - Ask For Help / Re: Problem with GetDescription
« on: September 19, 2014, 06:35:04 AM »
Thanks Bruce!
I've struggled with disabling / overriding this "by design" behaviour. I have to keep changing the value that is looked up. And, just before the write to disk, I change it one last time.
Could you suggest the most efficient / effective way of doing this?
Cheers,
Paul
I've struggled with disabling / overriding this "by design" behaviour. I have to keep changing the value that is looked up. And, just before the write to disk, I change it one last time.
Could you suggest the most efficient / effective way of doing this?
Cheers,
Paul
6
Web Server - Ask For Help / Re: Problem with GetDescription
« on: September 18, 2014, 01:51:22 PM »
I have give you an example Bruce. I've been fighting with this for several weeks on and off.
Here is the situation. A table with only two key fields -- the primary (unique, auto numbered) and a description (unique) field.
Some sample data:
ID Description
1 A01
2 A02
...
6 32 ! Yes this is the description that is a number and matches an ID
...
10 57 ! Another description that is a number and matches an ID
...
32 A19
...
57 S21
Your code in NetWeb.clw in NetWebServerWorker.GetDescription will fail for description "32" and description "57". This because
err = self.GetFile(p_file,CodeKey) !line 10266
will be set to 0 since 32 (as a description) will be found in the ID field and "A19" will be returned as the description. And if 57 (as a description) is looked for the result will be "S21".
In summary, because the description field matches an ID entry (by coincidence) an incorrect description and ID is returned.
I suggest that you add a template option. Something like, "Use description key only for look ups"
Cheers,
Paul
Here is the situation. A table with only two key fields -- the primary (unique, auto numbered) and a description (unique) field.
Some sample data:
ID Description
1 A01
2 A02
...
6 32 ! Yes this is the description that is a number and matches an ID
...
10 57 ! Another description that is a number and matches an ID
...
32 A19
...
57 S21
Your code in NetWeb.clw in NetWebServerWorker.GetDescription will fail for description "32" and description "57". This because
err = self.GetFile(p_file,CodeKey) !line 10266
will be set to 0 since 32 (as a description) will be found in the ID field and "A19" will be returned as the description. And if 57 (as a description) is looked for the result will be "S21".
In summary, because the description field matches an ID entry (by coincidence) an incorrect description and ID is returned.
I suggest that you add a template option. Something like, "Use description key only for look ups"
Cheers,
Paul
7
Web Server - Ask For Help / Re: error with nettalk 8 during runtime...
« on: March 17, 2014, 10:27:33 PM »
I'm getting the error too.
Also, right after logging in, this error message is on the browser screen:
"Error in site JavaScript"
And, the error noted above can found using Firebug.
Paul
Also, right after logging in, this error message is on the browser screen:
"Error in site JavaScript"
And, the error noted above can found using Firebug.
Paul
8
Web Server - Ask For Help / Re: NetWebForm "hide condition" with and without auto-complete
« on: February 20, 2014, 02:21:43 PM »
Leaving the look-up in place but, clearing Enable Autocomplete, solved my problems. Now it works as expected.
Thanks for the suggestions and help, Bruce.
Cheers,
Paul
Thanks for the suggestions and help, Bruce.
Cheers,
Paul
9
Web Server - Ask For Help / Re: NetWebForm "hide condition" with and without auto-complete
« on: February 18, 2014, 01:10:25 PM »
Hide condition is: p_web.GetSessionValue('LEC:Equipment') = 0
This is a field in the lookup table for Labour Codes. It is NOT the lookup field of Labour Code. Could that be a problem for the case when a correct entry is typed and the the user tabs off of the field? If so, where should I embed some code to retrieve the Equipment value?
Cheers,
Paul
This is a field in the lookup table for Labour Codes. It is NOT the lookup field of Labour Code. Could that be a problem for the case when a correct entry is typed and the the user tabs off of the field? If so, where should I embed some code to retrieve the Equipment value?
Cheers,
Paul
10
Web Server - Ask For Help / NetWebForm "hide condition" with and without auto-complete
« on: February 17, 2014, 04:50:42 PM »
Here is the scenario:
Form has these two related fields:
Labour Code: _________ ? (Look-up)
Equipment: __________ ? (Look-up)
Entry field: LabourCode is an Auto-Complete field with popup look up into the Labour Codes table. When an entry from the Labour Codes table is selected, I use an additional field in the Labour Codes table to indicate whether Equipment (another table) can be used with that code. I have set up a "Hide" condition on the Equipment field when a selection is made from the popup Labour Code table. This works as expected.
Question: Is there a way to also trigger the hiding/unhiding of the Equipment field when a Labour Code entry is typed in and then the field is tabbed away from (no look-up popup)?
Paul
Thanks for any suggestions.
Paul
Form has these two related fields:
Labour Code: _________ ? (Look-up)
Equipment: __________ ? (Look-up)
Entry field: LabourCode is an Auto-Complete field with popup look up into the Labour Codes table. When an entry from the Labour Codes table is selected, I use an additional field in the Labour Codes table to indicate whether Equipment (another table) can be used with that code. I have set up a "Hide" condition on the Equipment field when a selection is made from the popup Labour Code table. This works as expected.
Question: Is there a way to also trigger the hiding/unhiding of the Equipment field when a Labour Code entry is typed in and then the field is tabbed away from (no look-up popup)?
Paul
Thanks for any suggestions.
Paul
Pages: [1]