gridCells are overlapping in Oracle ADF - oracle-adf

I have a grisRow & within that I have 2 gridCell
In the first one, a description is displayed.
In the second cell, an action icon is displayed.
But the description is touching or overlapping with the icon.
How can I avoid this.
<af:gridCell width="50%" id="gc2" valign="top"
halign="start" marginStart="4px" marginEnd="10px">
<af:panelFormLayout id="pfl2">
<af:link id="ot11" text="#{row.name}"
clientComponent="true"
partialSubmit="true" styleClass="list-hdr-fields"
shortDesc="#{userinterfaceBundle.MANAGE_ROLES_LABEL}">
<af:clientAttribute name="uId"
value="#{row.name}"/>
<af:showPopupBehavior popupId="::manageRolesPopup"
triggerType="click"/>
</af:link>
<af:outputText value="#{row.description}"
shortDesc="#{userinterfaceBundle.DESCRIPTION_LABEL}"
id="ot12" />
<f:facet name="footer"/>
</af:panelFormLayout>
</af:gridCell>
<af:gridCell width="25%" id="gc3" valign="middle"
halign="end" marginStart="40px">
<af:panelGroupLayout styleClass="lv-row-col-right"
id="pgl2">
<af:panelGroupLayout styleClass="lv-row-col"
id="pgl16">
<af:link id="l4"
icon="/oracle/ics/webconsole/view/images/func_preferences-new_16_ena.png"
disabledIcon="/oracle/ics/webconsole/view/images/func_preferences-new_16_dis.png"
hoverIcon="/oracle/ics/webconsole/view/images/func_preferences-new_16_hov.png"
depressedIcon="/oracle/ics/webconsole/view/images/func_preferences-new_16_act.png"
iconPosition="trailing"
shortDesc="#{userinterfaceBundle.ACTIONS_LABEL}">
</af:link>
</af:panelGroupLayout>
</af:panelGroupLayout>
</af:gridCell>
</af:gridRow>

Try using af:panelGroupLayout with layout="horizontal" instead of af:panelFormLayout

add an af:spacer next to the component you need space next to and surround with panelGroup layout horizontal.
http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_spacer.html

According to the Geometry Management of <af:gridCell>:
Beware that if you attempt to use width="auto", halign="center",
halign="end" in conjunction with cell content that uses unstable,
percentage-based widths, you may experience different results in
different browsers. If you wish to use these settings, be sure to
constraint the width of that cell content.
Possible Workaround: instead of halign="end", change it to halign="stretch" (source).

Related

Filter on adf Table using view object

I need a filter on my af:table, already tried native adf method filterVisible="true" and by setting filterable="true" but it doesn't return the results on the table. Also tried to do this using manageBean method which, I am going to post below:
jsff page
<af:commandButton text="Filter" id="cb1" actionListener="#
{pageFlowScope.paisMB.filterTableAction}"/>
<af:table value="#{bindings.PaisUVO.collectionModel}" var="row"
rows="#{bindings.PaisUVO.rangeSize}"
emptyText="#{bindings.PaisUVO.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.PaisUVO.rangeSize}"
rowBandingInterval="0" styleClass="AFStretchWidth"
selectionListener="#{bindings.PaisUVO.collectionModel.makeCurrent}"
rowSelection="single" id="t1" binding="#{pageFlowScope.paisMB.tableData}"
scrollPolicy="page" autoHeightRows="0"
filterModel="#{bindings.PaisUVOQuery.queryDescriptor}"
queryListener="#{bindings.PaisUVOQuery.processQuery}" filterVisible="true">
<af:column sortProperty="#{bindings.PaisUVO.hints.NewsiteOxiLingua.name}"
sortable="false"
headerText="#{bindings.PaisUVO.hints.NewsiteOxiLingua.label}"
id="c6">
<af:outputText value="#{row.NewsiteOxiLingua}" id="ot3"/>
</af:column>
<af:column sortProperty="#{bindings.PaisUVO.hints.NewsiteOxiPaisesPk.name}"
sortable="false"
headerText="#{bundle['lbl_codigo']}"
id="c5">
<af:outputText value="#{row.NewsiteOxiPaisesPk}" id="ot4">
<af:convertNumber groupingUsed="false"
pattern="#{bindings.PaisUVO.hints.NewsiteOxiPaisesPk.format}"/>
</af:outputText>
</af:column>
<af:column sortProperty="#{bindings.PaisUVO.hints.NewsiteOxiPaisesNome.name}"
sortable="false" filterable="true"
headerText="#{bundle['lbl_pais']}"
id="c7">
<af:outputText value="#{row.NewsiteOxiPaisesNome}" id="ot2"/>
</af:column>
</af:table>
I want to filter my last column.Below is my java code for search button.
Manage Bean Page
private transient RichTable tableData;
private RichInputText countryName;
public void filterTableAction(ActionEvent actionEvent) {
RichTable tb1 = this.getTableData();
FilterableQueryDescriptor filterQD = (FilterableQueryDescriptor)tb1.getFilterModel();
Map filterCriteria = filterQD.getFilterCriteria();
filterCriteria.put("NewsiteOxiPaisesNome", countryName.getValue());
LOGGER.warning("Filter Criteria : " + filterCriteria);
getTableData().queueEvent(new QueryEvent(getTableData(), filterQD));
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getTableData());
LOGGER.warning("OnFilterTable Action is Called : " + filterQD);
}
My table is based on view object. Can anyone tell me what i am doing wrong. My table simply just dont return search result, also gives no error.
If there is anyother better way to do this i am open for suggestions. Version of jdev is 11.1.1.7.0
Under executables in the pageDef.xml file that defines the bindings to this page make sure you have PaisUVOQuery searchRegion.
It defines the search region that the filter will use to search.
E.g.
"...
..."
set the Binds to the your correct iterator. I had a similar problem and this worked for me.

Submit data-table in JSF / Primefaces?

I am working on a web application using jsf/ primefaces, netbeans and tomcat.
I have a datatable with some values loaded in from another table and some editable fields. My question is, after the user has edited this table how do i submit the whole table so it can be stored in a database, in a new table?
<h:form id="form" prependId="false">
<h3>All of your Paddocks</h3>
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}" editable="true">
<p:ajax event="rowEdit" listener="#{paddock.onRowEdit}" />
<p:ajax event="rowEditCancel" listener="#{paddock.onRowCancel}" />
<p:column headerText="Id">
<h:outputText value="#{paddock.idPaddock}" />
</p:column>
<p:column headerText="Name">
<h:outputText value="#{paddock.name}" />
</p:column>
<p:column headerText="Area">
<h:outputText value="#{paddock.area}" />
</p:column>
<p:column headerText="Enter Grass Weight">
<p:cellEditor>
<f:facet name="output"><h:outputText value="0" /></f:facet>
<f:facet name="input"><p:inputText id="modelInput" value="0" style="width:100%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:32px">
<p:rowEditor />
</p:column>
</p:dataTable>
<h:commandButton value="Log" action="#{paddock.add}" />
</h:form>
Note that the only editable column is the grass column.
First of all, there are two main mistakes which may have undesired side effects:
<h:form ... prependId="false">
Never use prependId. Remove the whole attribute.
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}">
You should give var a different name than the managed bean. E.g. paddockItem.
As to the concrete question, your other mistake is here:
<p:inputText id="modelInput" value="0" />
You didn't bind the input value to the model. So JSF won't be able to update the model with the submitted values anyway.
Fix it accordingly, e.g.:
<p:inputText id="modelInput" value="#{paddockItem.grass}" />
In the submit method, it'll be right away there in the model.
You should only make absolutely sure that you aren't interacting with the database in the getter method of the <p:dataTable value>, otherwise you will be overwriting the model on every iteration round, hereby basically trashing the submitted values until the last row before the submit method is hit. The strange method name behind the data table value value="#{paddock.getfromPaddock()}" namely suggests that you're doing that. If it were a real property, the average starter would just have used value="#{paddock.fromPaddock}" or so.
See also:
How and when should I load the model from database for h:dataTable

Tree table command link in child node

I have view link that I have dragged it as ADF tree table in .jsff page.
<af:treeTable value="#{bindings.SisaiEndPointView1.treeModel}" var="node"
rowSelection="single" id="TT1" contentDelivery="immediate"
columnStretching="last" partialTriggers=":::commandButton1"
editingMode="clickToEdit"
contextMenuSelect="true">
<f:facet name="nodeStamp">
<af:column id="column1" headerText="Ministry" sortable="true"
width="200%">
<af:outputText value="#{node.Ministry}" id="outputText1"/>
</af:column>
</f:facet>
<af:column id="column5" headerText="#Errors" width="100%">
<af:commandLink text="#{node.ErrorMsgCount}" id="cl2" immediate="true" partialSubmit="true" action="#{pageFlowScope.EndPointBean.testInput}">
<af:setActionListener from="test #{node.ErrorMsgCount}"
to="#{pageFlowScope.Min}"/>
</af:commandLink>
</af:column>
public String testInput() {
String str = (String)ADFContext.getCurrent().getPageFlowScope().get("Min");
System.out.println(str);
return null;
}
I am not getting any value when I am printing in action method STR.
It is comming only hardcoded value "test " but not getting #{node.ErroMsgCount}.
try this one.
<af:setPropertyListener from="#{node.ErrorMsgCount}" to="#{pageFlowScope.Min}" type="action"/>
Hope it will work...
Sorry for late reply I tried property listener also that also not working.
After that i found the solution that the above operation is totally valid. THere was the problem with VO that was not update able.
I think what you are looking for is an actionListener. So, your code will look like:
Page
<af:treeTable value="#{bindings.SisaiEndPointView1.treeModel}" var="node"
rowSelection="single" id="TT1" contentDelivery="immediate"
columnStretching="last" partialTriggers=":::commandButton1"
editingMode="clickToEdit"
contextMenuSelect="true">
<f:facet name="nodeStamp">
<af:column id="column1" headerText="Ministry" sortable="true"
width="200%">
<af:outputText value="#{node.Ministry}" id="outputText1"/>
</af:column>
</f:facet>
<af:column id="column5" headerText="#Errors" width="100%">
<af:commandLink text="#{node.ErrorMsgCount}" id="cl2" immediate="true" partialSubmit="true" actionListener="#{pageFlowScope.EndPointBean.testInput}">
<af:setActionListener from="test #{node.ErrorMsgCount}"
to="#{pageFlowScope.Min}"/>
</af:commandLink>
</af:column>
Bean
public void testInput(ActionEvent ae) {
String str = (String)ADFContext.getCurrent().getPageFlowScope().get("Min");
System.out.println(str);
return null;
}
Few more things.
PageFlowScope is for the entire task flow. I am not sure about your use case but use the lowest scope possible.
setPropertyListener with type="action" and setActionListener are quite similar, so they will behave the same mostly.
This bean that you are using, unless it needs to persist values across pages in a task-flow, lower the scope of the bean from pageFlowScope.
try to remove the inmediate="true"
<af:commandLink text="#{node.ErrorMsgCount}" id="cl2" partialSubmit="true" action="#{pageFlowScope.EndPointBean.testInput}">
When you set inmediate to true, this skip update model phase and you don't see the changes.
Marcos

<h:commandLink> action not invoke if include with <ui:include>

If I place inside an include file, the action will not call back bean.
Main File:
<h:form id="ifLogin">
<h:panelGrid
rendered="#{userSession.isLogin}"
columns="2" columnClasses="columnAlignLeft, columnAlignRight"
border="0" cellpadding="0">
<ui:include src="\test.xhtml" />
...
</h:panelGrid>
</h:form>
Include file (test.xhtml)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:panelGrid border="0" columns="4">
<h:graphicImage value="#{msg.urlImageHome}"
style="height:26px;width:26px;" />
<f:subview>
<h:commandLink value="#{msg.home}" style="font-size: small;" immediate="true"
action="#{pageNavigationBean.updateCeaAppName}">
<f:param name="requestName" value="CEA_MAIN_PAGE" />
<f:param name="ceaAppName" value="" />
</h:commandLink>
</f:subview>
</h:panelGrid>
</ui:composition>
The workaround is take out include file, directly place the code to main file as below:
Main file (without using include)
<h:form id="ifLogin">
<h:panelGrid
rendered="#{userSession.isLogin}"
columns="2" columnClasses="columnAlignLeft, columnAlignRight"
border="0" cellpadding="0">
<h:panelGrid border="0" columns="4">
<h:graphicImage value="#{msg.urlImageHome}"
style="height:26px;width:26px;" />
<f:subview>
<h:commandLink value="#{msg.home}" style="font-size: small;" immediate="true"
action="#{pageNavigationBean.updateCeaAppName}">
<f:param name="requestName" value="CEA_MAIN_PAGE" />
<f:param name="ceaAppName" value="" />
</h:commandLink>
</f:subview>
</h:panelGrid>
...
</h:panelGrid>
</h:form>
I use richface 4.3.1 Odd is this problem not happen when I run from local GAE. After deploy online to GAE, problem occour (i.e if using include then action will not trigger.
Is that a bug in jsf? or richface implementation or GAE? Any help?
Problem identify
It is not cause by using <ui:include>
The problem came out when the include file is dynamic generate from back bean, for example:
<ui:include src="#{pageNavigationBean.appDropDownMenuUrl}" />
If explicit mention the url, it work, for example:
<ui:include src="\test.xhtml" />
Well, if running from my local GAE, both way are working but when deploy online, I need use explicit location instead generate from bean. May be that is due to GAE problem where state is save at Client side (javax.faces.STATE_SAVING_METHOD).
I can't reproduce the problem with exactly the same included code (test.xhtml), but here are some recommendation:
Escape '>' characters (replace >>> by >>>)
Specify id attribute for f:subview (it is required according to tld)
Change backslash ('\') to slash ('/'). So inclusion would be <ui:include src="/test.xhtml" />

How to avoid validation of input items within af table and javascript

I developed a form which includes table and commandButton. Some input items are required. I want them to validate while just button pressed.
And everything was ok, this scenario was working well. But when table presents only one row, selecting row does not work. See alsa plz: https://forums.oracle.com/forums/thread.jspa?threadID=960512&start=0&tstart=0 --> might be 9th post
I applied to my jsff the solution which is told in above link. It works previous issue but this time, javascript caused another problem that is inconsistent validation. As i understood java script overrides af table immediate="true" property. plz see : http://www4.picturepush.com/photo/a/11897217/640/11897217.png
How can i resolve that? Any suggestion?
Plz help me
Thanks in advance
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:trh="http://myfaces.apache.org/trinidad/html"
xmlns:f="http://java.sun.com/jsf/core">
<trh:script>
function tableLoad(event)
{
AdfCustomEvent.queue(event.getSource(), "refreshTables",
{
},
true);
event.cancel();
}
</trh:script>
......
<af:table var="row" rowBandingInterval="1" id="entityT"
value="#{pageFlowScope.incomingPaperworkBean.baseRowCollection}"
partialTriggers="::cb_incPaperDef_commit ::cb_incPaperDef_filter"
rowSelection="single" columnBandingInterval="0"
disableColumnReordering="true" columnStretching="column:c3"
styleClass="AFStretchWidth" autoHeightRows="20"
contentDelivery="immediate" immediate="true"
binding="#{pageFlowScope.incomingPaperworkBean.richTable}">
<af:clientListener method="tableLoad" type="click"/>
<af:serverListener type="refreshTables"
method="#{pageFlowScope.incomingPaperworkBean.refreshTables}"/>
<af:column id="c5" width="105">
<af:inputText id="registrationText"
value="#{row.baseEntity.registrationNumber.registrationNumber}"
required="true" readOnly="true" autoSubmit="true"
disabled="true"/>
<f:facet name="header">
<af:panelGroupLayout id="panelGroupLayout1" layout="vertical">
<af:inputText id="filterRegistrationNumber"
value="#{pageFlowScope.incomingPaperworkBean.filterTemplate.incomingPaperwork.registrationNumber.registrationNumber}"
simple="true" autoSubmit="true"/>
<af:spacer width="10" height="10" id="spacer1"/>
<af:outputText value="Kayit Numarasi" id="outputText6"/>
</af:panelGroupLayout>
</f:facet>
</af:column>
......
Set the immediate parameter on the component clicking on which fires the validation.

Resources