Pages

Tuesday, September 30, 2014

Show Faces Message using JavaScript in ADF Faces

How to show faces Message using javaScript in ADF Faces


I have read this on Ashish Awasthi's blog. So if you want to read full detail sample refer to his blog.

For reference purpose, I am putting two lines of code here :

// Clear all validation message 
AdfPage.PAGE.clearAllMessages();

//Invoke FacesMessage
AdfPage.PAGE.addMessage('it1', new AdfFacesMessage(AdfFacesMessage.TYPE_ERROR, "Invalid Value", "Enter Characters Only"));


Other valid types are : TYPE_ERROR, TYPE_INFO, TYPE_WARNING, TYPE_FATAL .

Enjoy !!

Friday, September 26, 2014

WebProxy - Log Request and Response xml to console

How to view the request and response xml for a webservice call made using webProxy.


To see the soap request and response we can set a JAX-WS parameter. 
"-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true"  ,this will dump the data in your console output.

Edit the Run/Debug Profile for the project and then run it . See the screenshot for more details : 





You can also write a SOAP logging handler ....will be covered in future posts.

Enjoy...

Tuesday, September 9, 2014

Groovy : Posted Attribute Value using groovy

How to get the posted attributeValue using Groovy .

 To expose old value of entity objects, follow steps below :

1.  Create transient attribute "OLD_SALARY" in Entity Object.
2. Make sure that "Persistent" and "Derived From SQL Expression" properties are turned off.
3. Set the "Value Type" to Expression and enter the following Groovy expression into the Value field:

adf.object.getPostedAttribute(adf.object.getAttributeIndexOf(model.EmployeesImpl.SALARY))

That's it... Now  old salary attribute holds the value of salary retrieved from database. If required same attribute can be used in viewObject ...

Enjoy.