r1xliquid
Posts: 41
|
| Posted: 07/10/2007, 8:56 AM |
|
I am trying to use custom code to change the HTMLFormAction porperty of a record.
The event beforeShow is called after the HTMLFormAction is initially set up by codecharge. I thought this would be a good place to attempt to change it. But it is not working for me. The action is still the one generated in the Show() funtion of the record's class.
If anyone has done this i would appreciate some guidance,
thanks, brian
|
 |
 |
matheus
Posts: 386
|
| Posted: 07/10/2007, 9:45 AM |
|
brian,
I change HTMLFormAction in Java, in Java was a class named View.
It's where {HTMLFormAction} tag was changed with Record value.
Maybe is something like this in ASP.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
r1xliquid
Posts: 41
|
| Posted: 07/10/2007, 10:37 AM |
|
Quote matheus:
I change HTMLFormAction in Java, in Java was a class named View.
It's where {HTMLFormAction} tag was changed with Record value.
matheus,
i appreciate your reply. It looks to be a little different is ASP. the HTMLFormAction is a public property of my record's class. [recordClassName].htmlFormAction. So i am not quite sure where the View class comes into play.
From what event did you add the code to make this value change? I have tried from beforeShow with no success.
thanks again
brian
|
 |
 |
matheus
Posts: 386
|
| Posted: 07/10/2007, 10:59 AM |
|
For me, in Java, HTMLFormAction is a property in Record.
But had a class in Common Files (in this case View.java) that, change all {thiskind} tag for values from components.
I create a ASP project (with Templates I think), I look that doesn't exists a general View class, so I take a create a record and take a look in code.
'NewRecord1 Show Method @2-676F0933
Sub Show(Tpl)
If NOT Visible Then Exit Sub
EditMode = False
HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "NewRecord1" & IIf(EditMode, ":Edit", ""))
Set TemplateBlock = Tpl.Block("Record " & ComponentName)
TemplateBlock.Variable("HTMLFormName") = ComponentName
TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded"
Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _
Array(TextBox1, TextBox2, Button_Insert, Button_Update, Button_Delete))
If Not FormSubmitted Then
End If
If FormSubmitted Then
With TemplateBlock.Block("Error")
.Variable("Error") = ValidatingControls.GetErrors & Errors.ToString
.Parse False
End With
End If
TemplateBlock.Variable("Action") = HTMLFormAction
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me)
If Visible Then Controls.Show
End Sub
'End NewRecord1 Show Method
I change like the first bold block, change TemplateBlock.Variable = YourNewFormAction
I don't think you have visibility to change TemplateBlock.Variable in before show.
Hope this help.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
r1xliquid
Posts: 41
|
| Posted: 07/10/2007, 12:31 PM |
|
I am not sure how codeCharge works using java, but with ASP it is not a good idea to change the actual code in the ASP files. Once that code is changed codeCharge will no longer makes updates to that function when you do a simple update in the GUI.
That is why i am attempting to find a way to change this from the _events.asp page.
Thanks
|
 |
 |
|