mariusdr
Posts: 21
|
| Posted: 11/08/2012, 3:05 PM |
|
Hi,
I'm trying to show a string in a label or textbox before the page shows. I'm going by the manual, either adding Before Show to the Label or Textbox, or BeforeShowRow for the form (I tried editable grid and grid), then I'm adding my code. That same code is working on a different page, in a BeforeExecuteUpdate event. I'm saying the events don't happen on my new page because even if I'd have some syntax error and the label wouldn't display anything, this is not the case because I can verify the code actually executed by checking logs on the server where it's accessing a web service, and there is nothing.
Any ideas?
Thanks!!!
|
 |
 |
MichaelMcDonald
Posts: 640
|
| Posted: 11/08/2012, 5:28 PM |
|
post ur code....
_________________
Central Coast, NSW, Australia.
|
 |
 |
mariusdr
Posts: 21
|
| Posted: 11/09/2012, 6:37 AM |
|
I can't seem to be able to reply, I click Submit but it doesn't show up in the thread. maybe it's too much? (about 190 lines)
Maybe it is the length, this is a short version:
'BindEvents Method @1-E2EB6CE4
'End BindEvents Method
Function Base64encode(byVal sText)
Stream_StringToBinary(sText)
End Function
Function Base64decode
Stream_BinaryToString(oNode.nodeTypedValue)
End Function
Function Stream_StringToBinary(Text)
End Function
FunctionStream_BinaryRoString(Binary)
End Function
Function sendSOAPString
Base64Encode
Base64Decode result
sendSOAPString=result
End Function
Function NewGrid1_Label1_BeforeShow(Sender) 'NewGrid1_Label1_BeforeShow @59-01042B4B
'Custom Code @62-73254650
' -------------------------
' Write your own code here.
' -------------------------
Dim myString
myString = "50000000000XCXCQ1000000000000000000000000000010000007335i073361013"
NewGrid1.Label1.Value = Left(sendSOAPString(myString),8)
'End Custom Code
End Function 'Close NewGrid1_Label1_BeforeShow @59-54C34B28
%>
|
 |
 |
mariusdr
Posts: 21
|
| Posted: 11/09/2012, 9:27 AM |
|
It's not the code, I'm new to both CC and web development, and I'm doing something wrong. I tried the example from the manual, and this isn't working either:
Method 1: Control Level
In this instance, we will change the value of a control called FirstName which is located in a form called User.
Add the Before Show event to the control
Within the event, add the code below:
ASP
Function User_FirstName_BeforeShow(Sender)
User.FirstName.Value = "Bob"
End Function
-------
In my case, this should be:
NewEditableGrid1.Label1.Value = "Bob"
Is this wrong?? Does this have anything to do with how I load the page, I keep hitting reload?
Any help is greatly appreciated.. Thanks!
|
 |
 |
ab5ni
Posts: 177
|
| Posted: 11/09/2012, 10:07 AM |
|
Put your functions below "Write your own code here" and give it a shot:like this:
'-------------------------
' Write your own code here.
' -------------------------
Function Base64encode(byVal sText)
Stream_StringToBinary(sText)
End Function
Function Base64decode
Stream_BinaryToString(oNode.nodeTypedValue)
End Function
Function Stream_StringToBinary(Text)
End Function
FunctionStream_BinaryRoString(Binary)
End Function
Function sendSOAPString
Base64Encode
Base64Decode result
sendSOAPString=result
End Function
GIve that a shot and tell us if it works.
Best Regards,
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
 |
 |
mariusdr
Posts: 21
|
| Posted: 11/09/2012, 10:12 AM |
|
Thanks, but you placed the functions within the BeforeShow function, that won't work (tried it). Anyhow, the exact same code and placement works on a different site. It's not the code! Please see my latest post above, not even this works, so I wonder what I'm doing wrong:
NewEditableGrid1.Label1.Value = "Bob"
I guess I can do this within an editable grid? I guess the naming convention is correct (the "form" is the grid, right)?
thanks!!
|
 |
 |
ab5ni
Posts: 177
|
| Posted: 11/09/2012, 10:40 AM |
|
Well, there is something definitely going on here, that's for sure .
Hmmmm...Thinking...k....I don't see an <% in that code to start things off, or did u clip it out by accident while pasting? Should be at the top of the page.
Regards,
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
 |
 |
ab5ni
Posts: 177
|
| Posted: 11/09/2012, 10:51 AM |
|
It's also important to note that CCS pages can become corrupted at times, so you mite want to recreate the page and see if that solves your issue.
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
 |
 |
mariusdr
Posts: 21
|
| Posted: 11/09/2012, 11:40 AM |
|
Yes, I will try a new page... this is the complete code:
<%
'BindEvents Method @1-CAD7D95B
Sub BindEvents(Level)
If Level="Page" Then
Else
Set NewEditableGrid1.Label1.CCSEvents("BeforeShow") = GetRef("NewEditableGrid1_Label1_BeforeShow")
End If
End Sub
'End BindEvents Method
Function NewEditableGrid1_Label1_BeforeShow(Sender) 'NewEditableGrid1_Label1_BeforeShow @3-0CFF093E
'Custom Code @6-73254650
' -------------------------
' Write your own code here.
' -------------------------
NewEditableGrid1.Label1.Value = "Bob the Builder"
'End Custom Code
End Function 'Close NewEditableGrid1_Label1_BeforeShow @3-54C34B28
%>
|
 |
 |
ab5ni
Posts: 177
|
| Posted: 11/09/2012, 12:13 PM |
|
k, mariusdr....
I'm going to create a new project in ASP and try your code to see if I have the same issue. I'll let u know how things go.
Best Regards,
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
 |
 |
mariusdr
Posts: 21
|
| Posted: 11/09/2012, 12:17 PM |
|
Thank you! I'm probably missing a step or a setting. I will look at the manual again and set up a new page.
|
 |
 |
ab5ni
Posts: 177
|
| Posted: 11/09/2012, 12:53 PM |
|
Well, I don't have access to a server with ASP on it, unfortunately. Do you know of a quick and easy way to get Apache fired up serving ASP pages?
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
 |
 |
mariusdr
Posts: 21
|
| Posted: 11/09/2012, 12:57 PM |
|
That's beyound my knowledge, sorry... never mind, I will eventually figure it out. Here's what i do, maybe it's something obviusly wrong: I add the EditableGrid to teh project, 2 columns, Update only. It defaults to textboxes, so I changed the first textbox to a label (I don't want it to be modified). I change the Control Source Type to Code Expression, then I go to the Events Tab and add the code to the BeforeShow event... Does that sound right?
thanks again!!
|
 |
 |
ab5ni
Posts: 177
|
| Posted: 11/09/2012, 2:49 PM |
|
I think I remember having a problem like this a while back, but don't remember how I solved it. You might be able to find our discussion here in the forums, though. I'll also check and see I can find the answer.
Wait..I think I remember. I'm not sure u can have only a label in an editable grid field. Put the text box back. Add a a label next to it, and then try to change the text. Either I'm mistaken, or it's something along those lines. Walter Kempees and I were discussing this some years ago. God, I miss Walter here in the forums! 
Regards,
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
 |
 |
|