In the project tracker app I see where some bo's props are set in the RunLocal DataPortas create method. Specifically it sets the guid id. I want to set some default values, and when stepping through the code I see these private variables are set correctly. What I want to do, is display this new object with its default values, where the user can override the defaults by simply entering different data. For example, say country = "USA";
My problem is even though the Create code runs, I cannot figure out how to display the input fields with the default values. Instead I get empty text boxes. How would you display the guid in project tracker when the user click on Add Project. Thats all I need to know how to do. Help is greatly appreciated.
Don
code snippets:
private void DataPortal_Create(Criteria criteria){
Ss_Type =
"S";military =
"N";indep_Contr =
"N";benefit_Opt = 11;
ValidationRules.CheckRules();
}
// want to add the code that will create NewEmp(); and bind this new emp object to DetailViews1.
protected void AddRoleButton_Click(object sender, EventArgs e)
{
this.DetailsView1.DefaultMode = DetailsViewMode.Insert;
MultiView1.ActiveViewIndex = (int)Views.InsertView;
}
Dont know what I need, databind detailsView1?? Map from the new object but to what??? any help is greatly appreciated.
thanks
Don
Hi Don,
If I understand you correctly, you can just create a datasource from your object and drag that datasource, or individual properties onto your form. Is that what you're looking for?
Mike
I am looking for what it would take to modify the project tracker application so that the guid id assigned in the create method of the (bo project's with - Run Local attribute ) data portal would be be initially displayed as a default value of a new project, where a user could either accept or override this default id value. As it is right now the guid id is generated in the background and only becomes visible once the project has been inserted (ie in its editable state). Please let me know if this is still unclear, or if this is in fact possible.
Thanks
Don
Yes thats the problem. I see the default values created when instantiating a new object, but they are not displayed on the details view (insert mode). Instead I have empty text boxes, even for those properties where default values were created. Thanks for trying to help me with this! All help is greatly appreciated.
Don
What is the binding source component?? And how does it work?? I read through all posts concerning Data Portal Create, and cannot seem to find the post you are referring to. Thats why I posed the question regarding Project Tracker to simply display the Guid that is created for the new object. Unfortunately still lost on this topic. Will search Binding Source Component and hope for a good example.
thx
Don
I am using the Csla DataSource object to bind my web form to the bo. It just seems that it will not display the default values instantiated in the DataPortal.Create Method. I even tried (DetailsView1.DataBind()) after stepping through the code I saw it 1) set the default props 2) when I subsequently called DetailsView1.DataBind() - the details view still left me with blank input text boxes. Is the "Csla Data Source" the binding source component that you are referring too? If so, I am already using this control.
Don
I am using the select object correctly in my code. The problem stems from the Insert part of the data source. Let me elaborate, that the insert does work properly when I fill in the form and press the insert button. BUT the PROBLEM is not showing the default values on the initial Insert View. Maybe its not even possible to display the default properties in an insert view???? This does seem rather odd? Especially since, it would be nice to decouple the UI from the BO's (IE, setting controls in the Web Form to Default values, that I would much rather retrieve from the BO, thereby decoupling the UI from the BO. Hope this makes sense, still do not know how to display the default values that are assigned in the DataPortal.Create Method. Has anyone, displayed default properties of a BO to simplify a record insertion????? Please help.
Thx Don
Copyright (c) Marimer LLC