tag:blogger.com,1999:blog-5874979429188093780.post3625250347114216458..comments2024-03-18T06:46:54.352+01:00Comments on Andrej Baranovskij Blog: Tree Table Component in Oracle ADFAndrej Baranovskijhttp://www.blogger.com/profile/04468230464412457426noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-5874979429188093780.post-43764974282886961942017-01-17T15:31:24.729+01:002017-01-17T15:31:24.729+01:00Hello, the new versions of jdeveloper (12.1.3), va...Hello, the new versions of jdeveloper (12.1.3), variable #{node} doesn't show the attributes of table child. How I can show the values of table child into the af:columns like your example with new versions of jdeveloper?<br /><br />Thanks an regards.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-9584277463012902732016-10-02T12:41:21.307+02:002016-10-02T12:41:21.307+02:00I have changed download URL, try now - should be w...I have changed download URL, try now - should be working.<br /><br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-45268265965573078112016-09-30T18:24:47.480+02:002016-09-30T18:24:47.480+02:00Thanks for the article.
The sample code is not ava...Thanks for the article.<br />The sample code is not available: http://jdevsamples.googlecode.com/files/TreeComponents.zip yields an error 404<br />Is there a place where I can get this code?<br />Thanks in advancerubeckhttps://www.blogger.com/profile/16404101419237699062noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-45199915907980066992016-02-26T16:33:03.495+01:002016-02-26T16:33:03.495+01:00Tree table using ADF Read Only View ObjectsTree table using ADF Read Only View ObjectsAnonymoushttps://www.blogger.com/profile/03328133012553777137noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-77864207485719963172016-02-26T15:53:59.698+01:002016-02-26T15:53:59.698+01:00Hi Andrejus,
I am trying to form a tree table bas...Hi Andrejus,<br /><br />I am trying to form a tree table based on read only view object where query return data as below<br /><br />Employee-ID-1 FirstName1 LastName1 Document1<br />Employee-ID-1 FirstName1 LastName1 Document2<br />Employee-ID-2 FirstName2 LastName2 Document3<br />Employee-ID-2 FirstName2 LastName2 Document4<br />Employee-ID-3 FirstName3 LastName3 Document5<br />Employee-ID-3 FirstName3 LastName3 Document6<br /><br />In tree table we would like to display as below<br /><br />Employee-ID-1 FirstName1 LastName1 <br /> Document1<br /> Document2<br />Employee-ID-2 FirstName2 LastName2<br /> Document3<br /> Document4<br />Employee-ID-3 FirstName3 LastName3<br /> Document5<br /> Document6<br /><br /><br />Question: Can we achieve this tree table from Read Only View Object?<br /><br />Thanks in advance.<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-35575951354979943382015-12-18T12:11:43.354+01:002015-12-18T12:11:43.354+01:00Is it possible to get the Master table in editable...Is it possible to get the Master table in editable mode. I have a requirement where I need to show Department(Master) -> employee(Details) in tree table but I want Department attributes to be editable. Is this possible using af:treeTable?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-75679358012183193872014-09-06T15:08:26.951+02:002014-09-06T15:08:26.951+02:00Your able is still based on ADF BC? May be try to ...Your able is still based on ADF BC? May be try to use Retain View Link Accessor option for VO tuning.<br /><br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-77172816352080611282014-09-05T21:41:10.270+02:002014-09-05T21:41:10.270+02:00Our app has a large af:tree component. It was bou...Our app has a large af:tree component. It was bound to backing bean in pageflowscope. Realizing that's it's not good to bind components to anything longer than requestScope I changed the binding to use ComponentReference as specified by best practices. This broke our desired behavior for when we navigate from tree to page that edits' the node, then back to the tree. The disclosed state is not being remembered anymore. How do I restore the tree state so that all disclosed rows remain disclosed when navigating away and then back?Don Kleppingerhttps://www.blogger.com/profile/02266023115878336856noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-55672070971440137702013-08-01T11:22:39.936+02:002013-08-01T11:22:39.936+02:00hi , i have a scenario where i am using check boxe...hi , i have a scenario where i am using check boxes to select detail part of tree<br />and on a button click i have to get all checked rows<br />how can i do this?Ashish Awasthihttps://www.blogger.com/profile/12262246262095913627noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-62814142798713052762012-11-29T01:04:08.573+01:002012-11-29T01:04:08.573+01:00Hello, i'm trying to add a child node with a b...Hello, i'm trying to add a child node with a button, the idea is that when i click Add in the current node, i need to add a child on the tree table, i've tried catching the current node and creating a row with the parent values, and it works but it adds to the tree table 2 rows, one at the level required and one more at the principal parent node, any suggest? Anonymoushttps://www.blogger.com/profile/06345750367210998290noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-57960051757064179592012-06-25T21:18:13.493+02:002012-06-25T21:18:13.493+02:00Hi Andrejus,
I have created two programmatic VOs ...Hi Andrejus,<br /><br />I have created two programmatic VOs with parent child relationship.There are no entity objects as my data is coming from web-service. <br /><br />I am able to display master detail relationship using ADF tables but when I am using ADF tree, only parent elements are populated.<br /><br />Do we need some extra work for Trees for programmatic VO?<br /><br />Thanks,<br />MinalAnonymoushttps://www.blogger.com/profile/02145979438680898323noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-50440049340036505312012-06-08T08:05:18.797+02:002012-06-08T08:05:18.797+02:00Andrejus,
Please suggest is anything that I can do...Andrejus,<br />Please suggest is anything that I can do for this?<br /><br />1. <br />In each row of the tree table I have few links that show additional data. When I click on these links the size of the row is getting expanded, I mean the height of the row gets increased and this results in last row getting shrinked. I am seeing this issue only when I try to refresh particular component in a row and not the whole tree table. <br />Code: My tree table is having following structure...<br /><br /><br /> inside center facet.<br /><br />2. In the popup if I scroll the tree table till the last row and close the popup and open again it is not showing from the first row it opens the poup which will show the last few rows and user has to use the scroll bar to move up.<br /><br />Thanks,<br />RavindraRavindranathhttps://www.blogger.com/profile/15466845743485869560noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-88284111366913403532012-05-28T13:38:24.232+02:002012-05-28T13:38:24.232+02:00Hi,
I see this is complex case, I can't give ...Hi,<br /><br />I see this is complex case, I can't give advice my comment. Proper advice would require work on your code...<br /><br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-46807145117360169512012-05-28T13:33:54.619+02:002012-05-28T13:33:54.619+02:00Andrejus,
If I set that flag I could not able to s...Andrejus,<br />If I set that flag I could not able to see Comments and Bugs i.e. the VO iterator's that I fetch for each row.<br /><br />Thanks,<br />RavindraRavindranathhttps://www.blogger.com/profile/15466845743485869560noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-57662015816602612672012-05-28T13:15:12.196+02:002012-05-28T13:15:12.196+02:00Hi,
You can try to see if this hint will help you...Hi,<br /><br />You can try to see if this hint will help you:<br /><br />http://andrejusb.blogspot.com/2011/12/tuning-adf-tree-retain-view-link.html<br /><br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-44389868897241092462012-05-28T13:07:34.170+02:002012-05-28T13:07:34.170+02:00In addition to my previous comment on performance ...In addition to my previous comment on performance issue...<br /><br />Based on the answer selected for the parent question I have to refresh the child questions<br /> Assume that the hierarchy is like this... <br /> Q1 (if answer of the parent question is set to Yes, then I have to show only the questions which are set to Yes. In this case if the parent answer is Yes then I have to show only Q2. If it is No I have to show Q3 and Q4)<br /><br /> - Q2 (Yes)<br /> - Q3 (No)<br /> - Q4 (No)<br /><br /> For this I am handling the logic as below...<br /> 1.If the values are already stored in the database then doing the below logic... <br /> In VOImpl.java<br /> @Override<br /> protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl associationDefImpl,<br /> ViewObjectImpl viewObjectImpl,<br /> Row row,<br /> Object[] object) {<br /> ViewRowSetImpl viewRowSetImpl = super.createViewLinkAccessorRS(associationDefImpl, viewObjectImpl,<br /><br /> if (columnName.equalsIgnoreCase("AnswerVO")) {<br /> //We will execute the below logic only if the user has entered an answer<br /> if (isBooleanQts && (answer != null && answer.trim().length() > 0)) {<br /> ViewCriteriaManager vcm = viewObjectImpl.getViewCriteriaManager();<br /> ViewCriteria vc = vcm.getViewCriteria("EnableChildQuestions");<br /> VariableValueManager vvm = vc.ensureVariableManager();<br /> if ("Yes".equalsIgnoreCase(answer)) {<br /> vvm.setVariableValue("answerBind", "Yes");<br /> } else {<br /> vvm.setVariableValue("answerBind", "No");<br /> }<br /> viewObjectImpl.applyViewCriteria(vc);<br /> } else {<br /> viewObjectImpl.removeApplyViewCriteriaName("AnswerChecklistEnableOnParentVOCriteria");<br /> }<br /> }<br /> }<br /> 2. If the values are dynamically by the user then in the value change event I wrote the below logic...<br /> Row currentSelectedRow = found[0];//Get the current selected row<br /> currentSelectedRow.setAttribute("Answer", newValue);<br /> RowSet childAnswerChecklistRowSet = (RowSet)currentSelectedRow.getAttribute("AnswerChecklistVO_2");<br /> if (childAnswerChecklistRowSet != null) {<br /> childAnswerChecklistRowSet.executeQuery();<br /> }<br /> <br /> if (rowDataObj.hasChildren()) {<br /> DCIteratorBinding childIterBinding = rowDataObj.getChildIteratorBinding();<br /> RowSetIterator rowSetIter = childIterBinding.getRowSetIterator();<br /> Row[] rowsArray = rowSetIter.getFilteredRows("EnableOnParentAnswer", newValue.equals("Yes") ?"No" : "Yes");<br /> for (Row row : rowsArray) {<br /> row.removeFromCollection();<br /> }<br /> }<br /><br />Could you please suggest any idea to improve the performance?<br /><br />Thanks,<br />RavindraRavindranathhttps://www.blogger.com/profile/15466845743485869560noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-16462342307856799612012-05-28T13:01:48.194+02:002012-05-28T13:01:48.194+02:00Hi Andrejus,
I am trying to improve the performanc...Hi Andrejus,<br />I am trying to improve the performance of the tree table and facing few issues in doing this...<br />I am using tree table to represent Question - Answer list at different levels and the view link is self referenced. We are showing only one column of the tree table with the following details...<br /><br />Question Desc<br />Answer - this can be text, checkbox, radio - User has the option to enter the answer and save it.<br />User has the provision to enter comments and bugs along with the answer. For this two links are provided Add Bug and Add Comment, when user clicks on Add Comment link is hidden and one text area is shown to the user. <br />If there are any existing comments they will be shown below.<br /><br />Comments and Bugs are separate VO's and they have view link with the QuestionAnswerVO. In the bean class, I wrote the logic to get the RowIterator of the CommentsVO and BugsVO for each question and send it as list to UI.<br /><br />Here are the two performance issues that I am facing...<br />1. When I click on Add Comment sometimes it is taking long time to show the text area to enter the comment. When I click on Add Comment I have PPR to refresh only Add Comment link and text area component. <br />I observed that when I click on Add Comment link it is submitting the whole page and the complete tree table is loaded again and it is taking lot of time for this to complete.<br /><br />Could you please suggest any idea to improve the performance?<br /><br />Thanks,<br />RavindraRavindranathhttps://www.blogger.com/profile/15466845743485869560noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-69881480827245417472012-05-21T13:01:39.224+02:002012-05-21T13:01:39.224+02:00Your approach is wrong - it will be performance ki...Your approach is wrong - it will be performance killer.<br /><br />You should search directly inside table, construct node key and disclose it. Dont search through ADF Tree directly - this is my advice.<br /><br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-52664812465218312862012-05-21T12:57:51.852+02:002012-05-21T12:57:51.852+02:00In continuation to above Search on Tree Table not ...In continuation to above Search on Tree Table not working as expected....<br /><br />Solution: <br /><br />After changing the RangeSize on ViewObject from 25 to 100, it worked.<br /><br />As there are more than 25 nodes under the root, it picked up the next 25 from current selection.Srinihttps://www.blogger.com/profile/02635740797952123636noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-55096721858264726252012-05-20T16:21:42.019+02:002012-05-20T16:21:42.019+02:00In continuation to the above comment: Search on Tr...In continuation to the above comment: Search on Tree Table is not worknig as expected.<br /><br />The problem is "The child nodes iterator get set to last search node or something". The below method is setting that it seems:<br /> private RowKeySet buildDisclosedRowKeySet(JUCtrlHierBinding treeBinding,<br /> RowKeySet keys) {<br /> <br /> RowKeySetImpl discloseRowKeyset = new RowKeySetImpl();<br /> <br /> Iterator iter = keys.iterator();<br /> <br /> while(iter.hasNext()) {<br /> <br /> <br /> List keyPath = (List)iter.next();<br /> JUCtrlHierNodeBinding node = <br /> treeBinding.findNodeByKeyPath(keyPath);<br /> <br /> if (node != null && node.getParent() != null &&<br /> !node.getParent().getKeyPath().isEmpty()) {<br /> <br /> discloseRowKeyset.add(node.getParent().getKeyPath());<br /> <br /> RowKeySetImpl parentKeySet = new RowKeySetImpl();<br /> parentKeySet.add(node.getParent().getKeyPath());<br /> <br /> RowKeySet rks = buildDisclosedRowKeySet(treeBinding, parentKeySet);<br /> discloseRowKeyset.addAll(rks);<br /> }<br /> <br /> <br /> }<br /> <br /> return discloseRowKeyset;<br /> <br /> } <br /><br /><br />Can you please suggest how to resolve this?Srinihttps://www.blogger.com/profile/02635740797952123636noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-7783341271171587552012-05-19T04:26:03.137+02:002012-05-19T04:26:03.137+02:00Hi,
Search on Table Tree View is not working as ex...Hi,<br />Search on Table Tree View is not working as expected.<br /><br />I'm working on a Table Tree View, and am facing some strange problem.<br /><br />Lets say the Tree view is as follows. FetchSIze is 1000.<br /><br />Case#1 Search Box: XA -> ENTER<br /><br />A<br /> XA<br /> XB<br /> XC <br />B<br /><br />C<br /><br />D<br /><br /><br />E<br /><br />It works fine, it starts search from A and goes fine.<br /><br />Case#2: Search Box: XA -> ENTER<br /><br />If Search for same thing again, it starts search from B or C, not from A.<br /><br />Code for the same:<br /><br /> <br /> CollectionModel model = (CollectionModel) tree1.getValue();<br /> treeBinding = (JUCtrlHierBinding) model.getWrappedData();<br /> JUCtrlHierNodeBinding root = treeBinding.getRootNodeBinding();<br /><br /> Found = false;<br /> RowKeySet resultRowKeySet = <br /> searchTreeNode(root, searchType, searchString);<br /> RowKeySet disclosedRowKeySet =<br /> buildDisclosedRowKeySet(treeBinding, resultRowKeySet); <br /> <br /> <br /> tree1.setSelectedRowKeys(resultRowKeySet);<br /> tree1.setDisclosedRowKeys(disclosedRowKeySet);<br /> <br /> AdfFacesContext.getCurrentInstance().addPartialTarget(tree1);<br /> <br /> private RowKeySet searchTreeNode(JUCtrlHierNodeBinding node,<br /> String searchType, <br /> String searchString) {<br /> <br /> RowKeySetImpl rowKeys = new RowKeySetImpl();<br /> <br /> if (Found == true) {<br /> return rowKeys; <br /> }<br /> <br /> Row nodeRow = node.getRow();<br /> if (nodeRow != null) {<br /> String compareString = "";<br /> <br /> Object attribute = nodeRow.getAttribute("ATTRIBUTENAME");<br /> if (attribute instanceof String) {<br /> compareString = (String)attribute; <br /> } else {<br /> compareString = attribute.toString();<br /> }<br /> <br /> if (compareString.equals(searchString) {<br /> <br /> rowKeys.add(node.getKeyPath()); <br /> Found = true;<br /> }<br /> }<br /> <br /> If (FOUND = false) {<br /> List children = node.getChildren();<br /> <br /> if (children != null ) {<br /> <br /> for(JUCtrlHierNodeBinding _node: children) {<br /> RowKeySet rks = searchTreeNode(_node, searchType, searchString);<br /> if (rks != null && rks.size() > 0) {<br /> rowKeys.addAll(rks);<br /> }<br /> <br /> }<br /> <br /> } <br /> }<br /><br /> <br /> return rowKeys; <br /> <br /> }<br /><br />It seems like Children cursor is set to an index, may be I need to reset it<br /><br />Please suggest.Srinihttps://www.blogger.com/profile/02635740797952123636noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-77580191026492795932011-11-28T09:02:12.879+01:002011-11-28T09:02:12.879+01:00Hi,
I need to create tree from this kind of data....Hi,<br /><br />I need to create tree from this kind of data.<br /><br />col1 col2 col3 col4<br />---------------------------------<br />A1 B1 C1 D1<br />A1 B1 C1 D2<br />A1 B1 C2 D3<br /><br /><br />I want to display the tree as :<br /><br />A1<br />---->B1<br />--------->C1<br />-------------->D1<br />-------------->D2<br />--------->C2<br />-------------->D3<br /><br />I dont have parentid, child_id kind of relationship in the table, so cannot create a self accessor view link.<br />How can I do that? Please help.<br /><br />Thanks,<br />Sachinsachinhttps://www.blogger.com/profile/07154766852187089936noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-22071194599645583992011-11-15T13:43:00.301+01:002011-11-15T13:43:00.301+01:00Hello Andrejus, thanks for the post.
I would like ...Hello Andrejus, thanks for the post.<br />I would like to know if you could show us how to use the treetable together with a separate table, to represent a Master-Detail-Detail three-level relationship. In this case I am facing the same problem as Harleen, that is: "The detail table does not work. It defaults to the first value. And does not even change when I click on something on the tree. (I do have partial Trigger).<br />Weird thing is my AppModule works fine so I know the logic with the view links works okay."<br />Is there a way to fix the behaviour on the UI side by using bindings properly?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-61424207374862901112011-10-31T10:56:28.425+01:002011-10-31T10:56:28.425+01:00Hi,
Probably you would need to override VO Impl c...Hi,<br /><br />Probably you would need to override VO Impl class, and work with rowset. Not AM Impl class.<br /><br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-5449161006780680632011-10-31T07:32:58.395+01:002011-10-31T07:32:58.395+01:00Hi Andrejus,
I am working on ADF tree and have co...Hi Andrejus,<br /><br />I am working on ADF tree and have come across a issue. I am populating my tree with ADFBC. The tree is of two level. The root level is the rows of the view object MenuTableView and the second level values are populated from SubMenuVO. The views have parent child relationship.<br /><br />I want to manipulate the rows before they are rendered as trees. By manipulation I mean I might delete some of the rows based on user permission before they are rendered as a tree. What is the best way to do this?<br /><br />How does a adf tree calls the AM & VO classes? I just added this code in my AM but I dont get any sysout? Seems the AM methods are not called by the tree except the constructor.<br /><br />public class MenuAMImpl extends ApplicationModuleImpl {<br /> /**<br /> * This is the default constructor (do not remove).<br /> */<br /> public MenuAMImpl() {<br /> System.out.println("MenuAMImpl instantiated");<br /> }<br /> <br /> public static void main(String arg[]){<br /> new MenuAMImpl().getMenuTableView1();<br /> }<br /> <br /> /**<br /> * Container's getter for MenuTableView1.<br /> * @return MenuTableView1<br /> */<br /> public MenuTableViewImpl getMenuTableView1() {<br /> System.out.println("--- Inside getMenuTableView method of AM ---");<br /> ApplicationModule am=Configuration.createRootApplicationModule("model.am.MenuAM", "MenuAM");<br /> MenuTableViewImpl menuView=(MenuTableViewImpl)am.findViewObject("MenuTableView1");<br /> <br /> //RowSetIterator iter=menuView.getRowSet();<br /> while(menuView.hasNext()){<br /> MenuTableViewRowImpl mainRow= (MenuTableViewRowImpl)menuView.next();<br /> System.out.println("-- AM - parent row-"+mainRow.getPermissionExp()); <br /> System.out.println("-- AM - parent row-"+mainRow.getMenuDisplayName());<br /> SubMenuVOImpl submenuView=(SubMenuVOImpl)mainRow.getSubMenuVO(); <br /> while(submenuView.hasNext()){<br /> SubMenuVORowImpl childRow=(SubMenuVORowImpl)submenuView.next();<br /> System.out.println("-- AM - child row-"+childRow.getPermissionExp()); <br /> System.out.println("-- AM - child row-"+childRow.getMenuDisplayName());<br /> }<br /> }<br /> return menuView;<br /> }<br /><br /> /**<br /> * Container's getter for SubMenuVO1.<br /> * @return SubMenuVO1<br /> */<br /> public SubMenuVOImpl getSubMenuVO1() {<br /> return (SubMenuVOImpl)findViewObject("SubMenuVO1");<br /> }<br /><br /> /**<br /> * Container's getter for ParentChild1.<br /> * @return ParentChild1<br /> */<br /> public ViewLinkImpl getParentChild1() {<br /> return (ViewLinkImpl)findViewLink("ParentChild1");<br /> }<br /><br /> <br />}<br /><br />The idea is to eliminate the rows at either parent or child here istelf , I mean the AM. but seems the VO's are getting called by some other method and not getter methods of AM? How the the VO's getting called in case of tree?Tariquenoreply@blogger.com