Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Pre-Selection of Custom Attributes
Last Post 08/18/2008 5:24 PM by Peter Donker. 4 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Gaurav Kumar
New Member
New Member
Posts:39


--
07/15/2008 8:09 AM

Hi,

 

Can you tell me why I am facing this issue? I am trying to have custom control i created have value pre-selected so that it is always defaulted to a value for each item i upload. Now when i upload a document i can see on page load the custom control is populated with pre-seleced value apprpriately, but when i move to metedata screen and then PRESS Finish WITHOUT going to Custom screen, the value preselected in Custom control is Never Saved. i checked and found that "WriteToCurrentEntry()" is Never fired if i pressed intermidiate Finish button, is this behaviour intentionally imepemented or am I just the one noticing it?

 

Thanks,
Gaurav.

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
07/18/2008 2:50 PM
Guarav,

The actual 'Finish' is broken into 2 methods:

BeforeSubmit and AfterSubmit. The first one is fired before the Entry is being written to the database, the second after. It was necessary as some custom applications might need to do work on either one. In the latter method you have an EntryId that is set.

The WriteToCurrentEntry is now more of a method to temporarily store what you set as it passes your page.

Peter
Gaurav Kumar
New Member
New Member
Posts:39


--
07/21/2008 3:32 PM

But WriteToCurrentEntry is an overrided method that is used in Custom Controls only, So if I never went to Custom Controls and just clicked Intermediate Finish button then WriteToCurrentEntry will never gets fired. Isn't it?

 

I think i am lost here.

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
07/26/2008 6:15 PM
Hi Guarav,
I'll have to look into this.
Peter
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
08/18/2008 5:24 PM
Guarav,

Before I change anything let me explain the current implementation better:

1. The WriteToCurrentEntry is called when leaving the custom attributes page in the wizard only. This is because during other trips controls will not have all methods called and the data is in general not trustworthy. The method writes to a temporary object kept in viewstate throughout the editing.
2. The Before and AfterSubmit methods are called on the Finish (whether early finish or not). This time we're operating on the real object being added/updated.

In the design I reasoned that we need a vehicle for temporary storage of what we're working on. If you abandon the edit, nothing needs to be undone. During the finish you have a confirmation from the user that you can start writing to the database. So this is why the methods are separate.

Is this something you can live with, or do you need it differently?

Peter
You are not authorized to post a reply.