[ADF, JDev12.1.3] Manages the pageFlowScope same bean validation of the different fragments of BTF. Doubts about the 'object' and 'uiComponents' validator parms

Hallo,

I have a 'registration' process bounded with 4 fragments workflow.

There is in each fragment components entry created by dragging different fields of the same instance of VO.

The user cannot access the next step if the current step is not correctly filled.

In the fragment of 1st, the user chooses its type (customer, supplier,...) and in the following steps, the fields are has shown/Asterisk based on her user'type selected (I save the String bean var type managed pageFlowScope dedicated to the btf).

Because of this in the original Version, by the way the key, there is no other area marked as mandatory.

To manage the visibility of fields I set the property of rendering the fields (or their container) using EL expressions that read the type in the managed bean stream.

To manage the fields points, I thought only 2 solutions:

1)

For each field to create a validator that checks if the fied was flled and function in the formato (e.g. for emails) right in the successful flowScope bean. So I'll have so many validator functions as areas to manage.


2)

Create a unique global validator to which the property of the validator for all fields will point in the managed bean flowScope.

For example

public void myGlobalBtfValidator(FacesContext facesContext, UIComponent uiComponent, Object object) {
  if (uIComponet.getId() == "InputTextEmail") {  // Component is in Fragment_1
    // Check if the filed is filled and its format
  }
  if (uiComponet.getId() == "InputTextMobileNumber") {  // Component is in Fragment_2
    // Check if the filed is filled and its format
  }
  if (uiComponet.getId() == "InputTextAddress) {  // Component is in Fragment_3
    // Check if the filed is filled
  }
// ...
}

ID' would like to know if the 2nd solution might work and that is the approach recommended among them.

Then, I would like to know if I can use ther uiComponent parm to the validator without any problem. I ask this question because in many threads, I saw only the parm object used. What are the different function/purpose of these 2 settings?

Thank you

Federico

If you do not want to re-use these validators elsewhere in your application, then method unique validator will be enough.

Of course, if the implementation of this method only validator will require a huge amount of code, it is probably better to split this option to separate validator methods (to simplify the maintenance).

BTW, ID of component has to be short, so instead of using the id of the component, set f: attribute on each component of the user interface and to use uIComponet.getAttributes () .get ("attrib_name")

Dario

Tags: Java

Similar Questions

  • How do you manage the layers and objects and to rear of the other

    I do not understand how it is possible to have many objects on the stage and be able to handle the motion tweens with each of them, but ALSO to manage the objects are in front and behind them. I have a boot animation and there are many ongoing action, and there are times where I need my guys to be in front of the objects, and the time when they need to be behind.

    I do not know how to handle things regarding the layers and the movements in a way so I can get the items in the order that I need them to be (as the element on which passes in front of the other).

    Someone at - it advice or a way that I can manage my objects and queries and be able to classify them on the stage so that I can arrange things how I need them to be investment and who should be in front of the other objects?

    Yes, if you want to animate 20 items, you must put each item in its own layer. There are a number of ways to make it a little less tedious. For example, if you place each element on the stage, in the same layer, and then name each instance, you can then select all the elements on the stage and then select the Edit menu and then the timeline and finally distribute to layers. This will place each item in a layer newly created at the same position on the stage and then name each layer to match the name of instance for this element.

    To change the Z-order of any given scene element, you can use a number of different methods. One method is to use Actionscript as I mentioned in my last post. ActionScript is the best method if you need to be able to respond to user input and show the changes that cannot be built in animation since the beginning. If you're just showing an animation preset, you can use a number of methods different timeline based.

    In your example, if you want to have a figure to move another object on the stage, you can do that by creating two layers of the same object. One on one with the figure between the two. So that you have the object to move around both in front and behind, the figure. When you want to display the number in front of the object, set the object in the layer that is on top is not not visible. Then you will see only the object that is at the origin and the figure in front of him. How you go about changing the visible property or the alpha property, of this object. You can use keyframes in the timeline panel or the simple ActionScript.

    You want to find a small pool in the basics of Flash or take a book to guide you. There are a number of very good tutorials on the basic available free animation: http://www.gotoandlearn.com, or at a cost: http://www.lynda.com .

  • will never be an update where you can erase a background object of an image without clear photo behind the object and have the result as if the object was not always on the picture in the first place.

    Will never be an update where you can erase a background object of an image without clear photo behind the object and have the result as if the object was not always on the picture in the first place.

    I guess this feature without doubt not will be part of Lightroom because of the non-destructive nature publishing. Is that programs like Photoshop are for. But I don't speak for Adobe, because I do not work for them, and I did not all understand what are their plans for the future.

  • Grids of, how to place above the objects and placed images?

    PS the grid can be displayed above the jpegs allowing me to measure exactly, AI shows the grid below placed images and vector obects, which means that I am not the squares of the Board through the objects and images to place my other lines and shapes, is this possible? Place the rack over the objects and placed images?

    Yes. In the preferences: guides & grids: uncheck the box for the grids at the rear. easy.

  • [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

  • [ADF, JDev12.1.3] Mastering the form with detail tables: questions about Insertion/deletion, commit / rollback, primary key, handling,...

    Hallo,

    I have a panelTabbed with 4 tabs. In the 1st tab, there is a master form while each of the other tabs, there is a secondary table. Each tab "reads" vo.

    Please see here http://digilander.libero.it/flattit82/OTN_FILES/VoInTabs.png

    I created the graphichs/layout and now it's time to take care of the management of the transaction.

    In the master tab / form

    1)

    Here, I would put a button to remove the master record.

    When I delete a record in the primary table an automatism in the database (MS SQL Server) will automatically delete any registration which are linked to it in the detail tables.

    Could the automated system as this causes problems?

    In the Details tabs / tables

    2)

    I would put a button in each row to delete the line delivering. Can I just drag-and - drop, like button, af line: table the operation "Delete" of the VO istance detail used to create the af: table?

    3)

    If Yes, by clicking on the button performs the default delete operation. But if need to perform some actions before you run the deletion (or, in General, any other operation), how can I do?

    4)

    To create a folder that I use Create or CreateInsert? And what are the differences between them?

    5)

    When I create a new record I need set the value of a field of the VO on which is based the af: table. He filed, let's call it RowDetNumber, is not displayed in the af: table, because it doesn't have be filled in by the user. Mut value is calculated and set "secretly" before posting the new line to the database table. In particular, its value must be calculated as

    Select max (RowDetNumber) + 1

    of table_on_which_VO_is_based

    where some_conditions_on_fields_of_the_same_VO


    For example

    The VO selects all of the records that have FkId =: value. If value = 3, VO selection records:

    ID RowDetNumber OtherFields FkId

    1   3     1             ...

    2   3     2             ...

    3   3     3             ...

    4   3     4             ...

    The new record must be RowDetNumber = 5.

    I would like to know how permorm this.

    In general

    6)

    If the database tables have 1 or more triggers I have to take care of something?

    7)

    On the book "development of Web Applications with Oracle ADF Essentials - Sten E. Vesterli", I have read it could be problems when you use tables of database non-Oracle with auto-increment fields.

    The advice of author uncheck the 'Required' box in the model.

    All tables in my database have a primary keys that are auto-increment... so I uncheck the "mandatory"?

    8)

    In general how do I set these fields? I have to put in OT, VO or both?

    Thank you

    Federico

    Hello

    (1) you will need to re - question child iterators so that they do not look stale data

    (2) Yes. Ensure that the table is PPRed after deleting the line (should happen automatically if ChangeEventPolicy on iterator is set to ppr)

    (3) double click on the button and it creates a bean managed for you. It allows you to check a box to generate the code he would run to remove the line. Everything you put in front of the generated code is your code before

    (4) in the case of tables, use createInsert as it adds the new line to the rowset (transaction)

    (5) suggest to do this use a database trigger and the data attribute value DBSequence VO type

    (6) do not 'drop table' issue in SQL (sorry, couldn't resist ;-))

    (7) If you follow the advice of the author, Yes. What it does, I have it does not throw an exception if a value is missing in the validation of the line

    (8) usually you set whatever it is at the level of the OS and put only things on VO if you want to override the default value for a specific behavior


    Frank

  • Equium A100: How to manage the battery and the AC adapter

    Advice please...

    I use my laptop (A100) mainly as a desktop replacement. What should we do. the power supply cord. Leave it permanently, but don't damage the battery and the means of the laptop is permantly on standby, or constantly updated to recharge the battery every two hours, which is not very practical.

    First laptop, so probably stupid question.

    Hello

    There are different meanings to this topic.

    I manage like this:
    I work on the current, and sometimes only with the battery until it is almost empty. Then I charge the battery while he was still working on current alternative.

    After awhile of use, each battery life to shorten.

    Good bye

  • ADF does not work for the scans and faxes

    Hello:

    I have a HP 6500 has more and I am trying to fax a ton of papers.  I slide the papers, the tone and he pulls the sheet at all.  He died or can it be fixed.  Everything else works fine.  Printing, scanning dumpster, etc..

    Help!

    Thank you

    Hi again darrylweiss,

    I was in the same boat as you on a similar question and unfortunately, swearing and beating the printer has done nothing but work my bat and cost me a bunch of quarters on the jar to swear. I suggest that you contact HP Total Care at 1-800-474-6836, or if you are outside North America, you can Contact HP worldwide by clicking on this link.

    I thank very you much for your time.

    It has been a pleasure to work with you.

  • Beginner: how to manage the pipes and the semicolon with UNIX commands?

    Good afternoon
    I'm writing a Java class that allows to run UNIX commands.
    Launch of the simple commands (to date, ps - ef) works fine, but when I start using of pipes and the semicolon, it won't:
    Java (e.g. hoses) code:
            String command = "ps -ef | grep config";
            Process child = Runtime.getRuntime().exec(command);
    Result:
    usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
            [ -u userlist ] [ -U userlist ] [ -G grouplist ]
            [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
      'format' is one or more of:
            user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
            pri opri pcpu pmem vsz rss osz nice class time etime stime
            f s c lwp nlwp psr tty addr wchan fname comm args projid project
    Code Java (example of semicolon):
            String command = "date;ps -ef";
            Process child = Runtime.getRuntime().exec(command);
    Result:
    date;ps: not found
    Clearly the pipes and semicolons are managed by the UNIX shell and can be put in the Java source code as such.
    Does anyone know a way around this?
    Thank you
    Dominique

    Pipes and semicolons are interpreted by a shell (bash, csh, etc.) and when we execute as you do without shell is involved. It is easy to solve by using the alternative version of exec() which takes an array as an argument and use your shell of choice. For example: -.

    String[] command = {"bash", "-c", "date;ps -ef"};
    

    Note that the third argument is the entire order to be interpreted.

    Two points to consider. First you need to read, Digest and apply all the recommendations in http://www.javaworld.com/jw-12-2000/jw-1229-traps.html; otherwise will be at some point lead to a significant loss of hair. Secondly, you should probably use ProcessBuilder rather than Runtime.exec (). Behind the scenes, Runtime.exec () uses ProcessBuilder but ProcessBuilder provides a better interface with more features.

  • manage the text and the text box

    Hello

    I'm quite a newbye with illustrator and I have a simple question

    When I create a text box... If I change the shape of th ebox, for example I make it that the text disappears

    How to do the classic thing that the text resize according to the shape and size of the box?

    Thank you

    Stefano,

    Monika has kindly updated this exquisite available multilingual page:

    http://vektorgarten.de/Illustrator-polyglott.html

  • Edit the object and then save back causes the object to move?

    Hello

    I use Acrobat X 10.1.6 update. When you edit PDF documents in a right-click and then by selecting "Change the subject", I get my usual Illustrator pop-up window, change my color or anything else, save, moves back to Acrobat, and the object in question! This has only started happening recently and I have been using Acrobat on a daily basis in my work, as a device, since Acrobat 7 Professional prepress and never had this problem.

    Please tell us what is causing the object to move? I re-installed Acrobat today and being updated and no change. I also have several colleagues on the different versions of Acrobat from 9.5.3 to 10.1.6 who cannot reproduce this problem, even on the same PDF file?

    Thanks in advance.

    Tom.

    I have a feeling it may be a problem of Illustrator. That update?

  • Revolution of the object and the object Cube transitions do nothing?

    I love the transitions of the 'object' - Flip Object, object Pop, object Zoom, etc. But two transitions do not seem to do anything. Revolution of object (which is new) and the object Cube (which is not) do not seem to animate anything on the slide. Am I missing something?

    Both work fine on our systems at Yosemite

  • Race weight affecting the size of the object and alignment

    Hello

    I've recently upgraded to Illustrator 2015.3 and since I had a problem with the weight of the line.

    Normally, I draw a line that is 1 "wide and has a .5pt and align it to. 5" down and. 5 "on the left and when I reproduce them down each. 5 ", the next line reads to 1" high.  Now when I do she reading 1.1 "or 6p0.5.  Is there a setting somewhere that makes the x and the y axis read from the center of the line not the outside of the line?  This issue is also applying to the when I try to align a line to the top of a box, it aligns the line out of the stoke instead of the Center...

    Can anyone help?

    Toggle use Preview Bounds, in general preferences or the drop down palette alignment?

  • How to read the objects and collections dynamically?

    Hello
    I want to read database/collection objects dynamically. Please advice!
    Here is an example

    Create the user as an object type (name varchar2 (100), number (3)) of the age
    /

    create a family of fonts as a user table
    /

    I want to do something like this

    DECLARE
    user of the var;
    BEGIN
    ...
    ...
    SELECT "family (1)" INTO var FROM DUAL;
    ...
    ...
    END;
    /

    Thank you

    As I suggested, you can define your own method of "diff" for the object. You haven't told us exactly what form you would like to work to take. I'll define a (pretty useless) function which will just create a string that tells you how to modify the data of an object to match the data in another. Obviously, you would like a more useful output. Potentially, rather than a member function, you can choose a procedure Member who emits DML is required for the underlying table is necessary.

    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE TYPE location_typ AS
      2  OBJECT
      3  (
      4    building_no NUMBER,
      5    city        VARCHAR2(40),
      6    MEMBER FUNCTION diff(
      7                l location_typ)
      8    RETURN VARCHAR2
      9  )
     10* ;
    SQL> /
    
    Type created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE TYPE BODY location_typ
      2  AS
      3    MEMBER FUNCTION diff(
      4      l location_typ)
      5    RETURN VARCHAR2
      6    IS
      7      l_diff_str varchar2(4000);
      8    BEGIN
      9      IF building_no != l.building_no THEN
     10        l_diff_str := 'Building_no needs to change from ' || building_no ||
     11                         ' to ' || l.building_no;
     12      END IF;
     13      IF city != l.city THEN
     14        l_diff_str := l_diff_str ||
     15                        'City needs to change from ' || city ||
     16                          ' to ' || l.city;
     17      END IF;
     18      RETURN l_diff_str;
     19    END;
     20* END;
     21  /
    
    Type body created.
    
    SQL> DECLARE
      2    loc location_typ;
      3    secloc location_typ;
      4    a NUMBER;
      5  BEGIN
      6    loc    :=NEW location_typ(300, 'San Francisco');
      7    secloc :=NEW location_typ(200, 'Redwood Shores');
      8    dbms_output.put_line( loc.diff( secloc ) );
      9  END;
     10  /
    Building_no needs to change from 300 to 200City needs to change from San
    Francisco to Redwood Shores
    
    PL/SQL procedure successfully completed.
    

    Justin

    Published by: Justin Cave on 9 April 2012 14:12

  • Display of all the objects and the lines of Source Code

    I'm currently running OEM in 10 g and I have two questions:

    1. How can I find an object when I know the name, but not the object type? For example, to have the name of the object, but I don't know if it's a package, procedure, function or what. How can I get information about this object in OEM?

    2. when I'm compiling an object invalid such as a procedure and I get errors, the compiler displays the errors and line numbers. However, the source field does not display line numbers (like the old Java version OEM did). Is there a way to get the current line number?

    I can easily do both in SQL * more. I just want to know if OEM has these capabilities.

    Thank you!

    Regarding question No. 1:
    -good question! But there is no way to search an object without specifying the type of object

    HTH

Maybe you are looking for