Problem when overriding default skin of Flex

Hi all,
I tried to change the default style of Flex by redefining the css file. To Button, I add some different images to different status. Because Combo, ColorPicker are all inherited from Button, they all have the same style like Button has, even if I define new style for Combo as well.
How to avoid this scenario? What is the right way to overriding default skin?
Thanks and regards,
Yan

Hi there,
I played around with skinning a few months ago too but I didn't run over this problem. Check this article: http://www.adobe.com/devnet/flex/articles/flex_skins.html I don't know how are you replacing the default icons but what I did, was to build my skins from scratch with the help of the template of Flex skins for Photoshop, saved each skin as a .png file and everything worked fine.
With best regards,
Barna Biro
Blog: http://blog.wisebisoft.com

Similar Messages

  • JSF 1.1 - problem with overriding default messages with UTF8 ones

    Hi there,
    I'm stuck with JSF 1.1 for now (creating application that is to run on JBoss 4.0.x) and I've encountered a problem... My web application uses UTF8 encoding - so that's also encoding I need in my message bundle. I've created one - and here goes a problem. I need to put Polish special characters into a properties file of a bundle - so I do it with UTF escape notation:
    javax.faces.component.UIInput.REQUIRED=Warto\u009C\u00E6 dla pola {0} jest wymagana
    some.custom.message.CLOSED=zamkni\u0119taThe thing is - while custom messages are working properly, overriden javax.faces.component.UIInput.REQUIRED message is rendered on a page as four "strange" characters, suggesting that it was first interpreted as UTF, then parsed as some kind of an ASCII (ISO) encoding and then back to an UTF8 page...
    How to fix this?
    TIA,
    Wojtek

    IDE fooled me - it was smarter then I expected and properties editor was showing already decoded values, not raw content of file. It's working properly now

  • Audio Problems when setting default device

    Everytime I try to set my headphones as the default sound device, my computer won't allow me to. I even tried to troubleshoot it, and it came up with the resolution of setting my headphones as the default device, but it failed to due to an error.
    It only occurs whenever I use the program Mumble, as I am a gamer and I use it to communicate with my fellow gamers. So whenever I fire up the program, all other sound except what comes from it, goes to my speakers. I don't know if this has to do with the program Mumble itself, or the fact that I LITERALLY cannot change my default device. Please help?

    What version of Windows are you using? 
    Also, could you please give me the exact model number of your notebook?
    You can use the following document if you need assistance in finding it.
    http://h10025.www1.hp.com/ewfrf/wc/document?tmp_renderType=findModel&cc=us&dlc=en&docname=c00033108&...
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • Problem overriding default JSF conversion error messages

    Hello !
    I have a problem to override default JSF conversation error message. I have an inputText which is binded to BigDecimal attribute, so when I enter a character in that field I get this error message: "- Conversion failed."
    I think I need to register the message bundle in my faces config, and put the key of this error message to my properties file.. am I right ?
    Can somebody help me with this ? Which key I need to put into the properties file ?
    Miljan

    Get [Sun's Java EE tutorial |https://www.sun.com/offers/details/JavaEETutorial.xml?cid=20090723ZA_TACO_JVEE_0004] and read the relevant section so you don't have to guess what you need to do.

  • Problem when defaulting a value to the field

    Hi CRM Experts,
    I am new to CRM, i am facing a problem when defaulting a value to the field in the Tcode 'SOLMAN_WORKCENTER' (Solution Manager Server).
    when i am defaulting it is displaying fine in the view( Redefined the getter method there i passed the value), i set a break point in the getter method when i am executing the getter method i am unable to get the defaulted value in the importing parameter value, but i am getting the value here when i used to type manually in the filed, i cant understand why it is behaving like that? please can any body help in this regard...
    Thanks in advance
    Hari..

    There are other ways to get the string-value of an enum (format into string with a %s formatter for instance).
    But I have no idea what you are seeing.
    However I would not use the enum to string technique chose you have, just add the enum to the 'file' VI as an input.
    And the =0 comparison you have is useless, add the enum to the case structure as the selector.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Numeric character problems when creating spatial index

    Hi,
    We have run into a problem when trying to create spatial indexes. The problem seems to be that an mdsys-procedure tries to use a number with a comma as decimal symbol in an update statement
    Error message:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Stmt-Execute Failure: begin mdsys.prvt_idx.execute_update(NULL,NULL,'set sdo_rtree_quality = 1,00000000 where UPPER(sdo_index_owner) = UPPER(''BK'') AND UPPER(sdo_index_name)=UPPER(''TEST_RTREE_IDX'') AND UPPER(sdo_index_table)=UPPER(''MDRT_8120$'')',NULL); end;
    ORA-29400: data cartridge error
    ORA-01747: invalid user.table.column, table.column, or column specification
    ORA-06512: at "MDSYS.PRVT_IDX", line 17
    ORA-06512: at line 1
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 7
    ORA-06512: at line 1
    Our problem seems to be identical to the one discussed in this thread: create RTREE falied on 9.2.0.4
    Regional settings, language versions etc:
    Client:
    OS: Windows 2000
    Regional options (OS): Swedish, Sweden
    Sqlplus (console and windows versions): v 9.2.0.1.0
    Registry: NLS_LANG =SWEDISH_SWEDEN.WE8MSWIN1252
    Server:
    OS: Windows Server 2003
    Regional options (OS): Swedish, Sweden
    Oracle: v 9.2.0.3.0
    Registry: NLS_LANG =SWEDISH_SWEDEN.WE8MSWIN1252
    We have also tried building the indexes after overriding these settings by setting the environment variables NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 on both the client- and the server computer. This gives exactly the same error. We have tried setting NLS_NUMERIC_CHARACTERS to '.,' instead of ',.', but this does not help either.
    We haven't tried changing the NLS_LANG registry entry on the server, because this is a production server at a customer's site that hosts several other databases, so we would prefer not to have to restart it if we can avoid it. However, as we understand it, the environment variable NLS_LANG should override the registry setting anyway, right?
    We first experienced the problem when trying to build indexes on imported data. To verify that the problem was not with the data, we wrote a simple test script that:
    1)Creates a table
    2)Creates metadata
    3)Inserts a simple geometry
    4)Tries to create an index
    The error message above is from running this script. We have verified that the script
    works ok on another database server.
    Below are the values of some of the language parameters right before running the script
    (we have tried many other settings with the same result).
    parameter...........................db................................instance...............session
    NLS_CHARACTERSET.......WE8MSWIN1252..................................................
    NLS_LANGUAGE...............AMERICAN...................AMERICAN...........AMERICAN
    NLS_NCHAR_CH...............AL16UTF16 ..........................................................
    NLS_NCHAR_CONV... ......FALSE..........................FALSE..................FALSE..
    NLS_NUMERIC_CH...---------.,---------------------------------------------------------------.,
    NLS_TERRITORY..............AMERICA......................AMERICA..............AMERICA
    The guy who started the thread referenced above solved the problem, but we haven't been able to get it working by changing registry entries and session parameters.
    The question is: Which setting will make the number in 'set sdo_rtree_quality = 1,00000000...' be generated with a . instead of a , as decimal symbol?

    Ok, so here is my plan to solve this:
    1) Change the default user locale (the language under "standards and formats") to English for the account under which the Oracle server runs.
    2) Reboot (or is there an easier way to make Oracle reload the settings?)
    This should make the index creation work. It may break something else however, so to avoid this I can set the user locale back to Swedish afterwards .
    You can subsequently change the setting and update the sdo_rtree_quality in
    the metadata and it should work fine. Do you mean I have to update the sdo_rtree_quality in some way to make it work after I have changed the default user locale back to Swedish? How do I do this?
    Thanks a million both of you!

  • Problem when loading the form in workspace  ( LCES2  v9)

    Hey,
    I have a problem with some process .Each time I try to invoke it through the workspace I get this error (ALC-WKS-007-040).
    This is what I found in the server log .
    15:21:09,133 INFO  [STDOUT] [LCDS][ERROR] Exception when invoking service 'remoting-service': flex.messaging.MessageException: ALC-WKS-005-028: A problem occurred in the Render Service.  Please review the render orchestration for this process.
      incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
        operation = render
        parameters = [1FBED60E-CEFF-102D-B474-0000B88028EB, 503, 0, ASObject(519082525){acroClientType=, acrobatVersion=10}]
        clientId = E72502C6-A32E-5892-86F5-D3F3E21E0A9D
        destination = task-actions
        messageId = 1D1F80DC-242B-43D2-4499-0427FB490F03
        timestamp = 1292854869075
        timeToLive = 0
        body = null
        hdr(DSId) = E716F344-070B-158E-7EC5-BDC42A0017A6
        hdr(DSEndpoint) = workspace-polling-amf
      Exception: flex.messaging.MessageException: ALC-WKS-005-028: A problem occurred in the Render Service.  Please review the render orchestration for this process.
            at com.adobe.workspace.AssemblerUtility.createMessageException(AssemblerUtility.java:409)
            at com.adobe.workspace.tasks.TaskActions.render(TaskActions.java:764)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
            at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
            at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1406)
            at flex.messaging.AsyncMessageBroker.routeMessageToService(AsyncMessageBroker.java:571)
            at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
            at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
            at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
            at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
            at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
            at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:165)
            at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:293)
            at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:364)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at com.adobe.workspace.events.RemoteEventClientLifeCycle.doFilter(RemoteEventClientLifeCycle .java:138)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja va:179)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java: 157)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: ALC-DSC-012-000: com.adobe.idp.dsc.registry.ServiceNotFoundException: Service: Default Render ES Update1 not found.
            at com.adobe.idp.taskmanager.dsc.service.TaskManagerServiceImpl.renderForm(TaskManagerServic eImpl.java:4468)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
            at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(DocumentPassi vationInterceptor.java:53)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
            at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:357)
            at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doRequiresNew (EjbTransactionCMTAdapterBean.java:299)
            at sun.reflect.GeneratedMethodAccessor639.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:237)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:158)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:169)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:404)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:138)
            at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
            at org.jboss.ejb.Container.invoke(Container.java:960)
            at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
            at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
            at $Proxy376.doRequiresNew(Unknown Source)
            at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:143)
            at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:165)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
            at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:121)
            at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:129)
            at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:93)
            at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:19 8)
            at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:66)
            at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
            at com.adobe.idp.taskmanager.dsc.client.TypedTaskManagerService.invokeWithRetry2(TypedTaskMa nagerService.java:159)
            at com.adobe.idp.taskmanager.dsc.client.TypedTaskManagerService.invokeWithRetry(TypedTaskMan agerService.java:147)
            at com.adobe.idp.taskmanager.dsc.client.TypedTaskManagerService.callRenderService(TypedTaskM anagerService.java:1441)
            at com.adobe.workspace.tasks.TaskActions.render(TaskActions.java:731)
            ... 38 more
    Informations :
    I use Livecycle ES Version 9
    workbench 9.5
    and my process is long-lived
    I would be very grateful if you can tell me or offer me a solution to overcome this problem.
    Naoufal FAHEM

    Caused by: ALC-DSC-012-000: com.adobe.idp.dsc.registry.ServiceNotFoundException: Service: Default Render ES Update1 not found.
    This likely means you copied an older ES Update 1 process into your ES2 environment and did not do a migration.  There is a new set of Render and Submit processes for ES2 and your older process is referencing the set shipped with ES Update1. 
    Ideally, if you are trying to have a pure ES2 environment, then you should convert your processes to be ES2 processes (I believe there are docs to help with this) - I recommend this as it puts you in a cleaner position for future migrations. 
    But if you choose to keep it using the older Render and Submit processes, then you need to deploy the adobe-process-management-system.lca from the ES Update 1 environment.  You would do this in the Adminui where LCAs are deployed, but make sure you choose the LC8 LCA tab.
    Hope this helps.
    Jon

  • Calender overriding default alert settings in iOS

    Here's the problem: when I do an All Day Event in Calendar, something overrides my default Alert settings and sets and Alert for 9:00am the day before the All Day Event. I only want Alerts set on Events I choose, so I'm assuming that's why I have my defaults Everywhere (Mac, iPad, iPhone iPod Touch) set to None for Birthdays, Events, and All Day Events. Once the Alert sounds, if I go in to Edit the Event and delete the Alert, it does not recur if edited properly. (I do use multi-day All Day Events).
    This is most annoying, BTW. Because I trust these devices to be accurate and to do what I expect within their rather few limitations compared to the rest of the techno-device universe.
    What am I not doing? What should be undone?
    Thanks for any help.

    You can send Apple Feedback here: http://www.apple.com/feedback/

  • Problem when I execute program SCM in background

    Hi experts,
        I am with problem when I execute a program (SCM) in background. I inserted a new field (estoque_seg(10)) and the process stopped at execute in background.When I call transaction and press F8, works but for this, I need jump the consistence  IF sy-batch IS INITIAL....Dont has any bath imput, only functions. Any idea?
    Follow below the code:
    Estrutura para tabela ENTRADA
    DATA: BEGIN OF st_entrada,
            matnr(40)            TYPE c,
            werks(20)            TYPE c,
            ponto_abas(10)       TYPE c,
            estoque_max(10)      TYPE c,
            cobertura(10)        TYPE c,
            estoque_seg(10)      TYPE c, " Erlon Lourenço 20/01/2011
          END OF st_entrada.
    Estrutura para tabela de LOG
    *TYPES: BEGIN OF st_saida,
           pernr(8)             TYPE c ,
           date(10)             TYPE c,
           er_contribuition(15) TYPE c,
           tax(15)              TYPE c,
           msg_erro(80)         TYPE c,
         END OF st_saida.
    Tabela para obter descricao da mensagem
    *DATA: ti_saida TYPE STANDARD TABLE OF st_saida WITH HEADER LINE
                                                  INITIAL SIZE 0.
    Tabela que recebera o arquivo texto
    DATA: BEGIN OF ti_entrada OCCURS 0.
            INCLUDE STRUCTURE st_entrada.
    DATA: END OF ti_entrada.
    DATA: BEGIN OF it_matid OCCURS 0,
      matnr TYPE /sapapo/matkey-matnr,
      matid TYPE /sapapo/matkey-matid,
    END OF it_matid.
    DATA: BEGIN OF it_locid OCCURS 0,
      locno TYPE /sapapo/loc-locno,
      locid TYPE /sapapo/loc-locid,
    END OF it_locid.
    DATA: BEGIN OF it_matlotsz OCCURS 0,
      target_dur TYPE /sapapo/matlotsz-target_dur,
      END OF it_matlotsz.
    DATA:        wa_matloc       LIKE /sapapo/matloc   OCCURS  0 WITH HEADER LINE,
                 wa_matlsim      LIKE /sapapo/matlsim  OCCURS  0 WITH HEADER LINE,
                 wa_matlotsz     LIKE /sapapo/matlotsz OCCURS  0 WITH HEADER LINE.
    Variáveis Globais
    DATA: v_tabix   TYPE sy-tabix,
          v_vrsioid TYPE /sapapo/apo01-vrsioid,
          v_tam     TYPE i.
        Select-Options & Parameters
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_versao    TYPE /sapapo/apo01-vrsioex OBLIGATORY DEFAULT '000',
                 p_abas  AS CHECKBOX  ,
                 p_est   AS CHECKBOX  ,
                 p_cober AS CHECKBOX  ,
                 p_estsg AS CHECKBOX.   " ERLON LOURENCO - 20/01/2012 - Estoque Segurança
    SELECTION-SCREEN END OF BLOCK b1.
        Start-of-Selection
    START-OF-SELECTION.
      PERFORM consiste.
      PERFORM f_upload.
      PERFORM f_processa_batch.
      PERFORM f_saida_dados.
      MESSAGE i000 WITH 'Processo encerrado com Sucesso'.
    END-OF-SELECTION.
    *&      Form  F_UPLOAD
          text
    -->  p1        text
    <--  p2        text
    FORM f_upload .
      DATA: lc_file TYPE string.
      TYPES: BEGIN OF st_ent,
                cam(80),
             END OF st_ent.
      DATA: ti_ent TYPE STANDARD TABLE OF st_ent WITH HEADER LINE
                                                  INITIAL SIZE 0.
      RANGES: r_file       FOR zget0001-field_content.
      r_file[] = zbs_constantes=>obter( i_bukrs = space i_field = 'FILE' i_process = 'PONTO-REAB' ).
      READ TABLE r_file INDEX 1.
      lc_file = r_file-low.
      CLEAR: ti_entrada,
             ti_entrada[],
             ti_ent,
             ti_ent[].
    abrir arquivo para leitura
      OPEN DATASET lc_file FOR INPUT  IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        MESSAGE i000 WITH text-e01.
        STOP.
      ENDIF.
    Leitura de arquivos
      DO.
        READ DATASET lc_file INTO ti_ent.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND ti_ent.
      ENDDO.
    Fechamento do arquivo
      CLOSE DATASET lc_file.
      LOOP AT ti_ent.
        SPLIT ti_ent AT ';' INTO ti_entrada-matnr ti_entrada-werks ti_entrada-ponto_abas ti_entrada-estoque_max ti_entrada-cobertura ti_entrada-estoque_seg.
        APPEND ti_entrada.
      ENDLOOP.
    ENDFORM.                    " F_UPLOAD
    *&      Form  F_PROCESSA_BATCH
          text
    -->  p1        text
    <--  p2        text
    FORM f_processa_batch .
      LOOP AT ti_entrada.
        v_tabix = sy-tabix.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-matnr
          IMPORTING
            output = ti_entrada-matnr.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-ponto_abas
          IMPORTING
            output = ti_entrada-ponto_abas.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-estoque_max
          IMPORTING
            output = ti_entrada-estoque_max.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-cobertura
          IMPORTING
            output = ti_entrada-cobertura.
    IA - ERLON LOURENCO - 20/01/2012
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ti_entrada-estoque_seg
          IMPORTING
            output = ti_entrada-estoque_seg.
    FA - ERLON LOURENCO - 20/01/2012
        MODIFY ti_entrada INDEX v_tabix.
      ENDLOOP.
      CLEAR: it_matid,
             it_matid[],
             it_locid,
             it_locid[],
             wa_matlsim,
             wa_matlsim[],
             wa_matloc,
             wa_matloc[].
      SELECT matnr matid INTO TABLE it_matid FROM /sapapo/matkey
      FOR ALL ENTRIES IN ti_entrada WHERE matnr = ti_entrada-matnr.
      SELECT locno locid INTO TABLE it_locid FROM /sapapo/loc
      FOR ALL ENTRIES IN ti_entrada WHERE locno = ti_entrada-werks.
      IF p_versao = '000'.
        LOOP AT ti_entrada.
          READ TABLE it_matid WITH KEY matnr = ti_entrada-matnr.
          IF sy-subrc = 0 .
            READ TABLE it_locid WITH KEY locno = ti_entrada-werks.
            IF sy-subrc = 0.
              SELECT SINGLE * INTO wa_matloc FROM /sapapo/matloc WHERE matid = it_matid-matid  AND
                                                                       locid = it_locid-locid.
              IF sy-subrc = 0.
                IF p_abas = 'X'.
                  wa_matloc-reord    = ti_entrada-ponto_abas.
                ENDIF.
                IF p_est = 'X'.
                  wa_matloc-maxstock = ti_entrada-estoque_max.
                ENDIF.
                " IA - Erlon Lourenço - 23/01/2012
                if p_estsg = 'X'.
                  wa_matloc-safty    = ti_entrada-estoque_seg.     " Erlon Lourenço - 23/01/2012
                endif.
                "FA - Erlon Lourenço - 23/01/2012
                IF p_abas  = 'X'   OR
                   p_est   = 'X'   OR
                   p_estsg = 'X'.      " Erlon Lourenço - 23/01/2012
                  APPEND wa_matloc TO wa_matloc.
                ENDIF.
                SELECT SINGLE * INTO wa_matlotsz FROM /sapapo/matlotsz WHERE lszid = wa_matloc-lszid.
                IF sy-subrc = 0.
                  IF p_cober = 'X'.
                    wa_matlotsz-target_dur = ti_entrada-cobertura.
                    APPEND wa_matlotsz TO wa_matlotsz.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDLOOP.   " LOOP AT ti_entrada.
      ELSE.
    Verifica versáo para saber se preenche a tabela wa_matlsim
        SELECT SINGLE vrsioid INTO v_vrsioid FROM /sapapo/apo01 WHERE vrsioex = p_versao.
        IF sy-subrc = 0.
          SELECT * INTO TABLE wa_matlsim FROM /sapapo/matlsim WHERE simid = v_vrsioid.
          IF wa_matlsim[] IS NOT INITIAL.
            LOOP AT ti_entrada.
              READ TABLE it_matid WITH KEY matnr = ti_entrada-matnr.
              IF sy-subrc = 0 .
                READ TABLE it_locid WITH KEY locno = ti_entrada-werks.
                IF sy-subrc = 0.
                  READ TABLE wa_matlsim WITH KEY matid = wa_matloc-matid
                                                 locid = wa_matloc-locid.
                  IF sy-subrc = 0.
                    wa_matlsim-reord    = ti_entrada-ponto_abas.
                    wa_matlsim-maxstock = ti_entrada-estoque_max.
                    wa_matlsim-safty    = ti_entrada-estoque_seg.     " Erlon Lourenço - 23/01/2012
                    MODIFY wa_matlsim INDEX v_tabix.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDLOOP.  " LOOP AT ti_entrada.
          ENDIF.     " IF wa_matlsim[] IS NOT INITIAL.
        ENDIF.     " IF sy-subrc = 0. 1º
      ENDIF.     "IF p_versao = '000'
    Funcáo que atualiza campos nas bases de dados.
      CALL FUNCTION '/SAPAPO/DM_PRODUCTS_POST'
        EXPORTING
          iv_vb         = 'U'
        TABLES
          it_matloc     = wa_matloc
          it_matlsim    = wa_matlsim
          it_matlotsz   = wa_matlotsz
        EXCEPTIONS
          not_qualified = 1
          insert_failed = 2
          update_failed = 3
          OTHERS        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " F_PROCESSA_BATCH
      FORM  BDC_DYNPRO
    *&      Form  F_SAIDA_DADOS
          text
    -->  p1        text
    <--  p2        text
    FORM f_saida_dados .
    IF ti_saida[] IS NOT INITIAL.
       DATA: lc_file TYPE string.
       lc_file = p_erros.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
      BIN_FILESIZE                    =
           filename                        = lc_file
      FILETYPE                        = 'ASC'
         TABLES
           data_tab                        = ti_saida
      FIELDNAMES                      =
        EXCEPTIONS
          file_write_error                = 1
          no_batch                        = 2
          gui_refuse_filetransfer         = 3
          invalid_type                    = 4
          no_authority                    = 5
          unknown_error                   = 6
          header_not_allowed              = 7
          separator_not_allowed           = 8
          filesize_not_allowed            = 9
          header_too_long                 = 10
          dp_error_create                 = 11
          dp_error_send                   = 12
          dp_error_write                  = 13
          unknown_dp_error                = 14
          access_denied                   = 15
          dp_out_of_memory                = 16
          disk_full                       = 17
          dp_timeout                      = 18
          file_not_found                  = 19
          dataprovider_exception          = 20
          control_flush_error             = 21
          OTHERS                          = 22
       IF sy-subrc <> 0.
         MESSAGE i005 WITH 'Error to unload file !'.
         STOP.
       ENDIF.
    ENDIF.
    ENDFORM.                    " F_SAIDA_DADOS
    *&      Form  CONSISTE
          text
    -->  p1        text
    <--  p2        text
    FORM consiste .
      IF p_abas  IS INITIAL  AND
         p_est   IS INITIAL  AND
         p_cober IS INITIAL AND
         p_estsg IS INITIAL.   " ERLON LOURENCO - 20/01/2012 - Estoque Segurança
        MESSAGE i000 WITH text-e03.
        STOP.
      ENDIF.
      IF sy-batch IS INITIAL.
        MESSAGE i000 WITH text-e02.
        STOP.
      ENDIF.
    Best regards,
    Erlon Lourenço
    Edited by: Erlon Louren on Jan 27, 2012 11:09 AM

    Hi Raja,
                Check weather there are  any enhancements to the datasource.If yes once check the code in CMOD.Seems there is some discrepency in that.
    Regards
    Karthik

  • Service entry problem when not accepted

    We have a problem when there are multiple service entries agains a PO. There are no problems when we do the first entry and accept. The problem happens when we do a second entry and the end user only saves and forgets to accept the SES. When they do an invoice against this unaccepted SES the system brings in the previous SES number, when this goes unnoticed the vendor gets paid twice for the same thing. Is there a way for SAP to look at the SES field in the invoice and determine that this SES number has already been paid? Thanks in advance.

    Hi Eric,
    please try the following: check in transaction XK02 the field "Check Flag for Double Invoices or Credit Memos" (LFB1-REPRF).
    Indicator which means that incoming invoices and credit memos are checked for double entries at the time of entry.
    In checking for duplicate invoices, the system compares the following characteristics by default:
    Vendor
    Currency
    Company code
    Gross amount of the invoice
    Reference document number
    Invoice document date
    If all of these characteristics are the same, the system issues a message that you can customize.
    The system only checks for duplicate invoices in Materials Management if you enter the reference document number upon entering the invoice.
    Of course if the invoice document date is different, there is no message M8108 issued. Please read also the notes 305201 and 308008.
    I would recommend you to use the service based invoice verification function (set the field EKPO-LEBRE to X) in the PO item.
    Regards,
    Edit

  • JTable sorting - problem when adding elements (complete code inside)

    I�m writing this email with reference to a recent posting here but this time with the code example. (I apologize for the duplicated posting � this time it will be with the code)
    Problem: when adding more elements to the JTable (sorted) the exception: ArrayIndexOutOfBoundsException is thrown.
    Example: If the elements in the table are 10 and then the user requests for 8 � the table will produce the correct result. However, if the user will ask for 11 items (>10) the exception will be thrown.
    The program: The program below (compiles and running). A JTable is constructed with 3 items, when you click the button - the return result should be 4 items - this will generate the error, WHY?
    I would highly appreciate your thoughts why this is happening and most importantly � how to fix it.
    Thanks a lot
    3 files:
    (1) TableSorterDemo
    (2) Traveler
    (3)TableSorter
    //TableSorterDemo:
    package sorter;
    import javax.swing.DefaultListModel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    * TableSorterDemo is like TableDemo, except that it
    * inserts a custom model -- a sorter -- between the table
    * and its data model.  It also has column tool tips.
    public class TableSorterDemo implements ActionListener
         private JPanel superPanel;
         private JButton clickMe = new JButton("click me to get diff data");
         private boolean DEBUG = false;
         private DefaultListModel defaultListModel;
         private JTable table;
        public TableSorterDemo()
             superPanel = new JPanel(new BorderLayout());
             defaultListModel = new DefaultListModel();
             init1();
            TableSorter sorter = new TableSorter(new MyTableModel(defaultListModel)); //ADDED THIS     
            table = new JTable(sorter);             //NEW
            sorter.setTableHeader(table.getTableHeader()); //ADDED THIS
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Set up tool tips for column headers.
            table.getTableHeader().setToolTipText(
                    "Click to specify sorting; Control-Click to specify secondary sorting");
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            superPanel.add("Center", scrollPane);
            superPanel.add("South",clickMe);
            clickMe.addActionListener(this);              
        public JPanel getPanel()
             return superPanel;
        public void init1()
             //in real life this will be done from the db
             Traveler a = new Traveler();
             Traveler b = new Traveler();
             Traveler c = new Traveler();
             a.setFirstName("Elvis");
             a.setLastName("Presley");
             a.setSprot("Ping Pong");
             a.setNumYears(3);
             a.setVegetarian(true);
             b.setFirstName("Elton");
             b.setLastName("John");
             b.setSprot("Soccer");
             b.setNumYears(2);
             b.setVegetarian(true);
             c.setFirstName("shaquille");
             c.setLastName("oneil");
             c.setSprot("Golf");
             c.setNumYears(22);
             c.setVegetarian(true);
             defaultListModel.addElement(a);
             defaultListModel.addElement(b);
             defaultListModel.addElement(c);
        public void init2()
             //in real life this will be done from the db
             Traveler d = new Traveler();
             Traveler e = new Traveler();
             Traveler f = new Traveler();
             Traveler g = new Traveler();
             d.setFirstName("John");
             d.setLastName("Smith");
             d.setSprot("Tennis");
             d.setNumYears(32);
             d.setVegetarian(true);
             e.setFirstName("Ron");
             e.setLastName("Cohen");
             e.setSprot("Baseball");
             e.setNumYears(12);
             e.setVegetarian(true);
             f.setFirstName("Donald");
             f.setLastName("Mac Novice");
             f.setSprot("Vallyball");
             f.setNumYears(1);
             f.setVegetarian(true);
             g.setFirstName("Eithan");
             g.setLastName("Superstar");
             g.setSprot("Vallyball");
             g.setNumYears(21);
             g.setVegetarian(true);
             defaultListModel.addElement(d);
             defaultListModel.addElement(e);
             defaultListModel.addElement(f);
             defaultListModel.addElement(g);            
        class MyTableModel extends AbstractTableModel
             private DefaultListModel myModel;
             public MyTableModel(DefaultListModel m)
                  myModel=m;
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            public int getColumnCount()
                return columnNames.length;
            public int getRowCount()
                return myModel.size();
            public String getColumnName(int column)
                 return getNames()[column];             
             public String[] getNames()
                  String[] names = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
                  return names;
            public Object getValueAt(int row, int col)
                 return distributeObjectsInTable(row, col, (Traveler) myModel.elementAt(row));
            public Object distributeObjectsInTable(int row, int col, Traveler tr)
               switch(col)
                         case 0:
                              return tr.getFirstName();
                         case 1:
                           return tr.getLastName();
                      case 2:
                           return tr.getSprot();
                      case 3:
                           return new Integer(tr.getNumYears());
                      case 4:
                           return new Boolean (tr.isVegetarian());
                     default:
                         return "Error";
            public Class getColumnClass(int c)
                return getValueAt(0, c).getClass();
        private static void createAndShowGUI()
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableSorterDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableSorterDemo newContentPane = new TableSorterDemo();
            newContentPane.getPanel().setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane.getPanel());
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args)
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable()                   
                public void run()
                    createAndShowGUI();
         public void actionPerformed(ActionEvent ae)
              if (ae.getSource()==clickMe)
                   defaultListModel.removeAllElements();
                   init2(); //if the size of the model was less than 2 items - the result will be ok.
                              //in other words, if you commens the last 2 rows of this method (addElement(f) & g)
                             // the result will be fine.
                   table.updateUI();          
    }//(2) Traveler
    package sorter;
    public class Traveler
         private String firstName;
         private String lastName;
         private String sprot;
         private int numYears;
         private boolean vegetarian;
         public String getFirstName()
              return firstName;
         public String getLastName()
              return lastName;
         public int getNumYears()
              return numYears;
         public String getSprot()
              return sprot;
         public boolean isVegetarian()
              return vegetarian;
         public void setFirstName(String firstName)
              this.firstName = firstName;
         public void setLastName(String lastName)
              this.lastName = lastName;
         public void setNumYears(int numYears)
              this.numYears = numYears;
         public void setSprot(String sprot)
              this.sprot = sprot;
         public void setVegetarian(boolean vegetarian)
              this.vegetarian = vegetarian;
    }//(3)TableSorter
    package sorter;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    public class TableSorter extends AbstractTableModel {
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator() {
            public int compare(Object o1, Object o2) {
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator() {
            public int compare(Object o1, Object o2) {
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter() {
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel) {
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader) {
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState() {
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel() {
            return tableModel;
        public void setTableModel(TableModel tableModel) {
            if (this.tableModel != null) {
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null) {
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader() {
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader) {
            if (this.tableHeader != null) {
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer) {
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null) {
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer(
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer()));
        public boolean isSorting() {
            return sortingColumns.size() != 0;
        private Directive getDirective(int column) {
            for (int i = 0; i < sortingColumns.size(); i++) {
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column) {
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column) {
            return getDirective(column).direction;
        private void sortingStatusChanged() {
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null) {
                tableHeader.repaint();
        public void setSortingStatus(int column, int status) {
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE) {
                sortingColumns.remove(directive);
            if (status != NOT_SORTED) {
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size) {
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE) {
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting() {
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator) {
            if (comparator == null) {
                columnComparators.remove(type);
            } else {
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column) {
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null) {
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType)) {
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel() {
            if (viewToModel == null) {
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++) {
                    viewToModel[row] = new Row(row);
                if (isSorting()) {
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
            return getViewToModel()[viewIndex].modelIndex;
        private int[] getModelToView()
            if (modelToView == null) {
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++) {
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount() {
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount() {
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column) {
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column) {
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column) {
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column) {
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column) {
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable {
            private int modelIndex;
            public Row(int index) {
                this.modelIndex = index;
            public int compareTo(Object o) {
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();) {
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null) {
                        comparison = 0;
                    } else if (o1 == null) {
                        comparison = -1;
                    } else if (o2 == null) {
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0) {
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener {
            public void tableChanged(TableModelEvent e) {
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting()) {
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null) {
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter {
            public void mouseClicked(MouseEvent e) {
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1) {
                    int status = getSortingStatus(column);
                    if (!e.isControlDown()) {
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon {
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority) {
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y) {
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth() {
                return size;
            public int getIconHeight() {
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer {
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column) {
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive {
            private int column;
            private int direction;
            public Directive(int column, int direction) {
                this.column = column;
                this.direction = direction;
    }

    The table listens to the TableModel for changes. Changing the table by adding/removing
    rows or columns has no affect on its table model. If you make changes to the table model
    the table will be notified by its TableModelListener and change its view. So tell
    MyTableModel about the change of data:
    public class TableSorterDemo implements ActionListener
        MyTableModel tableModel;
        public TableSorterDemo()
            defaultListModel = new DefaultListModel();
            init1();
            tableModel = new MyTableModel(defaultListModel);
            TableSorter sorter = new TableSorter(tableModel);
        public void actionPerformed(ActionEvent ae)
            if (ae.getSource()==clickMe)
                defaultListModel.removeAllElements();
                init2();
                tableModel.fireTableStructureChanged();
    }

  • ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate

    ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate a form.
    1) Created a FORM on EMP using the wizards. This creates an AUTOMATIC ROW FETCH
    TABLE NAME - EMP
    Item Containing PRIMARY KEY - P2099_EMPNO
    Primary key column - EMPNO
    By default the automatic fetch has a ‘Process Error Message’ of ‘Unable to fetch row.’
    2) Created a HTML region. Within this region add
    text item P2099_FIND_EMPNO
    Button GET_EMP to submit
    Branch Modified the conditional branch created during button creation to set P2099_EMPNO with &P2099_FIND_EMPNO.
    If I then run the page, enter an existing employee number into P2099_EMPNO and press the GET_EMP button the form is populated correctly. But if I enter an employee that does not exist then I get the oracle error ORA-01403: no data found and no form displayed but a message at the top of the page ‘Action Processed’.I was expecting a blank form to be displayed with the message ‘Unable to fetch row.’
    I can work around this by making the automated fetch conditional so that it checks the row exists first. Modify the Fetch row from EMP automated fetch so that it is conditional
    EXIST (SQL query returns at least one row)
    select 'x'
    from EMP
    where EMPNO = :P2099_EMPNO
    But this means that when the employee exists I must be fetching from the DB twice, once for the condition and then again for the actual row fetch.
    Rather than the above work around is there something I can change so I don’t get the Oracle error? I’m now wondering if the automatic row fetch is only supposed to be used when linking a report to a form and that I should be writing the fetch process manually. The reason I haven’t at the moment is I’m trying to stick with the automatic wizard generation as much as I can.
    Any ideas?
    Thanks Pete

    Hi Mike,
    I've tried doing that but it doesn't seem to make any difference. If I turn debug on it shows below.
    0.05: Computation point: AFTER_HEADER
    0.05: Processing point: AFTER_HEADER
    0.05: ...Process "Fetch Row from EMP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:EMP:P2099_EMPNO:EMPNO
    0.05: Show ERROR page...
    0.05: Performing rollback...
    0.05: Processing point: AFTER_ERROR_HEADER
    I don't really wan't the error page, either nothing with the form not being populated or a message at the top of the page.
    Thanks Pete

  • The concurrent io problem when using RandomAccessFile

    Hi:
    In my application,I have to export the tomcat log(the log file like "localhost_access_log.2010-10-13") to database and the do some analisis.
    My way:
    start to export log at 00:05:00 every day,at this moment just read the log whose date before yesterday.
    For example,at 2010-12-12 00:05:00,the log of 2010-12-11... 2010-12-01 ..2010-11-12...(just check the nearest 30 days).
    All of these data are put into one table named "log".
    If log of one day is exported successfully,insert one record to another table named 'logrecord'.
    //main code fragment:
         public void start() {
              //start the push export work once the server startup.
              run();
              //start the schedule work
              new ScheduledThreadPoolExecutor(5).scheduleAtFixedRate(this, getStartTime(), 24 * 3600,
                        TimeUnit.SECONDS);
         //return the left time(from now to 00:05:00 of tomorrow)
         private long getStartTime() {
              Date d = new Date();
              long t = (DateUtil.getNextDayAtMiddleTime(d).getTime() - d.getTime()) / 1000 + 300;
              return t;
         @Override
         public void run() {
              Date days[] = DateUtil.getSeveralDayRangeByTime(30); //just the nearest 30 days.
              for (Date d : days) {
                   if (exist(d)) {
                        continue;
                   exportLogByDate(d);
    It works for now expect we can not anlyzer data of today.
    However we need it now.
    As far as I thought,I want to create a new table which owns the same structure of the former table "log" used to hold the log of "today" only.
    At 00:05:00 of every day,after the normal log exporting(export the nearest 30 days'log but today),export the log of today.
    It sounds easy,read the content,parser,filter,insert,just like what I did.
    But,the tomcat log file is saved by day.So in my normal log exporting,the log file(nearest 30 days) are not be used by tomcat,I can open/close it as I like.
    However if I tried to read the log of today,since the log file maybe used by tomcat for inserting log.
    I prefer to use the RandomAccessFile to read the log of today:
    But I am coufused by the concurrent io problem:what is going on if I am reading a line while tomcat is writing the line?
    Here is my test exmaple:
    package com.test;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    import org.junit.BeforeClass;
    import org.junit.Test;
    public class TestMain {
         private static File          file;
         private static long          pos; //record the position of last time
         private static Thread     writterThread;
         @BeforeClass
         public static void init() {
              file = new File("D:/random.txt");
              // build the thread for simulating the tomcat write log
              writterThread = new Thread(new Runnable() {
                   @Override
                   public void run() {
                        FileWriter fw;
                        try {
                             fw = new FileWriter(file);
                             BufferedWriter bw = new BufferedWriter(fw);
                             int i = 0;
                             while (true) {
                                  i++;
                                  bw.append(i + " added to line...");
                                  bw.append("\r\n");
                                  bw.flush();
                                  Thread.sleep(5000);
                        } catch (IOException e) {
                             e.printStackTrace();
                        } catch (InterruptedException e) {
                             e.printStackTrace();
         @Test
         public void testRandomRead() throws IOException, InterruptedException {
              writterThread.start();
              try {
                   RandomAccessFile raf = new RandomAccessFile(file, "r");
                   String line;
                   while ((line = raf.readLine()) != null) {
                        System.out.println(line);
                   pos = raf.getFilePointer();
                   raf.close();
                   // read the file by 30 seconds within 2 min,just for test)
                   for (long m = 0; m < 1000 * 60 * 2; m += 30000) {
                        raf = new RandomAccessFile(file, "r");
                        raf.seek(pos);
                        while ((line = raf.readLine()) != null) {
                             System.out.println(line);
                        pos = raf.getFilePointer();
                        raf.close();
                        Thread.sleep(30000);
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
    The normal output is something like:
    1 added to line...
    2 added to line...
    3 added to line...
    4 added to line...
    5 added to line...
    However I always get the following output:
    1
    added to line...
    2 added to line...
    3 added to line...
    4 added to line...
    5
    added to line...
    That's to say,the RandomAccessFile is reading the line which has not been completed by tomcat.
    So,I have two questions now:
    1) How about my normal log exporting? Is there anything can be improved?
    2) How to slove the concurrent io problem when export log of today?

    Peter Lawrey wrote:
    You can;
    - check the length to see if it has grown since the last time it was written to. If it has shrunk, start from the start of the file.
    - if longer, open the file from the last point read.
    - read the text up to the last newline in the file. (might be no new lines)
    - close the file and remember where you were up to. (the start of the last incomplete line.
    - wait a bit and repeat.But how to decide if one line is completed?
    Also,how about if the randomaccessfile can not stop?
    For example,start the work at 02:00,it read the tomcat log file line by line and export them to db,and during this time,the tomcat keep writing log to the same file(user request the server all the time), and then the randomaccessfile will keeping reading accordingly,when it is 03:00,the last task is not completed,but a new task should start,how to control this?

  • When using Skype my IPad sounds like ocean. This is not a problem when I am on FaceTime or using other apps with sound.  Recently updated to newest IOS 7. First there was no sound for Kype and found that had to turn microphone sound on.

    When using Skype my IPad 2 now sounds like the ocean and I can barely here my contact.  This happened recently after IOS7 update. I did turn the microphone on for Skype as it was required after update.  Now my sound is terrible but only a problem when using Skype video call.  It is okay for FaceTime.

    Thank you!  Resetting resolved the issue with terrible sound when trying to use skype.  Sounds much better! 
    I am not sure what all changed when reset was applied to settings --- assume it defaults back to basic settings.  I have no idea what I had customized, so will slowly figure out.  I have noticed several things.  So far I had to add back my wallpaper and reenter password to get back on my wi-fi. 
    At least SKYPE is now audible.

  • InProgress.mxml_I got this when went to build a flex 4 (FB4) WEB APP

    a)
    Flash Builder could not publish the project source: The application file "InProgress.mxml" was not found.
    The application file "InProgress.mxml" was not found.
    I got this when went to build a flex 4 (FB4) WEB APP? FOR FINAL RELEASE as FIRST TIME do this.... WELL WHERE ERROR?
    b)
    <s:Button label="Flex Grocer" x="5" y="5"
                      click="handleFlexGrocerClick( event )"
                      skinClass="skins.HomeButtonSkin"/>
    in this button how appear a mouse tool tip text, when mouse is over the BUTTON?

    /Library/Rapport/*/librooksbas.dylib
    Uninstall Trusteer software
    http://www.trusteer.com/support/uninstalling-rapport-mac-os-x
    If that does not help, turn off extensions and test.
    Safari > Preferences > Extensions

Maybe you are looking for

  • How do I use my iCloud vacation responder for all of my email addresses that feed into my iCloud account?

    I have 3 email addresses that feed email into my iCloud account. I am going on vacation and would like my auto-responded to reply to ALL of the incoming emails in my account. When I test the vacation preference, it only automatically replies to me @m

  • Problem in converting value in UTF-8

    Hello experts, I have to store my textfields value in UTF-8 format. Whenever I inserted the qury write the following code for converting into UTF-8 fromat. But its store in like. e.g. बीड format for "बीड" value. I want to insert as like I am typing i

  • Use ipod to replace deleted mp3s onto computer??

    i deleted a large amount of mp3s from my macbook, which now show up in itunes with exclamation points next to them and are unplayable (when i search for them, a message pops up saying that they can't be found). however, my library is still intact on

  • Oracle 8.1.7...Apache up...IIS5 disappeared

    Hi, Sorry, do not know where to post this question..... Problem: Great !!!. Oracle 8.1.7 / Forms / Designer installed but MS IIS5 is gone / overwritten due to installation of Apache 1.3 ?!?! Basics: W2K (development) machine basic configuration: SP1

  • Best practice for Source NATTING ?

    Is there a general design rule for configuring source NATing ? Is it best to configure the CSS is one/two armed mode. What are the perfomance limitations in doing this ? Can soure NATed and non source NATed content rules be configured on the CSS with