locked
RCDC Dynamic Required Flag RRS feed

  • Question

  • I have a tab containing some Boolean flags such as RequestEmail, RequestHomeDirectory etc. Some of the flags, such as RequestEmail, have secondary controls that need to be populated if the primary control has been checked.

    For example, if RequestEmail is selected, I need the user to select a location from a drop down list (the location will drive the email suffix assigned to the user by Exchange). If RequestEmail is not checked, the selection in the drop down list can remain blank.

    I have the value of the Required flag for the OfficeLocation drop down list toggled based on the value of the RequestEmail control as shown below:

    <my:Control my:Name="RequestEmail" my:TypeName="UocCheckBox" my:Caption="{Binding Source=schema, Path=RequestEmail.DisplayName}" my:Description="{Binding Source=schema, Path=RequestEmail.Description}" my:RightsLevel="{Binding Source=rights, Path=RequestEmail}"  my:AutoPostback="true">
      <my:Properties>
        <my:Property my:Name="Text" my:Value="Enable if a mailbox is required" />
        <my:Property my:Name="Checked" my:Value="{Binding Source=object, Path=RequestEmail, Mode=TwoWay}" />
        </my:Properties>
    </my:Control>
    <my:Control my:Name="OfficeLocation" my:TypeName="UocDropDownList" my:Caption="{Binding Source=schema, Path=OfficeLocation.DisplayName}" my:Description="{Binding Source=schema, Path=OfficeLocation.Description}"  my:RightsLevel="{Binding Source=rights, Path=OfficeLocation}">
      <my:Options>
        <my:Option my:Value="Aberdeen" my:Caption="Aberdeen" my:Hint="Aberdeen" />
        <my:Option my:Value="Belfast" my:Caption="Belfast" my:Hint="Belfast" />
        <my:Option my:Value="Cardiff" my:Caption="Cardiff" my:Hint="Cardiff" />
        <my:Option my:Value="Derby" my:Caption="Derby" my:Hint="Derby" />
        <my:Option my:Value="Edinburgh" my:Caption="Edinburgh" my:Hint="Edinburgh" />
        <my:Option my:Value="Leeds" my:Caption="Leeds" my:Hint="Leeds" />
        <my:Option my:Value="Oxford" my:Caption="Oxford" my:Hint="Oxford" />
      </my:Options>
      <my:Properties>
        <my:Property my:Name="Required" my:Value="{Binding Source=object, Path=RequestEmail, Mode=TwoWay}" />
        <my:Property my:Name="ItemSource" my:Value="Custom" />
        <my:Property my:Name="ValuePath" my:Value="Value" />
        <my:Property my:Name="CaptionPath" my:Value="Caption" />
        <my:Property my:Name="HintPath" my:Value="Hint" />
        <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=OfficeLocation, Mode=TwoWay}" />
      </my:Properties>
    </my:Control>

    A previous process ensures that the initial value of RequestEmail is true, while the initial value of OfficeLocation will not have been assigned any value.

    If I submit the page when nothing has been selected in the drop down list, the message 'The required field cannot be empty' is displayed, which is exactly what I want. However, if I then clear the RequestEmail flag, which also makes the red asterisk at the side of the drop down list (indicating that input is required) disappear and submit the page, I am still prompted by the message 'The required field cannot be empty'. It seems that once the page has been submitted when the drop down list was required, this setting is remembered and isn't updated when I clear RequestEmail, even though the value of the Required flag seems to be toggled correctly, as evidenced by the disappearance of the red asterisk on the drop down list indicating input is no longer mandatory.

    Is there a way to get the RCDC to behave in the way that I need, or am I battling in vain against a 'feature'?!

    Sunday, June 22, 2014 2:32 PM

All replies

  • Hello,

    there is an optional parameter in RCDCs which posts the change of an attribute directly back to the server.

    Called: AutoPostback

    This is used in default group RCDC when clicking on the Email Enableing function of groups.

    See this article on how to use it:

    http://identityminded.wordpress.com/2011/10/14/fim2010-semi-dynamic-rcdc-operations/

    I used this by myself for my own Password Reset function, that shows a new password field only if the "Do PW Reset" checkbox is enabled. But i did not use this for the required field currently.

    Regards
    Peter


    Peter Stapf - Doeres AG - My blog: JustIDM.wordpress.com

    Monday, June 23, 2014 12:52 PM
  • Thanks, Peter.

    I have AutoPostback enabled on the RequestEmail checkbox control, which is definitely affecting the Required property of the OfficeLocation drop down list, as the red asterisk indicating mandatory field input appears and disappears each time I check/uncheck RequestEmail.

    The problem seems to be the fact that once the form has been submitted and the error 'The required field cannot be empty' is displayed, the value of the Required property is 'remembered' somewhere, so no matter if RequestEmail is checked or unchecked, the RCDC believes that OfficeLocation is mandatory.

    To me, it just seems that FIM is broken in this respect, unless you can spot something in the RCDC snippet in the original post that is preventing this from working as I think it should.

    Wednesday, June 25, 2014 8:45 AM
  • Steven,

    Make sure that this attribute is not marked as required in binding and in attribute itself. In FIM Service's schema...


    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer.


    Wednesday, June 25, 2014 9:55 AM
  • Thanks, Dominik.

    I can confirm that the binding for OfficeLocation is not marked as Required. There is no Required property on an AttributeTypeDescription, so the OfficeLocation attribute itself cannot be marked as Required.

    Do you believe that what I'm trying to do should work?

    Thursday, June 26, 2014 7:11 AM