This is too complex a structure for the basic binding. It can handle simple one-one pointer objects and CAN handle related ones as well where relationship between the two has been clearly defined that is not the case here. You have a one to many relationship between the Content and Header class but your bind says Header.Name - this is not correct. The reference would look something like Header.GetAt(x).Name. You have not bound the Header object so we are not creating a new record regardless of whether you could provide the x and get access to an existing. A better approach is a form for modifying the Header where you make certain to provide a cspbind property on the Content "One" object. We can generate code to handle that. You could write your own logic for saving/retrieving data from this page and still implement this with CSP. We simply can't generate a binding for it.


Dipl.-Ing. Werner Riegler wrote:
hi there again,

can anybody tell me if it should work
to create and save referenced objects within the same form as the object
itself ?

i use a standard wizard generated form - but it does not seam to work ?
(no error - but noting created)

 Class EMEM.Content Extends EMEM.NLSObject [ ClassType = persistent,
ProcedureBlock ]
{
Relationship Body As EMEM.ContentBody [ Cardinality = one, Inverse =
Content ];
Relationship Campaigns As EMEM.CampaignContents [ Cardinality = many,
Inverse = Contents ];
Relationship Footer As EMEM.ContentFooter [ Cardinality = one, Inverse =
Content ];
Relationship Header As EMEM.ContentHeader [ Cardinality = one, Inverse =
Content ];
Relationship SubContent As EMEM.SubContent [ Cardinality = many, Inverse =
Content ];
Query ContentList() As %SQLQuery(CONTAINID = 1)
{
SELECT %ID,NameDe FROM Content ORDER BY NameDe
}
Index BodyIndex On Body;
Index FooterIndex On Footer;
Index HeaderIndex On Header;
}

just try to create/save Content and Header (Property Name for Header):

 <!-- use CSP:OBJECT tag to create a reference to an instance of the
class -->
<csp:object name="objForm" classname="EMEM.Content"
OBJID=#(%request.Get("OBJID"))#>
<!-- use csp:search tag to create a javascript function to invoke a search
page -->
<csp:search name="form_search" classname="EMEM.Content" where="NameDe"
options="popup,nopredicates" onselect="update">
<form name="form" cspbind="objForm" cspjs="All" onsubmit='return
form_validate();'>
 <center>
<table cellpadding="3">
 <tr>
<td><b><div align="right">NameDe:</div></b></td>
<td><input type="text" name="NameDe" cspbind="NameDe" size="80"></td>
</tr>
<tr>
<td><b><div align="right">DescriptionDe:</div></b></td>
<td><input type="text" name="DescriptionDe" cspbind="DescriptionDe"
size="80"></td>
</tr>
<tr>
<td><font color="#666666"><b><div align="right">Header
Name:</div></b></font></td>
<td><input type="text" name="HeaderName" cspbind="Header.Name" size="80"

</td>

</tr> </table> </center> </form>


or do I need to modify or create my own form_save method to achive this ?

brg
werner





Reply via email to