Could anyone give an validator example?

<af:inputText label="name" validator="#{localTest.validateName}" id="message"/>
<af:message for="message"/>
<af:commandButton action="home" text="submit"/>
public void validateName(FacesContext facesContext, UIComponent uIComponent,
Object object) {
// Add event code here...
facesContext.addMessage("message", new FacesMessage(FacesMessage.SEVERITY_ERROR,"str1","str2"));
what i want is if validation failed, action for commandButton submit should not be executed, but it does.
so how to use validator properly? how did managed bean know whether validation succeed or failed, cause no boolean return from validation method.
JDev: 11g
Thanks.
Kevin.

Hi Kevin,
You can use following code:
public void validateName(FacesContext facesContext, UIComponent uIComponent, Object object) {
    // Add event code here...
    FacesMessage mess = new FacesMessage();
    mess.setSummary("Validation summary message");
    mess.setDetail("Validation detail message");
    mess.setSeverity(FacesMessage.SEVERITY_ERROR);
    throw new ValidatorException(mess);
}Tomek

Similar Messages

  • Can anyone give me an example for crm_svy_..._pai?

    Hi all, I have a survey, there are several questions. After I input the answers, I click the 'CHECK' button, I will check the answers. There will be different response to my answers. If the answer is not correct, I will post an error message.
    And I also need to retrieve data from tables to fill the blank.
    I am a beginner for CRM survey, can anyone help me? I create a FM:crm_svy_..._pai, and code in it right? But how can I do it?
    Can anyone give me an example for crm_svy_..._pai to do what I need?
    Many many thanks in advance!! 
    Heare is an example, but I don't its function and how does it work..
      read table lt_all_values into ls_value
                               with key answer_id = 'get_value'.
      if sy-subrc = 0.
        data: lt_values type crm_svy_api_string_t.
        append ls_value-value to lt_values.
        call method ir_survey_values->values_set
          exporting
            i_question_id = 'set_value'
            i_answer_id   = 'set_value'
            it_values     = lt_values.
      endif.

    Hi Yu,
    Could you tell how you solved your issue?
    Regards and tx in advance,
    Mon

  • Can anyone give me an example of direct, queued and unserialized delta?

    hi all,
    Can anyone give me an example of direct, queued and unserialized delta for fi and sd applications.
    thanxs in advance
    regds
    hari

    hi,
    Update Methods,
    a.1: (Serialized) V3 Update
    b. Direct Delta
    c. Queued Delta
    d. Un-serialized V3 Update
    Note: Before PI Release 2002.1 the only update method available was V3 Update. As of PI 2002.1 three new update methods are available because the V3 update could lead to inconsistencies under certain circumstances. As of PI 2003.1 the old V3 update will not be supported anymore.
    a. Update methods: (serialized) V3
    • Transaction data is collected in the R/3 update tables
    • Data in the update tables is transferred through a periodic update process to BW Delta queue
    • Delta loads from BW retrieve the data from this BW Delta queue
    Transaction postings lead to:
    1. Records in transaction tables and in update tables
    2. A periodically scheduled job transfers these postings into the BW delta queue
    3. This BW Delta queue is read when a delta load is executed.
    Issues:
    • Even though it says serialized , Correct sequence of extraction data cannot be guaranteed
    • V2 Update errors can lead to V3 updates never to be processed
    Update methods: direct delta
    • Each document posting is directly transferred into the BW delta queue
    • Each document posting with delta extraction leads to exactly one LUW in the respective BW delta queues
    Transaction postings lead to:
    1. Records in transaction tables and in update tables
    2. A periodically scheduled job transfers these postings into the BW delta queue
    3. This BW Delta queue is read when a delta load is executed.
    Pros:
    • Extraction is independent of V2 update
    • Less monitoring overhead of update data or extraction queue
    Cons:
    • Not suitable for environments with high number of document changes
    • Setup and delta initialization have to be executed successfully before document postings are resumed
    • V1 is more heavily burdened
    Update methods: queued delta
    • Extraction data is collected for the affected application in an extraction queue
    • Collective run as usual for transferring data into the BW delta queue
    Transaction postings lead to:
    1. Records in transaction tables and in extraction queue
    2. A periodically scheduled job transfers these postings into the BW delta queue
    3. This BW Delta queue is read when a delta load is executed.
    Pros:
    • Extraction is independent of V2 update
    • Suitable for environments with high number of document changes
    • Writing to extraction queue is within V1-update: this ensures correct serialization
    • Downtime is reduced to running the setup
    Cons:
    • V1 is more heavily burdened compared to V3
    • Administrative overhead of extraction queue
    Update methods: Un-serialized V3
    • Extraction data for written as before into the update tables with a V3 update module
    • V3 collective run transfers the data to BW Delta queue
    • In contrast to serialized V3, the data in the updating collective run is without regard to sequence from the update tables
    Transaction postings lead to:
    1. Records in transaction tables and in update tables
    2. A periodically scheduled job transfers these postings into the BW delta queue
    3.This BW Delta queue is read when a delta load is executed.
    Issues:
    • Only suitable for data target design for which correct sequence of changes is not important e.g. Material Movements
    • V2 update has to be successful
    hope it helps
    partha

  • Suddenly all of my Office-programs have stopped working and will not launch on my MacBook. Could anyone give an amateur from Norway a hint of what may cause the problem? And I can not find the installation-disc for Office...Super! :)

    Suddenly all of my Office-programs have stopped working and will not launch on my MacBook. They were all already installed when I bought the computer. Could anyone give an amateur from Norway a hint of what may cause the problem? (And I can not find the installation-disc for the Office Programs...Super!)

    Have you contacted Microsoft support - http://www.microsoft.com/mac/support ? 

  • A java midi player for my JFrame - Could anyone give me a link

    Could anyone give me a link to a java.sun page about it, because i couldn't find one, otherwise, could someone make a small app that would play a midi.
    Thanks

    http://java.sun.com/javase/6/docs/api/javax/sound/midi/package-frame.html

  • Can anyone give me an example?

    I want to lucubrate M-UI ,CAN anyone give me an example just for my beginning?

    What is "lucubrate M-UI ,CAN"???
    CUL8er,
    Nick.

  • Am I right? could anyone give a better explanation?

    i have in my faces-config.xml:
    <managed-bean>
        <description>
          Cria    um Resgate
       </description>
        <managed-bean-name>exemplo</managed-bean-name>
        <managed-bean-class>pacote.Resgate</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
      <managed-bean>So what i understood is :
    I can access o object of Exemplo class through a bean with a :
    exemplo() put in a method of a bean.Is it right?
    and i can put a object bean exemplo as in a faces-config.xml with this piece of code, when i call this bean method:
    context()
                .getExternalContext()
                .getSessionMap()
                .put("exemplo", object);are all this right ? can anyone give a better clarifying?
    Thanks!!

    Yes! The jsf managed beans facility stores the bean in the session map. However its better to use ValueBinding:
    context.getApplication().createValueBinding("#{exemplo}");

  • Could anyone give me a list of all Macbook model and its fan capacity?

    Im using macbook pro 13' mid 2009 at the moment. Im getting sick of its one fan that make it getting hot easy. I am planning to buy a new macbook which has 2 fans and long battery span. Appreciate if anyone give me a list of all Macbook model that comes in with fans capacity. Full specification is accepted
    Thanks in advance.

    Look to the right of your post at the column, "More Like This." Other folks have had the same issues answered.

  • Can anyone give me an example of for all entries in case of inner join

    Hi abapers,
    I am trying to replace an inner join with for all entries.
    So kindly give me a demo code so that i can understand the use and apply it.
    And plz tell me in which case it is better to use for all entries and in which case to use inner join so that better performance will occur.
    With Regards
    Ansuman

    Hello Ansuman,
    For example:
    DATA:
      BEGIN OF fs_eket,
        ebeln LIKE ekko-ebeln,             " Purchasing Document Number
        ebelp LIKE ekpo-ebelp,             " Item Number of Purchasing Doc
      END OF fs_eket.                      " fs_eket
    DATA:
      t_eket LIKE                          " Purchase table
    STANDARD TABLE
          OF fs_eket.
    Using joins:
    select ebeln ebelp
    into corresponding fields of table t_eket
    from ekko join ekpo
    on ekkoebeln eq ekpoebeln
    where ebeln in s_sbeln.
    The select statement can be replaced by
    SELECT ebeln
      FROM ekko
      INTO CORRESPONDING FIELDS OF TABLE t_eket
    WHERE ebeln IN s_ebeln.
    IF sy-subrc EQ 0.
      sort t_eket by ebeln.
      SELECT ebeln
             ebelp
        FROM ekpo
        INTO CORRESPONDING FIELDS OF TABLE t_eket
         FOR ALL ENTRIES IN t_eket
       WHERE ebeln EQ t_eket-ebeln.
    The duplicate entries are removed by using FOR ALL ENTRIES. Or else by using the join, you have teh sort the table by key fields and then delete adjacent duplicates.
    Hope it helps you
    Regards
    Indu

  • Can anyone give me an example of a custom TableColumn

    I just can't get to grips with creating a custom TableColumn
    can somone give me a hand or a pointer to a tutorial, I just cant find one anywhere
    Thanks

    From that thread's description, I think everything you are asking to do can be controlled by the TableModel itself. The data, types, etc. (that are the data that drive the table) are all defined in your table model.
    Just subclass AbstractTableModel and implement the necessary methods. If while running, you change the # of columns, data types, etc. just fire the appropriate event from your TableModel fireTableStructureChanged(), etc. The columns, etc. will be rebuilt using the updated information from your table model. Not sure given your description if you will need to do any of that though. I think you can just extend the abstract table and with your own logic in getValueAt() to return the appropriate value from your data.
    Note that the table expects all of the data in a column to be the same type. If your underlying data may have values in different types (classes) you will need to convert them to something generic before returning them from your model (like as a String).
    Read up on this tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    You pretty much don't have to muck with the TableColumnModel stuff unless you want to do advanced/tricky things like provide a generic way to hide/show columns, etc.

  • Could anyone give me some pointers for my macbook hardware upgrade path?

    I have a few questions concerning my Macbook Pro 5,1. Firstly, I'd like to purchase a solid state drive to replace my existing 7200 rpm disk, and I'm not sure what interface I should purchase. System profiler lists my SATA controller as a MCP79 AHCI, with a 3 Gigabit link speed. What SATA standard does this correspond to?
    Secondly, what is the maximum amount of RAM that my motherboard can work with? I've seen reports of 8gb and of 6gb, so I'm not sure what to think.
    Finally, I would like to purchase an Optibay cradle for my existing hard drive, so I could have two disks in my computer at once. Would Apple provide me with service if I request them to install it for me?

    MacBook Pros have a SATA interface and use 2.5" notebook drives. Your model can support up to 8 GBs of RAM: 204-pin PC3-8500 (1066 MHz) DDR3 SO-DIMM.
    Apple will not install third-party hardware. You can purchase a DIY kit complete with tools from OWC that allows you to install an SSD in place of the optical drive. They are also an excellent source for RAM and hard drives.

  • Can someone pleas give me an example of a buton listener!

    I a newbie to java and have been using Java Programming for Dummies to learn java. Unfortunitely the book doesn't give an example of a button listener in a layout form so beginning java programmers can make their own button listeners. So, can anyone give me an example of a button listener I can personalize for my own applets?

    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*; // if it's to be an applet
    public class TestAButton extends Applet implements ActionListener {
    /* coding a Frame, don't implement ActionListener*/
    private Button okButton;
    public void init() {
    /* instead of a constructor for Frame*/
    okButton = new Butoon("OK");
    okButton.addActionListener(this);
    public void actionPerformed(ActionEvent evt) {
    Object source = e.getSource();
    if ( source == okButton) {
    doSomething();
    Good luck !

  • I am trying to import external CSS in Edge Animate, Has anyone got a "simple" example showing this working that I could have a look at?

    I am trying to import external CSS in Edge Animate, Has anyone got a "simple" example showing this working that I could have a look at?

    Hi Vivek,
    Thanks a lot for replying, actually i am creating a short LAMP animation. In which i used Blur filter on the fire flares(SVG images), everything works just fine on google chrome, but for IE10 & Firefox the filter seems not working, so i need to know is it possible to override the fallbacks for the Blur Filter through external StyleSheet.                            
    IE10 & firefox rendered Image, blur filter not working             Google Chrome rendered Image, blur filter working perfectly
    So, can you please guide me, what shall i do in maintaining quality of my graphics as well while such animation's.

  • Can anyone give me examples of replacement path with query?

    hi all,
    Can anyone give me examples of replacment path with query. if u have any docs pls send it across to my email id [email protected]
    thanxs
    hari

    Here is an example:
    Lets assume you have a characteristic( Say Project)  with about 30 attributes. now your requirement is to display all 30 attributes and about 10 keyfigures and another characteristic and it's attributes...
    If Project has about 25K projects in a Year,you will find its very difficult to diasply all the inofmation with one Query.(you may get disconnected from server after executing the query)..
    So firstly,create a Query1 only with Project and keyfigures.
    then create another Query2 only with Project and its attributes...here create a variable on Projeect with replacementpath and select the Query1.So you will have the Projects only from Query1.
    Create Query3 with Project and other chars.create one more variable on Project with replacementpath select Query1 result. So this Query also gets Projects from Query1...
    Now Query2 and Query3 get Projects from Query1 always...so you will have same Projects in your all 3 Queries..
    Now crate a workbook and insert 3 Queries.make sure you insert Query1 lastly.Since last inserted query will be executed first...
    You may use VBA or excel functionality if you want to see whole data in one sheet.
    Hope this helps.

  • Could you please give me an example of reconcilation and consolidation for

    Hi all:
    could you please give me an example of reconcilation and consolidation for ODS?
    Thank you very much1

    could you please give me an example of reconcilation and consolidation for ODS?
    like we can take example like this.
    from different data sources we get data in to one dso and consolidate the data before making availabe to reporting.
    we will remove duplicates if any,

Maybe you are looking for

  • Interest calculation on vendor open items

    Dear Freinds, I am trying to calculate Interest on open vendor items. t code F.4B Sys. is given below message, pl advise, i am stuck up.Config has been done , but still the problem remains <u><b>No list generated Message no. 02005 Diagnosis You may h

  • How to privacy text as header in csv file

    how to add some privacy text ex:@copyright as header of csv file. when we down load as the report in csv format.

  • Vedor Report

    Hi Gurus, I received the confirmation letter from vendor to confirm the ending balance and the list of the total transaction done in the whole year. is there any T-Code which can give me the report for all the transaction for a particular vendor for

  • Print booklet: pdf option?

    Hi, I'm using Adobe CC InDesign and I'm trying to "print" (save) a booklet but I only have the post script option and I want to save it as pdf to print it later. What can I do? Thanks

  • Audio Problem (Quicktime) in Snow Leopard

    Audio Problem in Snow Leopard After a install of Snow Leopard over the weekend, I have gotten everything smoothed out except for 1 item. I can not get Quicktime to install. I did the additional software instals that came on the DVD with SL. I now do