CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Editable Grid / Custom Insert

Print topic Send  topic

Author Message
Megan

Posts: 35
Posted: 07/11/2006, 5:56 PM

I am very new to this - so please bear with me. My programming background is in Visual Basic - so this is somewhat similar.

Anyway, I'm creating an editable grid. I have a screen that shows detailed information for a particular record (each record has a separate "ListingID" which the users don't see, nor do I want them to). At the bottom of the screen, I have a link to view the notes for that particular record. When the user click on the "Notes" link, it brings up the grid with all the notes for that particular record. When I try to add a new note for that listing, it's storing the NoteID, the date, and the note, but not the ListingID. I've been messing with the Custom Insert Parameters, but I'm not getting very far. Whenever I try to build the application, it claims that the "ListingID" has not been declared. I did not create any custom code. Any suggestions?

Megan
View profile  Send private message
peterr


Posts: 5971
Posted: 07/11/2006, 7:58 PM

First, you'd need to make sure that your link transferrs the ListingID to the detail page, otherwise the detail page cannot know what ListingID was previously selected. If you don't see ListingID in the URL then this is the problem.
Second, you may need to create a hidden field in the row of your editable grid and populate it with the ListingID from the URL. When using ASP you can do this by entering CCGetFromGet("ListingID","") as the default value of your hidden field.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Megan

Posts: 35
Posted: 07/11/2006, 8:54 PM

Thank you for the prompt response. The ListingID is passed on to the Notes form. So, I entered in the value you indicated above in the "Default Value" parameter of the text box. When I try to publish the project to test the results, I get an error that states: "Name 'CCGetFromGet' is not declared". I've had this error before when I tried to use one of the "CC" procedures. Is there a component or something that I haven't loaded? Thanks again.

Megan
View profile  Send private message
peterr


Posts: 5971
Posted: 07/11/2006, 9:45 PM

Sorry but I couldn't reproduce this error. I tried hidden field and a textbox, inside search form, record form, editable grid, and outside of any form - it just works OK every time for me.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Megan

Posts: 35
Posted: 07/12/2006, 8:50 PM

So where do I declare items like "CCGetFromGet" and "CCDLookup" (which also doesn't work and I get the same error)? It's obvious that these need to be declared somewhere, but I don't know where. Thanks.

Megan
View profile  Send private message
Megan

Posts: 35
Posted: 07/12/2006, 10:11 PM

One other thing - in my research for CCDLookup, the documentation claims this is a function that is automatically "included" in the project. If these functions were included in the project automatically when my program was created, should there or should there not be any issues with declaring these functions? I've reinstalled the program on the off-chance that this would fix the problem (maybe something didn't install correctly?) - no such luck.

Megan
View profile  Send private message
peterr


Posts: 5971
Posted: 07/13/2006, 1:11 AM

I didn't declare anything and it just worked. These functions are included in Common.asp, and CCS-created Web applications just wouldn't work without them.
The only explanation I'd have is that you must be entering that function into a wrong place.
I wrote about "default value of your hidden field", while you responded about "Default Value parameter of the text box".
I also see that you previously had the error "the ListingID has not been declared. ", and your new error is similar. So you need to get rid of that first error first - do not use Custom Insert.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 07/13/2006, 1:19 AM

Here is a screenshot showing various control properties, including "Default Value": http://docs.codecharge.com/studio3/html/QuickStart/Crea...stBoxProps.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Megan

Posts: 35
Posted: 07/13/2006, 10:04 AM

I think we're on the same thing - I'm just used to different terminology. I entered the CCGetFromGet("ListingID","") in the "Default Value" entry on the control properties (which is a listbox), just like the control properties that are shown in the screenshot you provided a link to. My listbox is set up pretty much exactly as the example shows as well (just different field names). I tried a test where I put a ListingID value in the Default Value property, and it defaulted to that value like it should. As soon as I changed it to the function as described, I get the error that it's not been declared.

After further investigating this issue based on your response that all projects need the "common.asp" or it won't work, here's what I found: I looked through the common files section of my project, and there is no common.asp. I opened the sample project that is installed on my computer, reviewed the common files, and there's a common.asp file there. I opened it to look through it, and there are all the functions that I've been trying to use but can't. So, how do I import this common.asp file into my project?

Megan
View profile  Send private message
peterr


Posts: 5971
Posted: 07/13/2006, 2:57 PM

Well, just to make sure: did you also disable/delete the Custom Insert that you were using previously?

Though I find your issue with missing Common.asp just impossible... Your application wouldn't start at all without Common.asp, and I don't know how to create applications without it. It is generated every time when you publish your application from CCS and there is no way and no need to import it. Though it doesn't need to be in your project folder, only on the server. Even when you look at the code of any of your generated ASP pages (like PageName.asp), the first line you will see is similar to this:
<!-- #INCLUDE VIRTUAL="/Common.asp"-->
Your application would stop right there if this file didn't exist...

I also recommend creating a new simple editable grid or record form and re-testing it with the "Default Value" property, just to avoid issues with any leftover Custom Insert or other settings from prior testing.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Megan

Posts: 35
Posted: 08/10/2006, 1:29 PM

OK - I've resolved a lot of this, but I'm still having a problem with one thing that you can maybe help with. I followed your advice: created a text box that contains the "ListingID"; set the default value as CCGetFromGet("ListingID",""). All of this works fine as long as the text box is visible. As soon as I set the Visible property to "no", run the program to test it, it doesn't add records to the database from the grid. As soon as I set the visible property to "Yes", I can insert new records.

However, I'm also having problems deleting previous records from the grid. When I select "Delete", and then click on Submit, it seems to work. However, when I go back to view it, it seems to have only deleted pieces of information but not the entire record. I've tried changing the "Custom Delete" to a SQL statement or just select "Table" and neither one work. The SQL statement that is being used is "DELETE FROM TBL_ListingNotes WHERE NoteID = {NoteID}". I've used SQL queries in the past, and I thought it should say "DELETE * FROM TBL_ListingNotes WHERE NoteID = {NoteID}", but that doesn't work either.

Thanks.

Megan
View profile  Send private message
Megan

Posts: 35
Posted: 08/10/2006, 7:55 PM

Never mind - got it. I wanted to give an update for what I did. Instead of using a text box on the screen that was not visible, I did a custom insert, created the custom insert table as a "Table", and created an expression where the "CCGetFromGet("ListingID","") is used to update the ListingID in the table. It's working great.

Megan
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.