Step1: Setting up Database Objects
Figure 1: Datbase Details
Step 2: Creating EntityObjects, ViewObjects, ViewLinks
Step 2.1 Create Entity Objects (JavaTopicEntityObject, TopicDetailsEntityObject)
Create Entity Objects for JAVATOPIC database table.
Create Entity Objects for JAVA_TOPIC_DETAILS database table.
Step 2.2: Create View Objects (JavaTopicEntityObjectView, TopicDetailsEntityObjectView)
Create View object for JavaTopicEntityObject
Figure 4: Create View for JavaTopicEntityObject
Create view object for TopicDetailsEntityObject
Figure 5: Create TopicDetailsEntityObjectView view object
Step 2.3 Create ViewLink
We can create a view link between two created views shown in step 2.2. Corresponding query will be
Select b.sub1 from JAVATOPIC a, java_topic_details b where a.topicindex = b.topicindex and a.topicindex = :topicindex
Step 3: Wrap ViewObjects and ViewLinks in ApplicationModule
Step 4: Create a Popup and attach it with CommandLink
- <af:popup id ="trainpopup"> //Add contents here </af:popup> //Step 4.2 Attach a Command Link with a PopUp
- <af:commandLink text ="Training Contents" binding ="#{TrainingFeedbackBean.showContent}">
- <af:showPopupBehavior popupId ="trainpopup" align ="afterStart"/>
- </af:commandLink>
Tree Model for Source Data
Figure 6: Create ADF Binding Tree
Tree Model for Target Data
- <tree IterBinding ="JavaTopicEntityObjectView2Iterator" id ="JavaTopicEntityObjectView2"> //Parent Node Definition
- <nodeDefinition DefName ="com.emerson.javatraining.model.view.JavaTopicEntityObjectView" Name ="JavaTopicEntityObjectView20">
- <AttrNames>
- <Item Value ="Topicname"/>
- </AttrNames>
- <Accessors>
- <Item Value ="TopicDetailsEntityObjectView"/>
- </Accessors>
- </nodeDefinition> //Child Node Definition
- <nodeDefinition DefName = "com.emerson.javatraining.model.view.TopicDetailsEntityObjectView" Name ="JavaTopicEntityObjectView21">
- <AttrNames>
- <Item Value ="Sub1"/>
- </AttrNames>
- </nodeDefinition>
- </tree>
Step 6: Use Tree Binding in Popup
- <af:popup id ="trainpopup">
- <af:dialog okVisible ="false" cancelVisible ="false">
- <af:panelHeader text ="Training Contents" inlineStyle ="height:379px;width:400px;">
- <af:tree value ="#{bindings.JavaTopicEntityObjectView2.treeModel}"
- var ="node" selectionListener ="#{bindings.JavaTopicEntityObjectView2.treeModel.makeCurrent}"
- rowSelection ="single" id ="t1" visible ="true">
- <f:facet name ="nodeStamp">
- <af:outputText value ="#{node}" id ="ot1"/>
- <f:facet>
- </af:tree>
- </af:panelHeader>
- </af:dialog>
- </af:popup>
Step 7: Output:
Figure 7: View Output
Please try to find similarity between data displayed as child node with Java_topic_details and data displayed as Root node with javatopic database objects (refer figure 1).
No comments:
Post a Comment