robn
Posts: 70
|
| Posted: 07/25/2006, 7:47 AM |
|
I have an interesting little problem (well I think it is anyway)
I have a form that holds a combined total for a record from another table. The calcualation for this figured is derived from the other table. so basically when in the main form (for table opportunity) with say the ID=4 the calcualation looks in table ValueBreakdown for any records that have a foreign ID of 4 and calculates the total of these records. This provides the figure to go into the main form (opportunity). To do this I placed an Before Show event against the field which looks like this
tblOpportunity.TotalGrossValue.Value = CCDLookUp("sum (DollarValue)","tblValueBreakdown","id=" & DBssso_001.ToSQL(CCGetFromGet("id",0),ccsInteger), DBsso_001)
this code works perfectly when loading the form. The problem I have is when the form has loaded there is a popup link which allows the user to change/add/delete the related tblValueBreakdown records. So after the popup has been updated it closes and updates the TotalGrossValue field on the main form. I know this could be done with a page reload but if possible I would like to avoid this and just refresh/reload the value in TotalGrossValue.
Any help or ideas on this would be much appriecated
Thanks in advance
Rob
|
 |
 |
robn
Posts: 70
|
| Posted: 07/26/2006, 5:21 AM |
|
I have made a bit of progress on the above issue.
I can't find a way to refresh/reload just one area of a form (again if anyone knows of a way to do this I would be most grateful). So I have had to resort to reloading the whole form. but as I want to hold any changes the user has made to the form without submitting it I have passed the fields in a URL string so on reload the form uses these to fill in data on certain fields. This has worked fine apart from on the comments field which is a text area.
When inputting comments they work fine if only space in used. If the user hits return though the return is ignored and the text is just joined to the previous word making it none sensical. Is there any way around this or do I have to look at another method?
the code I have so far looks a little like this
one the main screen when the user selects a link to the popup the parmeters of the main form are passed to the popup
function ViewValueOpportunity() {
var intWidth = 725
var intHeight = 600
var intTop = 25
var intLeft = 50
objViewValueOpportunity = window.open('/ssso/tight/HBFF4B.asp?OID=' + document.tblOpportunitie.OID.value + '&Salesperson=' + document.tblOpportunitie.Salesperson.value + '&Territory=' + document.tblOpportunitie.Territory.value + '&ProductGroup=' + document.tblOpportunitie.ProductGroup.value,'objViewValueOpportunity','scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,left=' + intLeft + ',top=' + intTop + ',width=' + intWidth + ',height=' + intHeight);
if (window.focus) {
objViewValueOpportunity.opener = self;
objViewValueOpportunity.focus();
}
}
Then on submission of the popup it is redirected to a dummy page (so there is no problem with the Submit/timeout issue. Which then on the before show closes the window and sets the opener page values. The code looks like this.
window.close();
window.opener.location.href="HBFF2A.asp?OID=" + document.RedirectToHBFF2A.OID.value + "&Salesperson=" + document.RedirectToHBFF2A.Salesperson.value + "&Territory=" + document.RedirectToHBFF2A.Territory.value + "&PAID=" + document.RedirectToHBFF2A.PAID.value + "&ProductGroup=" + document.RedirectToHBFF2A.ProductGroup.value;
like I have said this works fine apart from the comments field when there is a return in the text area.
Any help would be great
many thanks
Rob
|
 |
 |
robn
Posts: 70
|
| Posted: 07/26/2006, 7:19 AM |
|
Right some more progress
I have worked out a way to pass the comments (text area) data correctly using some features within CCS. But this only works from the list screen as it uses ASP. Basically I have a list screen that depending on if you are the owner of a record or not will display either an update or view only form. This is done by a dummy page setting the redirect. So I pass the parameters from the link screen to the dummy screen then use the following code to redirect the user and pass through the parameters.
if tblOpportunitie.Salesperson.value = session("userid") then
response.redirect("HBFF2A.asp?" & CCGetQueryString("All", Array("ccsForm")))
else
response.redirect("HBFF2C.asp?" & CCGetQueryString("All", Array("ccsForm")))
end if
this passes through the parameters fine and also holds the returns in the text area.
But I can replicate this in Java (which is what I require for the popups as I need to set the size of the popup and also hide menu bars (see code in last post) if anyone knows how to do this in java or has any ideas how i could to it in asp and set the window size and hide the menu bars your help would be much appreciated
thanks
Rob
|
 |
 |
robn
Posts: 70
|
| Posted: 07/26/2006, 9:24 AM |
|
solved it!
I wrote the following code on the onclick of the button
function ViewValueOpportunity()
{
var OID;
var Salesperson;
var Territory;
var ProductGroup;
var CustomerName;
var Website
var NameOfProjOpp;
var ParentFrameAgree;
var PAID;
var Comments;
OID = escape(document.tblOpportunitie.OID.value);
Salesperson = escape(document.tblOpportunitie.Salesperson.value);
Territory = escape(document.tblOpportunitie.Territory.value);
ProductGroup = escape(document.tblOpportunitie.ProductGroup.value);
CustomerName = escape(document.tblOpportunitie.CustomerName.value);
Website = escape(document.tblOpportunitie.Website.value);
NameOfProjOpp = escape(document.tblOpportunitie.NameOfProjOpp.value);
ParentFrameAgree = escape(document.tblOpportunitie.ParentFrameAgree.value);
PAID = escape(document.tblOpportunitie.PAID.value);
Comments = escape(document.tblOpportunitie.Comments.value);
var linkhref = "/eqmssso/Hydratight/HBFF4B.asp";
var win=window.open(linkhref+"?OID=" + OID + "&Salesperson=" + Salesperson + "&Territory=" + Territory + "&ProductGroup=" + ProductGroup + "&CustomerName=" + CustomerName + "&Website=" + Website + "&NameOfProjOpp=" + NameOfProjOpp + "&ParentFrameAgree=" + ParentFrameAgree + "&PAID=" + PAID + "&Comments=" + Comments, "HBFF4B", "left=100,top=10,width=480,height=480,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
win.focus();
}
Then on the dummy page before show i wrote this code
var OID;
var Salesperson;
var Territory;
var ProductGroup;
var CustomerName;
var Website
var NameOfProjOpp;
var ParentFrameAgree;
var PAID;
var Comments;
OID = escape(document.RedirectToHBFF2A.OID.value);
Salesperson = escape(document.RedirectToHBFF2A.Salesperson.value);
Territory = escape(document.RedirectToHBFF2A.Territory.value);
ProductGroup = escape(document.RedirectToHBFF2A.ProductGroup.value);
CustomerName = escape(document.RedirectToHBFF2A.CustomerName.value);
Website = escape(document.RedirectToHBFF2A.Website.value);
NameOfProjOpp = escape(document.RedirectToHBFF2A.NameOfProjOpp.value);
ParentFrameAgree = escape(document.RedirectToHBFF2A.ParentFrameAgree.value);
PAID = escape(document.RedirectToHBFF2A.PAID.value);
Comments = escape(document.RedirectToHBFF2A.Comments.value);
window.close();
window.opener.location.href="HBFF2A.asp?OID=" + + OID + "&Salesperson=" + Salesperson + "&Territory=" + Territory + "&ProductGroup=" + ProductGroup + "&CustomerName=" + CustomerName + "&Website=" + Website + "&NameOfProjOpp=" + NameOfProjOpp + "&ParentFrameAgree=" + ParentFrameAgree + "&PAID=" + PAID + "&Comments=" + Comments;
This works fine and passes through the values of the text field correctly (recognisess to returns). Would have prefered to just fresh a couple of fields on the form but could not find a way to do this so the above will have to do unless anyone knows of a better way?
Rob
|
 |
 |
|