JSF global messages - generic render

Hi, in JSF when have global messages displayed inline.
I would like to go for each message in messages and check its type.
From its message type, if its info, display a blue background. If error type message, display the message background to say pink red (i.e another color)
Thinking it can be done generically in a render phase. Some code sample on how to do this by overwriting and providing the message render enchancements
Thanks
Abraham

use errorStyle/errorClass or fatalStyle/fatalClass and so on ...

Similar Messages

  • Global Messages are not being shown ??

    After an action, I am adding a global message to inform the user it was successful as such:
            String message = "Successfully created ticket.  ID# " + id;
            FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO, message,""));
            return "success";However, after being redirected, the messages box never gets the message, although, the message is added correctly, as shown in the log:
    2006-04-19 14:50:57,086 DEBUG [com.sun.faces.context.FacesContextImpl] Adding Message[sourceId=<<NONE>>,summary=Successfully created ticket.  ID# 1)
    2006-04-19 14:50:57,086 DEBUG [com.sun.faces.application.ViewHandlerImpl] URL pattern of the FacesServlet executing the current request .jsf
    2006-04-19 14:50:57,086 DEBUG [com.sun.faces.application.NavigationHandlerImpl] Redirecting to path /TechDesk/main/requests/requestListing.jsf for outcome success and viewId /main/requests/requestListing.jspHere is my messages declaration in the redirected /main/requests/requestListing.jsp
    <h:messages showDetail="true" showSummary="true" globalOnly="true"/>Can anyone tell me what I'm doing wrong?? The messages gets populated, as shown in the logs, but it never gets displayed in the messages box.
    Thanks so much!

    Okay, it seems to get lost in the redirection. If I add the messages box directly on the same page with a return value of "null" (return to the same page), the messages box gets populated.
    However, after getting redirected, I seem to be losing the FacesContext. I thought the FacesContext is created per request, so shouldn't it be available after a redirect?

  • Global Messages with h:messages tag.

    hi,according to the documentation of jsf1.1, global messages are those messages that are not associated with any client identifier, which means, messages that are not associated with any UIComponent. At the mean while, the [b]for attribute is mandatory for the h:message tag. so it means that global messages are not specified by the JSF page programmers. so how are these message produced? and what are they used for?
    Best Regards

    For example if you are using backing bean and there is error you want to show globally, without showing for any particular field then you can have something like this in backing bean
    catch (Exception e1) {
                        facesContext.addMessage(
                             null,
                             new FacesMessage(
                                  FacesMessage.SEVERITY_INFO,
                                  "Unable to Add User." + e1,
                        return "AddUser";
    And to show this message, you have have something like this in your page.
    <h:panelGrid width="100%" columns="1" border="0">
                        <h:messages layout="table" styleClass="errorMsg" id="allMsg"
                             showDetail="false"></h:messages>
                   </h:panelGrid>

  • Hiding global messages

    Hi,
    Do you know where the global messages are stored? warning, information and error messages. I would like to hide the one of the warning messages on TPMOE->TradepromotionOP. I found one generic class for messages where I could remove one message, but did not work.
    ZL_MKTPRJ_P_BSPWDCOMPONE0_IMPL->AUTOPROCESS_MESSAGES
    Yes, I could use cl_crm_bol_core and access the message service and delete the required message. But I would like to use some common class for message where I can manipulate with messages.
    Thanks,
    Praveen

    There is a hack that might work for you. Wrap the af:messages in a div with its style set to display:none. So
    <div id="sdsd" style="display:none">
        <af:messages id="m1" globalOnly="false" inline="true"/>
    </div>

  • Error: There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 5015. SQL 2012 SP1

    Hi,
    Please help. I was trying to remove a SQL 2012 SP1 two node clustered instance using setup (Mantenance -> Remove Node)
    I started by doing this on passive node (and was successful) but when I ran setup on active node just before finishing successfully I got this error:
    TITLE: Microsoft SQL Server 2012 Service Pack 1 Setup
    The following error has occurred:
    The resource 'BCK_SG1DB' could not be moved from cluster group 'SQL Server (SG1DB)' to cluster group 'Available Storage'. 
    Error: There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 5015.
    Description: The operation failed because either the specified cluster node is not the owner of the resource, or the node
    is not a possible owner of the resource.
    For help, click:
    http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3000.0&EvtType=0xE8049925%25400x42B4DED7
    BUTTONS:
    OK
    I noticed that SG1DB instance was removed on both nodes but on Failover Cluster Manager -> Services and Applications the SQL server instance for SG1DB is still there. So I tried to delete it but got the error:
    Failed to delete SQL Server SG1DB. An error was encountered while deleting the cluster service or
    application SQL Server SG1DB. Could not move the resource to available storage. An error occured
    while moving the resource BCK_SG1DB to the clustered service or application Available Storage
    Any ideas why it failed or how could I delete the SQL server instance from Clauster?
    Thx

    Hello,
    Please read the following resource.
    https://support.microsoft.com/en-us/kb/kbview/313882?wa=wsignin1.0
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • JSF error messages

    has anybody successful using JSF error messages. Im using JSF portlet framework to display error msgs using h:messages tag. Im able to display validation/conversion errors with h:message tag.
    Im unable to display general messages that are result of an application exception. Has anybody ever done that?
    Help would be appreciated.
    Thanks
    -Sri

    If I understand you correctly ...
    FacesContext context = FacesContext.getCurrentInstance();
    FacesMessage message = new FacesMessage("New Message");
    context.addMessage(null, message);

  • Error Handler API: No proper Initialization of the global message list

    Hi All,
    I'm trying the following:
    1. Call of Web Service EGO_ITEM_PUB.PROCESS_ITEM for an already existing item 'CS_Test_Item_01' with parameters:
    +<soapenv:Body>+
    +<proc:InputParameters>+
    +<proc:P_API_VERSION>1.0</proc:P_API_VERSION>+
    +<proc:P_INIT_MSG_LIST>T</proc:P_INIT_MSG_LIST>+
    +<proc:P_COMMIT>T</proc:P_COMMIT>+
    +<proc:P_TRANSACTION_TYPE>CREATE</proc:P_TRANSACTION_TYPE>+
    +<proc:P_ITEM_NUMBER>CS_Test_Item_01</proc:P_ITEM_NUMBER>+
    +<proc:P_DESCRIPTION>Test</proc:P_DESCRIPTION>+
    +<proc:P_ORGANIZATION_ID>204</proc:P_ORGANIZATION_ID>+
    +</proc:InputParameters>+
    +</soapenv:Body>+
    Getting Response:
    +<OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/ego/soaprovider/plsql/ego_item_pub/process_item__1/">+
    +<X_INVENTORY_ITEM_ID xsi:nil="true"/>+
    +<X_ORGANIZATION_ID xsi:nil="true"/>+
    +<X_RETURN_STATUS>E</X_RETURN_STATUS>+
    +<X_MSG_COUNT>1</X_MSG_COUNT>+
    +<X_MSG_DATA xsi:nil="true"/>+
    +</OutputParameters>+
    2. Repeat Web Service Call EGO_ITEM_PUB.PROCESS_ITEM for already existing items 'CS_Test_Item_02', 'CS_Test_Item_03' and 'CS_Test_Item_04'.
    3. Call of ERROR_HANDLER.GET_MESSAGE_LIST several times.
    Getting following sequence of responses:
    env:Body>
    <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/bom/soaprovider/plsql/error_handler/get_message_list/">
    <X_MESSAGE_LIST>
    <X_MESSAGE_LIST_ITEM>
    <ORGANIZATION_ID xsi:nil="true"/>
    <ENTITY_ID>ITEM</ENTITY_ID>
    <TABLE_NAME>MTL_SYSTEM_ITEMS_B</TABLE_NAME>
    <MESSAGE_NAME xsi:nil="true"/>
    <MESSAGE_TEXT>Item CS_Test_Item_02 already exists in the organization Vision Operations. Please use a different item name/number.</MESSAGE_TEXT>
    <ENTITY_INDEX>1</ENTITY_INDEX>
    <MESSAGE_TYPE>E</MESSAGE_TYPE>
    <ROW_IDENTIFIER xsi:nil="true"/>
    <BO_IDENTIFIER>ITM</BO_IDENTIFIER>
    </X_MESSAGE_LIST_ITEM>
    </X_MESSAGE_LIST>
    </OutputParameters>
    </env:Body>
    env:Body>
    <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/bom/soaprovider/plsql/error_handler/get_message_list/">
    <X_MESSAGE_LIST>
    <X_MESSAGE_LIST_ITEM>
    <ORGANIZATION_ID xsi:nil="true"/>
    <ENTITY_ID>ITEM</ENTITY_ID>
    <TABLE_NAME>MTL_SYSTEM_ITEMS_B</TABLE_NAME>
    <MESSAGE_NAME xsi:nil="true"/>
    <MESSAGE_TEXT>Item CS_Test_Item_03 already exists in the organization Vision Operations. Please use a different item name/number.</MESSAGE_TEXT>
    <ENTITY_INDEX>1</ENTITY_INDEX>
    <MESSAGE_TYPE>E</MESSAGE_TYPE>
    <ROW_IDENTIFIER xsi:nil="true"/>
    <BO_IDENTIFIER>ITM</BO_IDENTIFIER>
    </X_MESSAGE_LIST_ITEM>
    </X_MESSAGE_LIST>
    </OutputParameters>
    </env:Body>
    env:Body>
    <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/bom/soaprovider/plsql/error_handler/get_message_list/">
    <X_MESSAGE_LIST>
    <X_MESSAGE_LIST_ITEM>
    <ORGANIZATION_ID xsi:nil="true"/>
    <ENTITY_ID>ITEM</ENTITY_ID>
    <TABLE_NAME>MTL_SYSTEM_ITEMS_B</TABLE_NAME>
    <MESSAGE_NAME xsi:nil="true"/>
    <MESSAGE_TEXT>Item CS_Test_Item_04 already exists in the organization Vision Operations. Please use a different item name/number.</MESSAGE_TEXT>
    <ENTITY_INDEX>1</ENTITY_INDEX>
    <MESSAGE_TYPE>E</MESSAGE_TYPE>
    <ROW_IDENTIFIER xsi:nil="true"/>
    <BO_IDENTIFIER>ITM</BO_IDENTIFIER>
    </X_MESSAGE_LIST_ITEM>
    </X_MESSAGE_LIST>
    </OutputParameters>
    </env:Body>
    env:Body>
    <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/bom/soaprovider/plsql/error_handler/get_message_list/">
    <X_MESSAGE_LIST>
    <X_MESSAGE_LIST_ITEM>
    <ORGANIZATION_ID xsi:nil="true"/>
    <ENTITY_ID>ITEM</ENTITY_ID>
    <TABLE_NAME>MTL_SYSTEM_ITEMS_B</TABLE_NAME>
    <MESSAGE_NAME xsi:nil="true"/>
    <MESSAGE_TEXT>Item CS_Test_Item_02 already exists in the organization Vision Operations. Please use a different item name/number.</MESSAGE_TEXT>
    <ENTITY_INDEX>1</ENTITY_INDEX>
    <MESSAGE_TYPE>E</MESSAGE_TYPE>
    <ROW_IDENTIFIER xsi:nil="true"/>
    <BO_IDENTIFIER>ITM</BO_IDENTIFIER>
    </X_MESSAGE_LIST_ITEM>
    </X_MESSAGE_LIST>
    </OutputParameters>
    </env:Body>
    Conclusion:
    * The global message list isn't deleted at the beginning of a 'Process Item' transaction (although P_INIT_MSG_LIST is set to 'T')
    * The global message list always contains the error messages of last three transactions.
    * When trying to get the corresponding error message(s) for a 'Process Item' transaction by calling GET_MESSAGE_LIST, I always get an older message of one of the previous transactions (always the third oldest). Only on the third call of GET_MESSAGE_LIST I get the correct error message(s).
    Does anybody know this behaviour and can help me with this?
    Thanks,
    Carolin
    Edited by: 788963 on 06.10.2010 01:47

    Annotation:
    This behavior is only observed when calling ERROR_HANDLER web services.
    I just tried the same in the PL/SQL context -> this time everything works OK.
    Any ideas?
    Carolin

  • JSF global navigation rules in taskflows

    Hi all,
    I am trying to create a taskflow as a replacement for old JSF pageflow diagram in a project and i need something to replace JSF global navigationm rule. For instance i want to be redirected to a page that is a taskflow default-activity from some other page in a taskflow. Several pages in a taskflow have same page template and a command link in a template that redirected me to a start page. How can i achieve this with taskflow?

    user590082,
    The easiest way to achieve this pattern is to declare a view activity in the master adfc-config.xml file. Then, within the page associated with the view activity in the master config file create a region that displays the taskflows you created. This allows the parent page to contain global navigation links as well as the template for your application and you can isolate biz logic and other common functions within in the taskflows displayed in the region. Hope that helps.
    --Ric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • JSF error message - retain ?

    HI all,
    i am using jsf <h:messages />. its getting cleared, if i click a commandlink which shows a popup div. That popup div is rendered in a bean.
    How to retain the error messages after getting the response.
    Samething happened when i change a select option which processes in valueChangeListener. After Changes made in Select option (getting the response) how to retain the error message ?
    Help me. Thanks in advance.
    Srinivas.R

    Thanks for ur replies.
    i am using tomahawk div (t:div) to show a
    small popup div when the user clicks a link. for
    changing Serial id (for my application) which calls
    backing bean for rendering & perform action
    regarding.
    Also when the Country select option changed, i
    am populating relavant state list in another select
    component, its internally calling backing bean. this
    also clears the error messages.
    How to retain the error messages without changing
    this business.At this point you are pretty much outside the regular functionality provided by JSF. I still think the best approach will be to eliminate the reloading of the page. You could accomplish this via AJAX. There are a few libraries out there for using AJAX with JSF; ajax4jsf for sure and I think JBoss Seam, RichFaces, ICEFaces, Trinidad and I'm sure I missed some.

  • ADF RC  - how to implement global messages

    Hi,
    I'd like to write global messages class shared by all application. It should be fired for all COMMIT (obviously without exceptions) operation and display following message:
    If user made any changes - <strong>"Changes have been commited"</strong>
    If user press commit without any changes - <strong>"There are no changes to save"</strong>
    It also would be nice to get a message when user insert or change in form and wants to leave page without commiting. He should get confirmation window with info:
    <strong>"You have uncommited changes. What dou you want to do:"</strong> and buttons:
    - <strong>Continue</strong> (Changes will be lost)
    - <strong>Don't leave a page</strong>
    I've seen similar solution in applications created in Jheadstart. Has anyone implemented this ?
    Kuba
    Edited by: KUBA on Nov 7, 2008 11:25 AM
    Edited by: KUBA on Nov 7, 2008 2:27 PM

    I think the simplest approach would be to create a custom subclass of DCJboDataControl (which also requires defining a custom data control factory subclass) and overriding the commitTransaction() method.
    For example:
    package test.view.binding;
    import oracle.adf.model.bc4j.DataControlFactoryImpl;
    public class CustomDCJboDataControlFactory extends DataControlFactoryImpl {
        protected String getDataControlClassName() {
          return CustomDCJboDataControl.class.getName();
    }and
    package test.view.binding;
    import java.util.HashMap;
    import oracle.jbo.common.ampool.SessionCookie;
    import oracle.jbo.uicli.binding.JUApplication;
    public class CustomDCJboDataControl extends JUApplication {
        public CustomDCJboDataControl() {
           super();
        public CustomDCJboDataControl(SessionCookie sessionCookie)
           super(sessionCookie);
    }Then you use the custom data control by configuring your factory in the dataControlUsage element in the DataBindings.cpx file like:
      <!-- etc. -->
      <dataControlUsages>
        <BC4JDataControl id="DepartmentsModuleDataControl" Package="test.model"
                         FactoryClass="test.view.binding.CustomDCJboDataControlFactory"
                         SupportsTransactions="true" SupportsFindMode="true"
                         SupportsRangesize="true" SupportsResetState="true"
                         SupportsSortCollection="true"
                         Configuration="DepartmentsModuleLocal" syncMode="Immediate"
                         xmlns="http://xmlns.oracle.com/adfm/datacontrol"/>
      </dataControlUsages>
      <!-- etc. -->

  • Web.de lost all my emails can I merge an old global-messages-db.sqlite with my current one?

    When I check my old global-messages-db.sqlite file from my windows backup the emails still semm to be in there, can I somehow merger/ extract these mails into my current account?
    Best regards,
    temps

    global-messages-db.sqlite is a search index. It doesn't contain entire messages.
    Restore a recent backup of your profile folder instead.

  • Thunderbird is indexing every time I click on a message (slow). I've deleted global-messages-db.sqlite. compacted. let it rebuild the db. Version 24.4

    thunderbird is indexing every time I click on a message (slow). I've deleted global-messages-db.sqlite. compacted. let it rebuild the db. Version 24.4
    McAfee shield stays busy the entire time it's indexing. I also deleted about 80% of the messages it was trying to reindex. No joy.
    Thanks

    I have been having this same problem: but it does not appear to have been due to my antivirus (Comodo). In my case the system is not just slow: the indexer seems to hang permanently. I suspected file corruption in one of my inboxes. But, whereas the Activity Manager gives the name of the sub-folder it is currently working on, it does not appear to report the name of the inbox.
    So to trace the corrupt file I had to keep moving emails from my inboxes to sub-folders until the system was able to give me the name of the sub-folder it was working on. Then, by shuffling emails between folders, I was finally able to identify the offending message. This was extremely tedious and time-consuming, as I had to restart Thunderbird every time I did a reshuffle in order to re-initialise the indexing process. The culprit turned out to be a copy of a phishing email I had previously reported. I'm guessing it contained intentionally bad data that confused the indexing system.
    However, it seems that this wasn't the only corrupt file: so I've yet to test all my other inboxes when I've got several more hours available,
    A problem like this would be much easier to trace if the indexer always clearly identified which folder it was examining or attempting to index, e.g. by prefixing the inbox with the mailbox folder name. That way one could tell immediately which inbox or sub-folder was the source of the problem.

  • AvailableDisk.AddToCluster() throwing System.Management.ManagementException with message generic failure

    I am trying to add available disk to cluster using c# wmi calls. I have generated the class with visual studio.
    Disk is added to cluster successfully . But in the end it is throwing exception.
    System.Management.ManagementException was unhandled by user code
      HResult=-2146233087
      Message=Generic failure  
      Source=System.Management
      StackTrace:
           at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
           at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
           at CloudStack.Plugin.WmiWrappers.ROOT.MSCLUSTER.AvailableDisk.AddToCluster(String ResourceName, String& Path) ROOT.MSCluster.MSCluster_AvailableDisk.cs:line 919
                

    Hi,
    The issue is related to C# language, I suggest you ask for help from MSDN forum for better and accurate answer to the question.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • JSF Rendering messages component

    Hi All,
    I am having a t:messages tag on my jsf page which displayes all the error messages
    I want to make it fixed size possible by placing it in a textarea, Can i do this ?
    There is an attribute layout to t:messages tag which supports table and list but is there a way to render these ?
    when i set the style attribute or use the styleClass attribute it is applied only to the span tag ( which is generated by t:messages tag ) but not to either table or list, Can anyone suggest a way to do this
    Do get back to me if i am not clear
    Thanks in advance

    While this is in no way complete, you can check out my check list for Iin my opinion) a good overview of what it takes to write a JSF component:
    http://blogs.steeplesoft.com/2006/12/14/jsf-component-writing-check-list/
    The Burns/Schalk book, JavaServer Faces:  The Complete Reference (http://tinyurl.com/2ndoye) is also an excellent resource. If you can be patient, you might also keep on eye on java.net, as Ken Pauslen (of JSFTemplating and GlassFish fame) and I will have an article coming out on this very topic.

  • 12c design view of JSF page fails to render with 'Loading failed  Reason: Connection reset by server'

    When in the design view of a JSF page, the page never renders in JDeveloper 12c.  Instead I get an error message 'Loading failed   Reason: Connection reset by server'.  I traced this to a conflict with the port used by Cisco Anyconnect (5001) which seems to be something JDeveloper uses as well to render the page.  Is there a way to change the port used to render the page in design mode?  I could not find any settings in the preferences.

    Hi Frank,
    The proxy settings are set to use the system default proxy settings in JDev and I have not needed to change it when VPN'ed. 
    The product that is in conflict is the 'AnyConnect Web Security Agent' (acwebsecagent.exe) which runs whether I am on vpn or am in the office - it is listening on port 5001 and that is the same port jdev64w.exe is listening to when rendering the page in the design mode.  I confirmed this using netstat -ab.  After  getting the conflicting program switched off temporarily, the design mode of the page was rendered within the IDE so that I could then drop components on the design surface.
    Since I cannot get the Cisco product to listen on a different port, I am hopeful there is a way to modify the port used by JDev.
    Thanks,
    Sunil

Maybe you are looking for