Skip to main content

Posts

Showing posts from October, 2010

ADF Exact custom filters

Step 1) Add your custom filter to the column filter facet. <f:facet name="filter"> <af:selectBooleanCheckbox value="#{backingBean.customfilter}" id="id99"/> </f:facet> Step 2) Create the getters and setters in your backing bean public Boolean getCustomfilter(){ Boolean returnobj = null; Object filterValue = super.getFilterValue("AttributeName"); if (filterValue != null){ returnobj = ("Y".equalsIgnoreCase(filterValue.toString())) ? Boolean.TRUE : Boolean.FALSE; } return returnobj; } public void setCustomfilter(Boolean deletefilter){ String value = filter == null ? null : (deletefilter) ? "Y" : "N"; super.setFilterValue(value, "AttributeName"); } NOTE: Dates Filtered Dates with timestamps in ADF dont work very nicely if you just want to filter by date. So your can modify the date f...

ADF VO criteria performance problem

One of our screens backed by a huge table was slow. (+1 10 seconds just for the query alone). And here is what I found out: Our query with a criteria to filter the tablename and key SELECT a.ele_name AS ELEMENT_NAME, a.pk AS PKEY, a.audit_result AS AUDIT_RESULT FROM audit a, mds_users u WHERE a.user = u.code AND a.ele_name = :tablename AND a.pk = :key ADF converted query 12 seconds looks something like this: SELECT * FROM (SELECT a.ele_name AS ELEMENT_NAME, a.pk AS PKEY, a.audit_result AS AUDIT_RESULT FROM audit a, users u WHERE a.user = u.code) QRSLT WHERE ( ( ( (UPPER(PKEY) = UPPER(:key) ) AND (UPPER(ELEMENT_NAME) = UPPER(:tablename) )) ) ) ORDER BY AUDIT_DATE DESC So I remove the UPPER from the query and all was good. Note to self always check this or you will suffer. (Ignore case check box in the criteria if you are looking for this)

Auto Submit button for page fragements

If your region is encased in a form you will have no access to the defaultCommand on your af:form. Try adding a subform to your fragement (jsff) and use its defaultCommand - note this will affect your naming. This should also work for popup buttons. ie. after your <jsp:root <af:subform defaultCommand="submitButton" id="s3">    ... your code </af:subform>

ADF tree menu code

We have a tree menu that works of a hierarchical structure in the DB. Note you must have seperate iterators for the tree and the view. It will disclose and select an item in your tree based on a selection. This can be modified in various ways to get your trees jumping through hoops. So here is the code so I dont loose it: <af:tree value="#{bindings.TreeRootMenuVO2.treeModel}" var="node" selectionListener="#{pageFlowScope.TreeBean.selectionListener}" rowSelection="single" id="t1" binding="#{pageFlowScope.TreeBean.menuTree}" contentDelivery="immediate" fetchSize="500"> <f:facet name="nodeStamp"> <af:outputText value="#{node}" id="ot1"/> </f:facet> </af:tree> <af:commandToolbarButton text="Find Node" id="cb5" actionListener="#{pageFlowScope.TreeBean.findInTree}"/> <af:commandToo...

Traversing a hierarchical oracle tree in SQL backwards

So I have a menu table with a parent child relationship menu_id, menu_name, parent_id and I want to retrieve the whole branch that Menu Child E is in. ie all its ancestors. The result should be ordered from the root. So given: Root (id:0 parent_id: null) Menu Parent A(id:1 parent_id: 0) Menu Child B(id:2 parent_id: 1) Menu Parent C(id:3 parent_id: 0) Menu Child D(id:4 parent_id: 3) Menu Child E(id:5 parent_id: 3) I want: Root (id:0 parent_id: null) Menu Parent C(id:3 parent_id: 0) Menu Child E(id:5 parent_id: 3) select m.menu_id, m.menu_name, m.parent_id from MENU m start with m.menu_id = 5 connect by prior m.parent_id = m.menu_id ORDER BY LEVEL DESC;

The DocumentChange is not configured to be allowed for the component:

<FilteredPersistenceChangeManager><_addDocumentChangeImpl> The DocumentChange is not configured to be allowed for the component: RichTable[org.apache.myfaces.trinidad.component.UIXTable$RowKeyFacesBeanWrapper@fdf42c, id=audTab] This is what I understand this message to mean: If MDS is configured a request is send to the FilteredPersistenceChangeManager wich then does a check to see if the component is configured. If the change is not configured then the change will then be written to the users session and you will get the above message in your logs. To configure the MDS stuff in your adf application : 1) Open adf-config.xml - located in Application Resources < ADF META-INF dir. 2) On the View tab click the green plus button and select the component that the error is complaining about. 3) Configure as needed.