[ADF, JDev12.1.3] How to pass an Integer value sets to a workflow, and then it reads a bean?

Hallo,

for a test, I need to set the value of an entry of a stubborn workflow used as dialog...

Then in the bean that is associated with a known fragment of the btf, I need to read the value, so I used this code...

Integer protocol = (Integer) AdfFacesContext.getCurrentInstance().getPageFlowScope().get("protocol");

This exception triggers...

javax.el.ELException: java.lang.ClassCastException: java.lang.Long cannot be cast java.lang.Integer

What's wrong?

Thank you

Federico

If I remember correctly, in JSF that EL has Long type so this probably also applies to ADF.

For example, you can cast a Long or you can use the type field (from some managed bean) an integer as an input parameter.

Dario

Tags: Java

Similar Questions

  • [ADF, JDev12.1.3] How to pass tha value of an attribute of the VO at the request of a field of the VO even LOV?

    Hallo,

    I have a LOV associated FieldB and showed it in the popup LOV, these must be filtered according to the value of FieldA (2 fields belongs to the same TableVO VO).

    The LOV associated FieldB is based on a VO that has a binding variable 'BindCodInstitute '.

    I would like to know how I can assign the vuale of FieldA to the variable binding.

    What expression I have co-debtors variable binding?

    Thank you

    Federico

    also see - https://blogs.oracle.com/aramamoo/entry/how_to_create_multi_level

  • [ADF, JDev12.1.3] How to get programmatically the value of a field of VO of detail while accessing the master istance VO?

    Hallo,

    I have a master VO based on entities and a retail entity based VO to which JDev automatically created a link display (1 to 1 relationship).

    In the request Module I programmatically access MasterVO and I would like to get the value of a field of DetailVO...

    ViewObject vo = getMaster1();
    RowSetIterator iterator = vo.createRowSetIterator(null);
    iterator.reset();
    if (iterator.hasNext()) {
      MasterVORowImpl row = (MasterVORowImpl) iterator.next();
      System.out.println(row.getField1);
      System.out.println(row.getField2);
      // ...
      System.out.println( <DetailVO.Field1> ); // How to...?
      // ...
      }
    iterator.closeRowSetIterator();
    

    How can I achieve this?

    Thank you

    Federico

    In MasterVORowImpl should be getter for the detail rows (if you selected "Include the accessors" option when you generated class MasterVORowImpl).

    Dario

  • [ADF, JDev12.1.3] How to get the column headers, request of VO and VO bind vars used by an af:table?

    Hallo,

    I want to create a method that takes as a parameter the id of an af:table (used to display the search results) and returns:

    • the column headings of the af: table
    • Visible property (true/false) of the columns af:table
    • the actual query of the VO instance used to create the af: table
    • the values of real bind variables passed to the query of the instance of VO

    I would like to create a servlet which takes the parameters reruns the query and returns a report Excel/PDF file that contains exactly the same columns and same of the af records: table.

    I'm a little confused on who use the code to achieve this... you kindly help me?

    I did a similar qustion here Re: [ADF, JDev12.1.3] how to export an af:table to Excel in an ADF Essentials application? but then I guessed that it was preferable to create a new thread.

    Thank you

    Federico

    For this, you can use this type of code

    Context LocaleContext = _adfTableBinding.getLocaleContext ();

    for (attr AttributeDef: attributeDef) {}

    Label As String = attr.getUIHelper () .getLabel (context);

    _logger.info ("Attritbute name:" + attr.getName () + "column name:" + attr.getColumnName () + "Col4Query name:" + attr.getColumnNameForQuery () +)

    "Name:"+ label);

    }

    which produces this output

    Timo

  • How can I create a pause in my inspection so that I can change a setting on my DEGREE, and then resume with the rest of the inspection?

    New to Labview and NI Vision in general here.

    How can I create a pause in my inspection so that I can change a setting on my DEGREE, and then resume testing?

    I want my inspection to execute algorithms on the acquisitions of two different images, where the break to change the settings of my DUT.  I thought that the breakpoint was working well when I'm in the configuration interface and I run the State, but it seems that when I run the inspection he jumps on the breakpoint and continues on the next stage of the inspection immediately.

    Are you running Vision Builder AI on Windows or on a remote target? If you have a remote target, which?

    On Windows, you can use a step of user input in the last tab of the Vision Builder AI tool palette.

    It will display a dialog box that is paused the inspection until you click on a button.

  • How do I register a very old acrobat from adobe and then download the upgrade? It seems that the serial number is not consistent with the serial number required by the adobe Web site. My serial number starts with the letter instead numbers.

    How do I register a very old acrobat from adobe and then download the upgrade? It seems that the serial number is not consistent with the serial number required by the adobe Web site. My serial number starts with the letter instead numbers.

    Please see:

    Redeem your student and teacher edition purchase, convert a redemption code to a number of series and much more .

    I hope this helps.

    Concerning

    Megha Rawat

  • How can I fix my Lightroom 6? It starts and then crashes when I try to delete a photo from a collection or edit a photo.

    How can I fix my Lightroom 6? It starts and then crashes when I try to delete a photo from a collection or edit a photo.

    Go to the dialog box Preferences, Performance tab and disable the GPU acceleration. See if that helps.

  • [ADF, JDev12.1.3] How to set a variable to bind a VO (where clause) in a managed bean?

    Hallo,

    I have a request based on VO.

    The query contains a where clause clause and a bindi variable.

    In a managed bean I would like to access the iterator of VO setting the value of the bind variable and read the result.

    I found this code it is good start, but I do not know how to set the variable binding.

    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    DCIteratorBinding iter = (DCIteratorBinding ) bindings.get("MyVO1Iterator");
    iter.execute();
    
    
    

    You kindly help me?

    Also, I would like to know if it is generally advisable to use VO directly in controlled beans or whether it would be best to create in the AppModuleImpl methods that do this and return the result.

    In my case for example of the VO will return max 1 plug so I'm in doubt, if the creation of a method in the AM that returns a custom class, which attributes contain values of the line of VO.

    Sorry if these questions may seem artificial, but I am a beginner, I have many doubts and so I would be happy to receive some tips regarding best practices.

    Thank you

    Federico

    You can use:

    iter.getViewObject().setNamedWhereClauseParam("yourBindVar", value);
    

    Note that this approach is used if you have bind variable in the where clause.

    To set variables bind to ViewCriteria, you must use VarableValueManager.

    This post may be useful for you: binary: how to set the Bind variable values at run time?

    Also, I would like to know if it is generally advisable to use VO directly in controlled beans or whether it would be best to create in the AppModuleImpl methods that do this and return the result.

    You must set "use VO directly.

    For example, from the point of architecture, is probably best to use the method in the model project which will set the bind variable and execute the query.

    Or you can use the ExecuteWithParams operation in your the view layer.

    In my case for example of the VO will return max 1 plug so I'm in doubt, if the creation of a method in the AM that returns a custom class, which attributes contain values of the line of VO.

    Not to complicate your life

    All VO lines are represented as ViewRowImpl class if you already have "custom class".

    Finally, you can generate your own ViewRowImpl class if it is necessary for this.

    Dario

  • [ADF, JDev12.1.3] How to set the value of an attribute of VO 'max (attribute) + 1' when creating a new record?

    Hallo,

    I have a VO that selects records from a table databace where FkId = < value >.

    For example: this is the database table...

    ID RowDetNumber OtherFields FkId

    1   3     1            ...

    2   3     2            ...

    3   3     3            ...

    4   3     4            ...

    5   4     1            ...         |

    6   4     2            ...         | -VO selects these records (where FkId = 4 for example)

    7   4     3            ...         |

    8   5     1            ...

    9   5     2            ...

    When a new record is created the field RowDetNumber must be calculated with the logic of the max (RowDetNumber) + 1.

    So for the example above, the calculated value should be 3 + 1 = 4.

    I would like to know how I can calculate the value and assign to the RowDetNumber attribute.

    I did some experiments using a Groovy expression as a default value for the field, but I got only errors.

    I'm a bit confused on how I can do so a few details / examples / tips are welcome

    In particular, a small example for every possible approach would be happy.

    Thank you

    Federico

    Federico, the solution mentioned in the block will work as it only generates unique numbers without guarantee that the generated numbers are without flaw. However, if you want to use max + 1 this normally means you want to have a sequence without gap. It is very very complicated in nature. It doesn't matter what application you're trying, there is almost always room for error, ending with duplicate numbers.

    The trigger also works as the DB supports triggers on MS SQL.

    If you don't need a number of gap-less for the attribute, you can use the groovy solution and just get a number of a sequence is is guaranteed unique and greater value, like the last number that you asked of the sequence. In this way, you can have the sorted records

    ID RowDetNumber OtherFields FkId

    1  3    1            ...

    2  3    7            ...

    3  3    9            ...

    4  3    10            ...

    5  4    3            ...        |

    6  4    5            ...        | -VO selects these records (where FkId = 4 for example)

    7  4    12            ...        |

    8  5    4            ...

    9  5    6            ...

    Timo

  • How to pass an integer to a workflow

    Hello

    JDev 11.1.2.4

    I have a bounded task flows with an input parameter named width in java.lang.Integer. I dropped it as a region in a page, and the links, I put the value of the parameter to 1500.

    In the bean managed the BTF, I try to get the value of this setting using the #{pageFlowScope.width}. The problem is that the parameter is interpreted as a string, while it is declared as an integer.

    Can you explain why? How to pass this 1500 as an integer value.

    Thank you

    I'm sure it works but I want to understand why I get a string while I declare the parameter as an integer

    Class parameter set to the parameter BTF is ignored by the duration of the adf (so you can type here what you want)

    There was a demand for improvement (long ago), but I don't know what happened with that (except that it still does not work).

    Dario

  • How to pass parameters/field values from one screen to another screen in blackberry

    Hi all

    I have two screens in my Application UI that is, login screen and continue the screen.

    Login screen has some fields of seizure as a user name and password and default language (French or English) for the application (Group of radio buttons).

    There is a button for the next who directs the user to another screen.

    This second screen has an input field. This input field is mandatory. The user can only go further if it is entered in this field of entry with valid values (i.e. numbers only).

    This screen has continue button so that the user can go further is on the next screen after you have entered a valid value in the field.

    Now, when the user clicks the continue button on the second screen so I have to validate the credentials of the user, he has provided in the first screen. Also, I need set the locale for the language he has provided to the login screen.

    So, to summarize.

    (1) user enters user name, password and language on the first screen. The user clicks NEXT and goes to the second screen.

    (2) on the second screen, the user enters a name click continuous. ((3) user credentials are validated, defined locale and user is illustrated below third screen).

    So, my question is how do I access username, the password, the language of the first screen in the second screen fieldChanged method?

    fieldChanged second display method will be called when user enter a value class we second screen and clicks continue.

    Please advice

    Thanks in advance...

    Store text values in the fields in your application class, and then pass it as a reference to each form or retrieve your instance of UiApplication and cast to the name of your class.

    public class MyApp extends UiApplication {   public String username;   public String password;   public String language;
    
    }...
    
    // Your first screen
    
    public class MyFirstScreen extends MainScreen {   private MyApp _app;
    
       public MyFirstScreen()   {      _app = (MyApp) UiApplication.getUiApplication();
    
          // Set your fields      // AS AN EXAMPLE, you can use:      // _app.username = field1.getText();      // _app.password = field2.getText();      // _app.language = field3.getText();   }}...
    
    // Your second screen somewhere
    
    public class MySecondScreen extends MainScreen {   private MyApp _app;
    
       public MySecondScreen()   {      _app = (MyApp) UiApplication.getUiApplication();
    
          // Access your fields      // you can use:      // _app.username      // _app.password      // _app.language   }}
    

    Now, this is one of the many ways to do it, but it works in its simplest form.

  • [ADF, JDev12.1.3] When the operationBinding.getErrors () .isEmpty () which are 1) common causes and 2) actions recommended to do?

    Hallo,

    When you call a method from the link layer errors my arrive and the code base to make sure it is...

    if (! operationBinding.getErrors().isEmpty()) {
      // Error handling
      return false;
      }
    

    In the error handling, we can save the error and perform other actions.

    List errors = operationBinding.getErrors();
    Throwable t = null;
    Iterator<Throwable> it = errors.iterator();
    while (it.hasNext()) {
      t = it.next();
      log(t.getMessage());
      // Specific action for the exception
      }
    

    Given that my error handling section don't ever serve during the tests... I ask you what kind of error may occur when you call a method in the link layer?

    What are the common mistakes that can happen?

    What actions are usually performed in case of error?

    Cancellation of the transaction?

    Output of the application?

    What have I to do not forget to check?

    Thank you

    Federico

    Federico, read http://www.oracle.com/technetwork/issue-archive/2013/13-mar/o23adf-1897193.html , who read the part called "Oracle ADF Error Handling Architecture". Frank described here kind of mistakes that each layer can lift and how to manage them. You can even start your own exceptions derived from local and get in the list.

    Delivery errors, it's something you have to decide on each case. Get an error while you commit could do a necessary restore, but only sometimes display a form one let the fix for the user of the problem. If you call a method in the rich throws module request a mistake because a service is not available, you can continue if you do not need data he or so while the application if the data are required.

    It must be decide for ach calls you make. In general you must connect at least a message with error to leave to find the best solution in a later version, and then just to save the message.

    Timo

  • Header of page-how to pass a dynamic value?

    Hello

    I created a page - which redirects to an external link.
    I have following code in the page header.

    < META HTTP-EQUIV = "refresh" CONTENT = "2; URL = XYZ.com ">".
    < b > < p > < p > < p > < p > < p >

    < /b >


    When I run this page, redirects after 2 seconds to this particular url: xyz.com.

    My query is: Ii would there the URL value dynamically.

    I tried with the following code in the header:

    var abc = $v ('P97_TEST');
    < META HTTP-EQUIV = "refresh" CONTENT = "2; URL = abc ">".
    < b > < p > < p > < p > < p > < p >

    < /b >

    where P97_Test is an element of text field.

    But he directs me to a url: my_apex instance/abc. It does not work.

    No idea how to pass the value of the url dynamically? I need to get the success of a particular URL.

    Thank you
    Archana

    Dear Archana,

    I found the following solution work:

    (1) create an element on the page to the URL (in this example, P3_URL)

    (2) create a pl/sql process
    type: PL/SQL anonymous block
    address the point: on the laundry before header
    Source:

    begin
    :P3_URL := 'http://www.google.de/';
    end;
    -- this can be as sophisticated as you need
        
    

    (3) according to the Page Properties / header before HTML

    
    

    Marc

  • How to pass the return value of VO1 VO2 parameter?

    Hi friends,
    I have two of VO, in a page.
    In the first VO1 I pass 2 parameters, then this vo return a value unique ex: 1234
    Now my second VO2 I want to pass the parameter, the value of first result VO1.
    How to get there.
    But I don't want to capture VO1 result in the form value.

    Could you please any body explain how to achieve this requirement.

    Thanks in advance.
    Jocelyne.

    RAMU

    //Modify the code as per your requirement
       String position = null;
       //First VO
       OAViewObject vo = (OAViewObject)findViewObject("EmployeeVO1");
       if(vo!=null)
      {
                     vo.executeQuery();
                     OARow row = (OARow)vo.first();
                     position = (String)row.getAttribute("PositionCode");
       }
    
     //Pass the same value to the new VO as your value returned will be into position variable
    
       OAViewObject vo = (OAViewObject)findViewObject("ManagerVO1");
       if(vo!=null)
      {
                     vo.setWhereClauseParam(0,position );
                     vo.executeQuery();
       }
       
    

    Kind regards
    GYAN

    Published by: Gyan on February 23, 2011 01:30

  • How to save an image from a return on investment and then convert it into an array of pixels?

    I work with a camera CCD USB and LabView 2012 on a project. With the help of some drivers supplied with the instrument (Imaging CCD USB drivers source) that I created a program to display a picture in live stream then grab a picture and select a return on investment. I need to convert this KING of a new image and then save it, but I can't do it. I also have to convert an array of pixels in the image of the KING, and I don't know how to do that either. Any help is appreciated! I have attached my attempt to the program so far.

    Hello Kloram,

    Here are some examples that I found from our pages OR community who perform your desired actions.

    [1] create a picture of KING

    [2] create new Image of user selected KING

    Then simply use the following functions for the Vision Development Module in conjunction with the previous to your application examples:

    -IMAQ ColorImageToArray

    -IMAQ ImageToArray

Maybe you are looking for

  • Install Windows 98 SE on Toshiba Portege 300ct

    Greetings,Im stuck on this one, I got a Portege 300ct a friend that I use for two-way radios program. It is running Windows 98 Second edition with problems. This computer has no FDD but I have the docking station with CD player. I reformatted the dri

  • Satellite Pro L40 PSL43E - need drivers for sound card for XP

    Bought the PSL43E model Toshiba Satellite Pro L40, configured with Vista. Our Application does not work on Vista, had to downgrade to XP Pro. Impossible to find suitable Sound Driver for XP Pro. Any suggestions?

  • HP G72 laptop: HP G72 DNS

    I checked a jury back and applied the information given, and I always feel a DNS error message. I'm not able to use Internet on my laptop and I use my phone, so apologies for not being able to show my specific settings.However, I am able to connect t

  • bypassing the shift registers

    As a beginner, I was experimenting with loops and record the shift I had an add operation which added 1 whenever the origin and the results transmitted back via one all about register shift. Maybe I thought op amps at the time, but I thought why not

  • BlackBerry not detected Passport SIM card

    Hello I bought a BB passport of a friend a few weeks ago. He started to work perfectly, I like the phone, it has... Since 2 days... the nightmare began! SIM NOT DETECTED. No network... technical problem... My SIM card is new and I've tried it with ot