Posts

Showing posts with the label javascript

OJET: Calling a REST Service

During my journey from a pure Java EE / Jakarta EE developer using JAX-RS, JSON-B, Jersey etc...  for Java - REST integration to JavaScript (in this case Oracle JET) I was checking the alternatives of calling REST services from JavaScript. Things has changed a lot since I was doing mostly Vanilla and JQuery JavaScript for some "quick fixes". Here I bring examples of making a GET request to a REST Service. The rest of operations only needs little bit more configuration, but this post is just to have a look into history in JavaScript and ways of calling a REST service (only making a GET, not a POST, PUT or DELETE) If you want to execute the code: https://github.com/DanielMerchan/ojet-examples It is fundamental that you read about JavaScript Promise Object and have a fully understand on it. Vanilla JavaScript < ES6+ Yes, during my career I had to deal with JavaScript in its early stages to make AJAX calls and requests. Basically this makes use of XMLHttpRequest ...

Acceso por ID a un componente ADF por JavaScript

Image
Hola a todos. Una parte interesante acerca del uso de JavaScript con componentes ADF es el acceso a los mismos mediante su identificador. Puesto que el compilador de JSP's de Oracle completa con un autogenerado estos identificadores. Dificulta el uso de JavaScript común. Por ello Oracle ADF trae consigo su propio API de JavaScript: API JavaScript de Oracle ADF . Para acceder mediante el ID a un componente ADF pueden darse los siguientes casos: Si el componente ADF NO se encuentra en uno de los denominados "Naming Containers" se puede utilizar la llamada AdfPage.PAGE.findComponentByAbsoluteId(idComponente).  En el caso de usar esta llamda estando dentro de "Naming Containers" es necesaria ser llamada como AdfPage.PAGE.findComponentByAbsoluteId(rutaComponente:idComponente) donde rutaComponente es la ruta absoluta o relativa donde se encuenta nuestro componente (en lugar de usar el caracter '/' como en sistema de ficheros se utiliza el cararcter ...