Tuesday, September 13, 2011

How to handle userform references and buttons.

How can I reference multiple forms and not have them each include Save/Cancel
buttons?
-->
You should include the noDefaultButtons='true' property in the referenced forms,
and let the parent form handle the button placement. For example: 

            <Form name='Demographics' noDefaultButtons='true'> 
               … 
            </Form> 
  
            <Form name='Role Selection' noDefaultButtons='true'> 
               … 
            </Form> 
  
            <Form name='Authoriztion Info' noDefaultButtons='true'> 
               … 
            </Form> 

Then when you reference it, you would not include noDefaultButtons=’true’ (to
get the buttons automatically placed) or you could include that and place the
buttons manually. Example: 

<Form name='Parent Form'> 
       <FormRef name='Demographics' baseContext='user'/> 
       <FormRef name='Role Selection' baseContext='user'/> 
       <FormRef name='Authoriztion Info' baseContext='user'/> 
</Form> 

If you want to be able to present those inner forms all by themselves unless
they are inside a formref, you will need to set a switch in the outer form: 
      <Field name="variables.user.disableInnerButtons" hidden='true'> 
        <Default> 
          <expression> <s>true</s> </expression> 
        </Default> 
      </Field> 

Then in the inner forms for the button itself you would have a disable setting: 
        <Disable> 
            <notnull> 
                <ref>disableInnerButtons</ref> 
            </notnull> 
        </Disable>

No comments:

Post a Comment