Showing posts with label ADF page. Show all posts
Showing posts with label ADF page. Show all posts

Tuesday, December 1, 2009

To Restrict Resizing of ADF Table's column


<af:column sortable="true"headerText="#{bindings.EmployeesView1.hints.EmployeeId.label}" id="c12" align="center"
minimumWidth="100" partialTriggers="::t1">

<af:outputText value="#{row.EmployeeId}"
id="ot11">

<af:convertNumber groupingUsed="false"

pattern="#{bindings.EmployeesView1.hints.EmployeeId.format}"/>

</af:outputText>

<af:clientListener method="setColumnWidth"
type="propertyChange"/>

<af:serverListener type="server"
method="#{yourBackinbean.serverL}"/>

</af:column>

and your javaScript will be:

<af:resource type="javascript">

function setColumnWidth(event) {

var source = event.getSource()

source.setWidth("100px");

AdfCustomEvent.queue(source,"server", {}, false);

}

</af:resource>

and your method in backingbean will be :

public void serverL(ClientEvent clientEvent) {

RequestContext.getCurrentInstance().addPartialTarget(clientEvent.getComponent().getParent());

}





Hint : If you know how to refresh the table from javaScript
you don't need a serverListener

Thursday, June 18, 2009

How to prevent navigation thorugh browser back button using java script in ADF page

Add the following java script to Onload attribute of afh:body tag in ADF page.

if (history.forward() != null) history.forward()