Calling a Stored Procedure without Arguments

If you need to call a procedure with no arguments , it´s ver simple as shows below.


// in AMImpl

public void callProcedure(){
getDBTransaction().executeCommand("begin PROCEDURE_NAME; end;");
getDBTransaction().commit();
}

If you need pass a IN or OUT arguments you have the doc oficial here http://docs.oracle.com/cd/E17904_01/web.1111/b31974/bcadvgen.htm#ADFFD1052

Anuncios

MethodCall in Trains

Today I upload a sample that shows how to call a method call before step train in a declarative way.

This is a image of Taskflow:

We have a generic navigation to the methodCall, now in the outcome property of the second step put a generic navigation goMethod.

In this sample also show how to change the labels of the train steps

For more info see the doc: http://docs.oracle.com/cd/E15523_01/web.1111/b31973/trains

FootNotes:

  • You can download the sample here
  • JDev version 11.1.2.3

LOV with Custom autoSuggestBehavior

When we want a LOV with autoSuggest we include a autoSuggestBehavior inside the LOV. But autoSuggestBehavior is only about one field.

<af:inputListOfValues id="jobIdId"
                                    popupTitle="Search and Select: #{bindings.JobId.hints.label}"
                                    value="#{bindings.JobId.inputValue}"
                                    label="#{bindings.JobId.hints.label}"
                                    model="#{bindings.JobId.listOfValuesModel}"
                                    required="#{bindings.JobId.hints.mandatory}"
                                    columns="#{bindings.JobId.hints.displayWidth}"
                                    shortDesc="#{bindings.JobId.hints.tooltip}">
                <f:validator binding="#{bindings.JobId.validator}"/>
                <af:autoSuggestBehavior suggestedItems="#{ bindings.JobId.getSuggestedItems}"/>
              </af:inputListOfValues>

 

We can customize the list of suggested items through own suggestedItems method.

 <af:autoSuggestBehavior suggestedItems="#{MyBean.getSuggestedItems}"/>

In this sample the method(getSuggestedItems) gets a user entry text and calls a method in JobsViewImpl that through ViewCrietria build a suggest item list. In this way we can get records matching with JobId and JobTitle.

See next image:

This approach is also useful for custom the text of suggested items.

You can download the sample here

Note:JDev version 11.1.1.6

ADF Custom Errors

I explain in this post How to customize error messages for required fields and some JBO errors

Hoy subimos un ejemplo que cubre una duda muy preguntada en OTN. Como customizar los mensajes de error para campos obligatorios yalgunos errores JBO

El objetivo es sobrescribir el mensaje “A value is required” y el de clave duplicada JBO-25013: Too many objects match the primary key oracle.jbo.Key[Key xx ].

Esto se consigue creando un bundle propio y registrándolo en el proyecto.

Ver doc:docs.oracle.com/cd/E21764_01/web.1111/b31974/bcadvgen.htm#sm0463

Hemos creado un bundle para la capa de Modelo y otro para la capa de Vista.

El resultado final es el que se ve en la imagen:

  

Pueden descargar el ejemplo aqui