Workflow Soluiton

 View Only
Expand all | Collapse all

Parent Controls in WF 7.1 SP1

  • 1.  Parent Controls in WF 7.1 SP1

    Posted Jan 19, 2012 06:34 AM

    Dear All,

    Has anyone else got the Parent Controls process working in Workflow 7.1 SP1, as described in this?

    http://www.screencast.com/users/skturnbow/folders/Workflow%20Component%20Videos/media/6c9c7923-f975-4e4e-88f0-cbdc7caccbe1

    I have a similar dropdown on a form and it shows a list of computers in a Complex Data Type.

    I then have another control on the form which shows the total number of software items in each server.

    I have set this up with the two controls upon an Ajax Update Panel, to allow me to update the second control when the first control is changed without showing the post back event (one a list of computers and the other, the number of software items found).

    I have set up the second Text Box control with a Dynamic Model which calculates the number of software items on the server:

    However, the problem seems to be that the calculation never works when I change the dropdown. Debug just shows that the check to see if the ThisFormData.SelectedComputer does not exist.

    Why might this be? I have set the control to send back to the server upon change.

    Kindest regards,

     

    QuietLeni



  • 2.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 19, 2012 10:08 AM

    Dear All,

    Is this functionality broken in WF 7.1 SP1?

    I have tried removing the Ajax Panel and running directly on there, but the only difference seems to be that I see a marginal refresh as I change the values in the Drop Down.

    I am wondering if the ThisFormData.SelectedComputer is not existant for DropDown Text boxes!



  • 3.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 19, 2012 01:09 PM

    I don't think you can refresh data into a text box component the way you described. What you'll have to do is leave the form, set the value to that textbox, and go back in. You can do this by adding a button to leave the form or using some javascript on the drop-down control (don't have it handy at the moment). If you only need to display the item then you can use a AsciiMergeLabelComponent, set the drop-down to do a postback and it should work.



  • 4.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 19, 2012 02:02 PM

    Aryanos,

    Is this special about Text Boxes? What other control might the behaviour work with, then? How could I add the javascript into the dropdown?

    However, this does not explain that the ThisFormData.SelectedComputer cannot be accessed from the Text Box?

    Kindest regards,

    QuietLeni



  • 5.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 20, 2012 08:42 AM

    Aryanos,

    I think that I have partially fixed the issue.

    I ticked the "Always use the initial value" checkbox and the text box started to change. The only problem is that it seems only to update when I press a button on the form...!?



  • 6.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 20, 2012 10:11 AM

    I assume you have checked Post Form On Value Change on changing controls.

    You can more precisely check the behaviour of the dynamic model in TextBox using Create Log Entry component.

    From my experiance it appears that values of configuration fields for web controls are got twice (you will get two log entries) and at first run variables of ThisFormData have correct values but at second some of controls get null as a value of TFD variables!

    I often use a TextExists component to check if the variable is null or empty an to avoid exceptions.



  • 7.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 20, 2012 01:09 PM

    AnaMan,

    Yes, I did set the Post Form On Value Change attribute on the Parent control, but not on the child control. Will changing this on the child help as well?

    Did you mean validation? I am trying to get the Text Box to change when the Dropdown is changed, not when validation is happening. s

    Kindest regards,

    QuietLeni

    ssssDid dpoakdpadokwddqdqwdjsajdadk

    xxxon the on the on fkfkfdssthe dffdfcssdid you meanssqqsqqwqwqs



  • 8.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 23, 2012 03:27 AM

    QuietLeni,

    Setting Post Form On Value Change attribute on the Parent control should be enough.

    Your model looks simply and it should work.

    Maybe you can attach it?

     

    As concerns double execution I mean dynamic models for populating with data fileds like Items or Selected Items.
    I'm not an expert in ASP.NET but Workflow forms as typical ASP.NET web pages handles different events of page lifecycle. It looks like the dynamic model for Items field is called twice in OnPreRender and OnLoadComplete events, the dynamic model for Selected Item is called in OnPreInit and OnPreRender events. The values of the ThisFormData variables can vary in this two calls.



  • 9.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 23, 2012 05:46 AM

    AnaMan,

    This question frustrates me too many times about attaching the model and I have to answer the same - I cannot get development items out through security. Thanks for the thought.

    I have been running the process through Debug and all I can see is that, until I press the "Process" button on the form, the variable ThisFormData.SelectedComputer does not exist when it is going through the setup of the form. To a certain extent, this is not a problem when the form first appears, as the dropdown has a blank value on it and the default value of "0" is valid. However, when the user selects a computer on the form, the Child Control should show a valid value and that is effectively what is seen in the video above.



  • 10.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 23, 2012 08:59 AM

    Dear All,

     

    I have made a simple form to test just the functionality of the form that I am using. A link to it is here.

    As you can see, the form is just the same as the one that Symantec did on the WorkflowSwat website, but the difference is that I have also included the field that shows how many children of the parent there are. In this case, the field only updates if you set the value and then press F5.

    I also included another model that demonstrates a workaround - a Refresh button!!! Eught!

    I believe that this is a bug and should be addressed by Symantec, as there are loads of situations where this functionality is normallyu expected in Workflow-type scenarios.

    Kindest regards,

    QuietLeni



  • 11.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 23, 2012 11:42 AM

    QuietLeni, 

    I did some tests on your model. It seems that TextBox components and its descendants like Numeric Text Box does not support update through the PostBack neither whole form nor using Update Panel!

    I am a bit confused that I didn't notice this earlier.

    I've looked a bit on source code and it looks like the renderer class for TextBox component has no own implementation for OnPreRender event so the Initial Value for this type of components is used only on full form load. That's why refresh seems to work.



  • 12.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 23, 2012 04:37 PM

    All,

    I began working on my first ever worklow project this week and came across this same 'feature'. If there are any workarounds I'd love to know. Rather than dynamically displaying information this way I simply added a gridcontrol as used on workflowswat demo.

    Handling the SelectedIndexChanged event of a dropdownlist object in ASP.NET is pretty common. I would have thought workflow would have had same ability. Certainly makes web form development a different experience.



  • 13.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 24, 2012 10:07 AM

    AnaMan,

    Two things:

    Is this therefore a bug and

    You are consulting the Workflow SOURCE CODE?!?!?!?!?

    The UI for the control looks like you should be able to set the Initial Value via a Dynamic Model. If this is not correct, then it is a bug.

    Kindest regards,

    QuietLeni



  • 14.  RE: Parent Controls in WF 7.1 SP1

    Posted Jan 25, 2012 03:23 AM

    QuietLeni,

    No, I'm not consulting the Workflow source code smiley
    It's a long story. My company has started using the Workflow when it was still belonged to Transparent Logic as LogicBase product. When the changes of the product owner started, first to Altiris, second to Symantec, we had huge problems with support. The available documentation was absolutly not enough (and I think still it isn't) to understand some problems, issues and unexpected behaviours of the components or a workflow engine. So the only way to get to know what is happenning and why it works this way was to analyse source code. Because the workflow is developed in .NET it was not so difficult using .NET Reflector. This was particulary importent for us because we are developing quite a lot our own components. So I've spent weeks analysing for instance how it is possible that one instance of the process can get the TrackingID from another already started. Yes, those were hard times wink

    So now i get used to, when I don't understand why something works this way, using the .NET Reflector and read the source code. Sometimes this much more effective then reading any manual.

    As concerns if this is a bug I'm not sure but absolutely it can be considered to be inconsistent compared to other web components.