Saturday, February 25, 2017

Programmatically Component Creation in ADF

Programmatically component creation and applying skining and validation on component programmatically.
          

  1. Create fusion ADF application and in view controller create page    
  2. Find a parent component to create child under it as any layout (panel form, panel group, af:form etc)
  3. Suppose you have a page with a panel form layout, now you have to create child components in this form layout at runtime   
  4. Dropped a button on page , on this button action i will create an inputText                                    programmatically and assign validator method reference to it.
  5. Create mananege bean class.
  6. Bind the form component value with manage bean .


     <af:panelFormLayout id="pfl1" binding="#{pageFlowScope.ProgramComponent.panelForm}">
                    <f:facet name="footer"/>
                </af:panelFormLayout>
    binding with panelForm:


                  























         add component method which help in adding component under the parent layout.


     

creating object of component and setting properties and calling add component .





create one helper method to resolve Validator 





and now add the validator into the input component 

ui.setValidator( resolveValidator("{pageFlowScope.ProgramComponent.inputValidator}"));















Thanks to ashish





No comments:

Post a Comment