Help: Problem with data types and classes

Hi there,
I'm currently struggling with getting a class to read in data from a file and from that select the correct constructor to use... Basically I read a line in from a file as follows:
<String Make>:<String model>:<String registrationNumber>:<String engineSize>
e.g.
Ford:Focus:HG42EG:1800
There is an Interface called Car, of which 'Ford' is an implementation along with 'Vauxhall', 'Chrysler', etc...
From this I wish to construct a new instance of a Ford called Focus with input parameters (RegNumber registration,int engineSize) i.e.
Car Focus = new Ford(HG4 2EG,1800);So far I can convert the engineSize String into an integer and can construct the RegNumber (a class of mine) but can only get it to construct a Ford by using a switch, i.e:
switch (modelKey){
case 'f': new Ford(); break;
case 'v': new Vauxhall(); break;
case 't': new Toyota(); break;
etc...
Now I do get this to work correctly but I'm concerned that it is not OOP therefore is the way I can get code to convert the String 'Ford' into Car 'Ford'.???
Many thanks in advance for any advice you can throw my way,
Leebo

What is this anyway???
If Car is an interface you can't create instances of it....No, if Car is an interface, his code should be (depending on what the RegNum constructor looks like:
Car Focus = new Ford(new RegNum("HG42EG"),1800);It's the same as:
List someList = new ArrayList();However, he won't be able to use a word read from the file as a variable name "Focus". He'll need a Map:
Map myCarMap = new HashMap();
myCarMap.put("Focus", new Ford(new RegNum("HG42EG"), 1800));(Could be defined as "Map<String, Car>" if he wants to use generics.)

Similar Messages

  • Problem with Date Picker and wwv_flow_item.date_popup()

    I have a Report based on the HTMLDB How-To “Build Tabular Forms for Multi-Row Operations”
    This is my code:
    select
    X.RRIT_UID,
    X.DOS,
    X.CPT_CODE,
    X.MOD,
    X.DX_CODE,
    X.CHARGES,
    X.UNITS
    from
    (select
    htmldb_item.text(1,RRIT_UID) RRIT_UID,
    wwv_flow_item.date_popup(2,null,RRIT_DATE_OF_SERVICE) DOS,
    htmldb_item.text(4,RRIT_SUBMIT_SERVICE_CODE,6) CPT_CODE,
    htmldb_item.text(5,RRIT_SUBMIT_MODIFIER,3) MOD,
    htmldb_item.text(6,RRIT_ATT_DIAG_CODE,6) DX_CODE,
    htmldb_item.text(7,RRIT_BILLED_CHARGES,9) CHARGES,
    htmldb_item.text(8,RRIT_UNITS,3) UNITS
    from
    RRIT_REPRICE_ITEM
    where
    RRRR_UID = :P5_RRRR_UID
    union all
    select
    htmldb_item.text(1,null) RRIT_UID,
    wwv_flow_item.date_popup(2,null,null) DOS,
    htmldb_item.text(4,null,6) CPT_CODE,
    htmldb_item.text(5,null,3) MOD,
    htmldb_item.text(6,null,6) DX_CODE,
    htmldb_item.text(7,null,9) CHARGES,
    htmldb_item.text(8,null,3) UNITS
    from
    dual)
    X
    My problem is when I run the page and select a date from the Pop-Up calendar I get this error:
    Line 10
    Error: ‘opener.document.forms.0.f02.0’ is null or not an object
    I know it is something to do with data formats and the fact that I do not fully understand the use of wwv_flow_item.date_popup().

    Hi DK,
    It is a WD Java application, Backend is ABAP (MM module).
    The UI is input field, where the context attribute type is Date, So its been changed to Date Picker.
    The problem is when the user runs the WD application in Portal, The calendar format is being changed for some users. That is for few users the Week starts with Monday and for few users the week starts with Sunday.
    I need all the users to have Monday as the First day of the week.
    Please let me know, what will be solution for this.
    Since I haven't done anything in regard to date, it is a simple Date format.
    Thanks & Regards,
    Palani

  • Problems with date types

    Hi guys,
    i have a question regarding oracle and java dates. In my database i have a column defined as oracle Date type.
    In my java application i need to compare these dates with the date took from the system.
    In order to do this i use the SQL function to_char which converts the oracle data type to the type string.After this, i use the java class DateFormat to convert the strings to the java date type.When i have java dates i can do operations on them easly. My question is how i can realize the opposite process.For example, when i have updated a date with java, what i can do is converting it to a string, but then how the date could be converted in Oracle date type? (The attribute in my entity object is defined as oracle date )
    Thank you

    ADF use oracle.jbo.domain.Date, so you need to convert from java.util.Date and vice versa.
    from oracle Date to java Date:
    new java.util.Date(((oracle.jbo.domain.Date) oDate).dateValue().getTime());
    from Java Date to oracle Date
    new oracle.jbo.domain.Date(new Timestamp(date.getTime()));
    If you are using JClient, this is a big problem. We have simmilar challenges in the lack of DatePicker until we implemented it ourselves:
    http://www.inpowersoft.com/inpowerforms/demo/viewlets/datePicker.htm
    -Don

  • Problem with data type 'STRING'

    Hi All,
    I have created a table named as zproject_mat and there is a field 'LONG_D' for long description and its size is not limited, so i used 'STRING' data type for this field. But the problem is: when i use this field in where condition with 'SELECT QUERY'  in my abap program , it throws me an error..'The field long_d is a long string , so it cannot be used in WHERE, ON, or having conditions'.
    Can anyone help me regarding this. I dont know which data type will be suitable in both conditions, LONG DESC AND SELECT QUERY.
    Regards
    Rahul

    Hi Rahul,
    As mentioned your Table name is 'zproject_mat' and there is a field 'LONG_D'.
    The field 'LONG_D' will have a Data Element associated with it. Create a new input Data Element & Domain 'ZLONG' of Type CHAR with Length = 1100. This will used in the code.
    For the Table 'zproject_mat', you need to need to break up your field as 'LONG_D1', 'LONG_D2', ........, 'LONG_D5' with Data Element as 'BAPI_MSG'.
    To INSERT data in table:
    In your code, you need to write your logic where the field 'LONG_D' is SPLIT into 5 words and saved in your table against the 5 fields.
    To SELECT data from table:
    In your code, again you need to write your logic where the field 'LONG_D' is SPLIT into 5 words as abaove and pass them to your SELECT query...
    SELECT SINGLE *
    FROM zproject_mat
    INTO wa_zproject_mat
    WHERE long_d1 = v_split1
          AND long_d2 = v_split2........
         AND long_d3 = v_split3.
    The limitation of a table length is 4096 whereas of a field is 255 to make it RFC compatible. Table/Structure fields that are passed via RFC for integration have this limitation and to maintain database standards, these limitations exist.
    Hope this helps.
    Regards,
    Pranav.

  • Problem with Data Type

    Hi,
    I am performing SAP Production Order Confirmations (CO11N transaction) using an xMII BLT. In the CO11N screen, SAP doesn't let you type character values in the field 'Yield'. It is the same thing in xMII BLT where I have defined 'Yield' as the Data Type 'Double'. However, when I pass a character value for the input field 'Yield' from an Xacute query, I get the message 'Confirmation of order XXXXXXXX saved'. This is not correct because you can't have character values for the field 'Yield'. When I display the respective confirmation in SAP, the 'Yield' quantity is being shown as '0'. This is a discrepancy. To sum up, when you do a confirmation in the SAP screen CO11N it doesn't let you type a character value in the filed 'Yield' however, when you pass a character value from an Xacute query it accepts it as '0'. Can somebody tell me how I can fix this problem? Thanks.
    Regards,
    V M.

    V_M,
    The message 'Confirmation of order XXXXXXXX saved' is created within SAP, not from xMII.  So the input filtering and error handling in the BAPI itself is not designed correctly.  This is not all that unusual with BAPIs.  Rather than simply testing performance in CO11N, I usually start with BAPI Explorer and use the single test functionality. 
    This is not a bug in xMII, but rather the normal (albeit, invalid) performance of the BAPI.  It doesn't cause real problems within SAP since it records 0 (zero) as the quantity confirmed (Yield).  The corrective action would be a custom BAPI and/or enter a CSS ticket for the BAPI.  Remember that the BAPIs rarely (more likely, never) fully reproduce the internal functionality of the SAP screens.
    SAP has error handling built into their transactions such as CO11N which prevent invalid entries.  You may have to do the same in your transaction, web page, etc.
    Hope this helps,
    Mike

  • Problem with Data Model and Analysis View

    I create an analyze in BI Publisher and then i create a data model using this object.
    When i try to generate an XML with a number of rows the BI Publisher return an empty XML (Only with de DATA_DS tags but no data).   To bypass this problem i make and XML file by hand and this allow me to create reports and design it but when i try to view the reports i got the message that says "No Data Found".
    So i was check the analysis and all looks appears to be fine,  In the results tab it show me a complete table with the data i was looking to use.
    So i try to repeat the error and when  i try to create the XML for the Data Model i found this two error in the logs:
    [root@server ~]# [2013-07-17T16:37:22.844-04:00] [bi_server1] [WARNING] [] [oracle.xdo] [tid: 2361] [userId: <anonymous>] [ecid: ad7bb40a72b553c0:-3e5f91c5:13ecd037992:-8000-00000000000e2b34,0] [APP: bipublisher#11.1.1] Incomplete xslt._XDONFSEPARATORS: decimal separator: null, grouping separator: null
    [2013-07-17T16:37:26.828-04:00] [bi_server1] [WARNING] [] [oracle.xdo] [tid: 2361] [userId: <anonymous>] [ecid: ad7bb40a72b553c0:-3e5f91c5:13ecd037992:-8000-00000000000e2b3a,0] [APP: bipublisher#11.1.1] Incomplete xslt._XDONFSEPARATORS: decimal separator: null, grouping separator: null
    [2013-07-17T16:37:26.865-04:00] [bi_server1] [WARNING] [] [oracle.xdo] [tid: 2361] [userId: <anonymous>] [ecid: ad7bb40a72b553c0:-3e5f91c5:13ecd037992:-8000-00000000000e2b3a,0] [APP: bipublisher#11.1.1] oracle.xdo.servlet.CreateException: Path: /FOLDER/MODEL.xdm is not pointing to a report. Actual type: ReportItem, sub-type: DataModel[[
            at oracle.xdo.servlet.ReportException.fillInStackTrace(ReportException.java:124)
            at java.lang.Throwable.<init>(Throwable.java:196)
            at java.lang.Exception.<init>(Exception.java:41)
            at oracle.xdo.servlet.ReportException.<init>(ReportException.java:36)
            at oracle.xdo.servlet.CreateException.<init>(CreateException.java:18)
            at oracle.xdo.servlet.ReportRepository.getReport(ReportRepository.java:104)
            at oracle.xdo.servlet.ReportRepository.getReport(ReportRepository.java:128)
            at oracle.xdo.servlet.dataengine.DataProcessorFactory.getDataModelPath(DataProcessorFactory.java:207)
            at oracle.xdo.servlet.dataengine.DataProcessorFactory.isSemanticLayerDataModel(DataProcessorFactory.java:99)
            at oracle.xdo.servlet.dataengine.DataProcessorFactory.isSemanticLayerDataModel(DataProcessorFactory.java:78)
            at oracle.xdo.servlet.ReportModelContextImpl.getReportXMLData(ReportModelContextImpl.java:157)
            at oracle.xdo.servlet.CoreProcessor.process(CoreProcessor.java:346)
            at oracle.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:101)
            at oracle.xdo.servlet.ReportImpl.renderBodyHTTP(ReportImpl.java:1074)
            at oracle.xdo.servlet.ReportImpl.renderReportBodyHTTP(ReportImpl.java:639)
            at oracle.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:492)
            at oracle.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:462)
            at oracle.xdo.servlet.XDOServlet.doGet(XDOServlet.java:280)
            at oracle.xdo.servlet.XDOServlet.doPost(XDOServlet.java:313)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.xdo.servlet.metadata.track.MostRecentFilter.doFilter(MostRecentFilter.java:64)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:125)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.xdo.servlet.init.InitCheckingFilter.doFilter(InitCheckingFilter.java:63)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
            at java.security.AccessController.doPrivileged(Native Method)
            at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
            at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
            at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
            at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
            at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
            at java.security.AccessController.doPrivileged(Native Method)
            at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
            at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
            at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
            at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
            at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    And when i try to view the report that use the analysis i got this two warning in the logs:
    [2013-07-17T16:58:01.615-04:00] [bi_server1] [WARNING] [] [oracle.xdo] [tid: 57] [userId: <anonymous>] [ecid: ad7bb40a72b553c0:-3e5f91c5:13ecd037992:-8000-00000000000e2d7c,0] [APP: bipublisher#11.1.1] Incomplete xslt._XDONFSEPARATORS: decimal separator: null, grouping separator: null
    [2013-07-17T16:58:02.034-04:00] [bi_server1] [WARNING] [] [oracle.xdo] [tid: 57] [userId: <anonymous>] [ecid: ad7bb40a72b553c0:-3e5f91c5:13ecd037992:-8000-00000000000e2d84,0] [APP: bipublisher#11.1.1] Incomplete xslt._XDONFSEPARATORS: decimal separator: null, grouping separator: null
    As i understand there is has a reference to a null value but i cant find what column of the analysis has the problem.
    Any ideas about how to solve or debug this?
    Thanks

    I follow your instructions and it works fine. I can create the XML and the reports can show data.
    So, i already know that there is no problem with the data and with the BI Publisher installation but i still doesn know what is the problem with the analysis view that fails.
    Any idea how to debug it?
    Thanks.

  • Problem with data types

    Hello gurus!!
    We're having problems starting our WF because a requirement asked that all the prices must have decimals, so we changed the data types from number to dec, and the following error then appeared:
    Excepcion CREa20:Error al ejecutar el metodo Inicia WorkFlow del proxy WorkFlowHPProxy / java.rmi.RemoteException: Service call exception; nested exception is:      java.lang.Exception: Call to returned http code 500 (Internal Server Error) with unacceptable content type (text/html; charset=utf-8).<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode> soap:Server </faultcode><faultstring xml:lang="en"> RABAX occurred on server side </faultstring><detail><sap:Rabax xmlns:sap="http://www.sap.com/webas/710/soap/runtime/abap/fault/generic"><MESSAGE>The current statement requires a character-type data object.</MESSAGE><SYMSGID></SYMSGID><SYMSGTY></SYMSGTY><SYMSGNO></SYMSGNO><SYMSGV1></SYMSGV1><SYMSGV2></SYMSGV2><SYMSGV3></SYMSGV3><SYMSGV4></SYMSGV4><SYREPID>CL_SWF_CNT_SERVICE============CP</SYREPID><SYTCODE>                    </SYTCODE><SYDYNNR>0010</SYDYNNR><SYUNAME>UG_CREA20HP</SYUNAME><SYMANDT>135</SYMANDT><SYLANGU>E</SYLANGU><SYECODE>558</SYECODE><SYHOST>sapnwd01</SYHOST><SYSYSID>NWD</SYSYSID><SYOPSYS>SunOS</SYOPSYS><SYDBSYS>ORACLE</SYDBSYS><SYSAPRL>700</SYSAPRL><SYXPROG>SAPLTX_HANDLER</SYXPROG><SYXFORM>                              </SYXFORM><SYDATUM>20090805</SYDATUM><SYUZEIT>114750</SYUZEIT><SYETEXT>RABAX_STATE</SYETEXT><ERRORCODE>OBJECTS_NOT_CHARLIKE</ERRORCODE><PATHTRANS>/sap/bc/srt/rfc/sap/ZWAPI_CREA20_HP</PATHTRANS><MESSAGE>The current statement requires a character-type data object.</MESSAGE><ERRORCODE>OBJECTS_NOT_CHARLIKE</ERRORCODE></sap:Rabax></detail></soap:Fault></soap:Body></soap:Envelope>
    Any ideas would be appreciated.
    Regards IA

    Looks like you have a custom function that is returning this error. Why don't you try using a character type element instead of numerical or decimal.
    Derrick
    Banks & Company, LLC

  • Improving the LabVIEW Help: Working with Data Types

    Have you ever had trouble figuring out how to work with the waveform data type, the dynamic data type, or some of the other more complex data types in LabVIEW? As a tech writer on the LabVIEW team, I'd like to improve our documentation about working with data. What would you like to see? What would be helpful? Have you ever given up on a particular data type because it didn't work? Have you ever created a replacement data type because you preferred not to use a LabVIEW data type?
    Lacy Klosterman Rohre | Marketing Editor | National Instruments | 512.683.6376 | ni.com/newsletter

    I've been programming LabVIEW since around 3.1 / 4.0.  Over the years and versions, I've found it necessary to approach a lot of the new datatypes and algorithms with some healthy skepticism because I don't think we're usually given a "fair and balanced" overview.  Some of the things that are highly promoted that bring "ease of use" for beginners (and I *do* understand the importance of that when you're growing your LabVIEW user base) can carry significant performance penalties that are mentioned in more of a whisper, if at all.  I'd just like a more full disclosure of the tradeoffs -- the good, the bad, and the ugly.
    Waveforms -- very rarely use them, unless required for analysis functions.  I have a vague notion (between a belief and a memory) that they used to carry a significant performance penalty compared to arrays, but that the gap is now much smaller.  Still, I'm most comfortable with my old habit of using data arrays.  Some of this came about because a lot of my work uses counters where I may have a variable "dt" value or where my AI is clocked by a counter and the "dt" isn't internally generated.
    Dynamic signals -- have never used them.  Have no clear idea what good they're supposed to be, and they seem to be tied in primarily with Express VI's, which I have also studiously avoided.
    Variants -- Use them only slightly.  Performance issues are a question mark.  Exception: have learned that the implementation of Variant properties allows their use as an efficient way to create associates for string lookup tables. 
    Digital Waveform -- have typically avoided it except when graphing digital data during debug.  Haven't found any compelling reasons to use it.  I do like the notion of a compress/expand capability for sparse digital data, but haven't exercised it enough to trust the implementation. 
    Recap:  I don't need more simple "how-to's" in the help.  I need a LOT more "why bother's" that include both pros and cons. 
    -Kevin P.

  • Plugout paramter problem with data types

    Hello everyone,
    i have a problem passing parameters between webdynpro components. i am trying to pass paramters with type which is not a generic data type but an rfc data type.
    i am getting an error does someone has an idea hot to do it or how to pass a record and not just one veriable
    thanks
    asher

    Hi,
    This can be done using external context mapping. Refer the tutorials section.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial%20on%20server-side%20eventing%20-%2014.htm">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial%20on%20server-side%20eventing%20-%2014.htm</a>
    Regards,
    Mahesh K.

  • Problem with data table and internal and external command button

    thanks for your time,
    i have this problem
    <t:dataTable binding="#{manejadorAsociarEvaluadoresProyecto.tablaPosiblesEvaluadores}"
    cellpadding = "6"
    cellspacing = "3"
    value = "#{manejadorAsociarEvaluadoresProyecto.listaPosiblesEvaluadores}"
    var = "posibleEvaluador"
    preserveDataModel="false">
    <h:inputTextarea value="#{posibleEvaluador.correoActualCuerpo}"
    cols="50"
    rows="50"
    rendered="#{posibleEvaluador.detalle}" />
    <h:commandLink immediate="false" action="#{posibleEvaluador.editar}" value="Editar Correo"/>
    </t:dataTable>
    <h:panelGroup id="panelBotonEvaluadores" rendered="#{!manejadorAsociarEvaluadoresProyecto.b_mostrarEvaluadores && manejadorAsociarEvaluadoresProyecto.tieneProyectos}">
    <h:commandButton action="#{manejadorAsociarEvaluadoresProyecto.mostrarEvaluadores}"
    value="Asociar evaluadores"/>
    </h:panelGroup>
    this is the method of posibleEvaluador
    public String editar()
    setDetalle(!getDetalle());
    return "";
    all run perfect, until y click in "asociar evaluadores" button, after of this the commandLink "editar Correo" not run, this commanlLink is for not show the inputTextArea, i don't know what happend.
    thanks for your help

    Hello,
    I have replicated and confirmed the problem with LabVIEW 2010, Report Generation Toolkit 2010 and Word 2010.  I have filed this to R&D under CAR ID #257414.  As a workaround you can manually set each cell using Word Edit Cell.vi.  I have attached a simplified representation of this unexpected behavior as well as the workaround.  Hopefully this helps everyone out!
    David_L | Certified LabVIEW Architect
    LabVIEW Tools Network | LabVIEW Tools Network Developer Center
    Attachments:
    Word 2010 Table CAR.vi ‏17 KB
    Word 2010 Table FIX.vi ‏22 KB

  • Problem with Column types and String

    Hi
    I have some problem while comparing against empty string.
    My column is of type it_Linked_Button. Actually it seems that column type doesn't matter.
    If cell that belongs to this column is empty and based on other columns' values I put some value into this cell.
    It works fine.
    But when I clear that cell and try to put some value again nothing happens.
    In my if statement I'm checking against empty string and it fails second time.
    Before I put anything in that cell (in debugger) that value is "" so it is empty and it works.
    (OK, I see that after I posted this message it was slightly reformated)
    But after I put something and clear that cell and try to put something again (in debugger) I get "(here is some long space) " which fails String.IsNullOrEmpty(var) test.
    What is going on? Has it something to do with Column type?
    How to clear it so I can put something in it again?
    One more thing - to put values and clear it I use DbDataSource SetValue method. And String.Empty or ""(doesn't matter)
    Thanks
    Kamil
    NOTE
    I made some workaround that gives me the behaviour I want but still I would like to know what is going on?
    Edited by: Kamil Wydrzycki on Sep 24, 2009 12:57 PM

    DrLaszloJamf wrote:
    warnerja wrote:
    DrLaszloJamf wrote:
    1. Could you define an Enum? Then you could switch on enum values.
    2. Wait for Java 7 which is supposed to extend switch to strings?3. Put the target strings in a collection, write a loop to find the match in the collection and use the matching index in the switch statement. At least that will get rid of the hashcode kludge, where it won't mistakenly 'match' a string which isn't the actual target.3b: Map<String, Command>Yep.
    I also wanted to point this out to the OP:
    For example, let's say the 7 character string "BugABoo" happens to have the same hashcode as "EDI_DOC". And let's say your input just happens to have the string "BugABoo" in it, where you're extracting the 7 character substring. See the problem? You're getting "BugABoo" but treating it as if it really were "EDI_DOC", by virtue of comparing hashcodes instead of actual strings.
    OOPS!

  • Problems with Symple Types and Contexts

    Hello Experts,
    I have a problem. I want to bind a Context in a TableColumn. For this, the property - type of the Context is bind to an SymplyType (which I filled with data).
    But when I Run the Application the table don't show me the input.
    What should I do?
    Thanks
    Best regards

    First of all I will fill the first Column like the following:
    Activities
    Football
    Baseball
    Golf
    Polo
    Soccer
    So these are only TextView-Elements
    The Symple Type is filled like this:
    Value            Description
    Football          Football
    Baseball         Baseball
    Golf                Golf
    Polo               Polo
    Soccer           Soccer
    What should I do?
    Best regards
    Marcus

  • Problems with enumerated type and DataSocket

    I am publishing an enumerated type variable using DataSocket write and I am having problems subscribing to this with other clients on the network. I can get the program to work ok if I replace the enumerated type with a straight numeric or a Text Ring for example. Is there anything special I should be looking out for when using enumerated types in this type of application.
    Thanks Kelly

    Updating to the latest version of LabVIEw (6.0.2) should correct this problem:
    http://digital.ni.com/softlib.nsf/websearch/F983BDA17B8F401B862569EC005A11C2
    Also, I would suggest updating to the latest version DataSocket:
    http://digital.ni.com/softlib.nsf/web%2Fall%20software?OpenView&Start=1&Count=500&Expand=6#6
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • Problems with Date Type in Table View

    Hello.
    Following problem:
    I have to make a Table View with some data. One Colum is Type of Date!
    Now I used Table View Iterators to change the backgroundcolor of some cells.
    Sample:
    WHEN 4.
         DATA: col4_text TYPE REF TO CL_HTMLB_TEXTVIEW.
        CREATE OBJECT col4_text.
        col4_text->text = M_ROWREF->DATE1.
           If  mod_vari = 1.
            p_style = 'cellDesign:POSITIVE'.
         ENDIF.
    But now I have the problem that this columm´s date is not formated: 20050112 but I want it this way: 01.12.2005.
    How can I handle this problem? newbie

    This one throw me for a loop as well coming from a non SAP background but here's a nice little code sample that you will find to be quite useful all the world over
    data: lt_date type string,
          lt_tmp type string,
          lt_sep type string.
    lt_sep = '.'
    * You already have your date but for the example not
    * so this is why I use the lt_date
    lt_date = '20050112'.
    CONCATENATE
      lt_date+4(2)
      lt_date+6(2)
      lt_date+0(4)
    INTO lt_tmp SEPARATED BY lt_sep.
    * Now you can give lt_tmp to your output of your cell
    For the cell output you can double check the various weblogs on the subject "Iterator".
    You can play around with the lines after CONCATENATE to put the date in the format you want.

  • Problem with data acquisition and motion control

    I have PCI-6024E and PCI-7342 cards on a single PC. Servo motion control works fine when it goes alone or is accompanied by one point data acquisition in a while loop, but when I start data acquisition with specified sample rate, the motor moves with breaks.
    Does anybody know what is the problem? Is it possible to fix it?

    How are you performing your motion? Is it a position move or a velocity move? How are your triggering the data acquisition? Using breakpoints on the 7342? If so, are you using single breakpoints or modulo? How are you configuring the data acquisition rate? Are you triggering just the start to the acquisition and the unsing the daq scan clock or are you using the motion controller to send the scan clock itself?

Maybe you are looking for

  • HT3209 I downloaded a movie but now I can't find it.  Any ideas?

    I downloaded a movie inSD and saw it was going through the download. When I returned to view it, it wasn't in iTunes anywhere.  Does this mean it didn't finish the download and I should do it again? Did I get charged for it?  It doesn't show any purc

  • Firewire / DV path has SUDDENLY started being flaky.  Any thoughts?

    I'm using a Firewire 400 output as the path for monitoring both audio and video. It's a 6 pin connector to a 4 pin to the Panasonic DV deck (AG-DV2500) and audio RCA out to powered monitors and S-Video to a Sony Video Monitor. I've been using a simil

  • My imac freezes after 5 minutes of use

    my imac freezes after 5 minutes of use, that's including after i reboot.  is there something that i'm not doning because it's freezing on all my programs.

  • EDI - 820 Payment Remittance Advice

    What is the flow process to achieve EDI - 820 functionality in Sap?  Need documentation how to upload 820's directly into SAP.  It would be a great help for me if someone could share their experience. Appreciate your time. Thanks & Regards, Victor

  • Web service request ....one db connection per session OR all share one...

    in servlet i use public void init(ServletConfig config) throws ServletException { } so it only gets the db connection once per session now that I am working on a web service....im not sure how to do something similiar I want to either have all reques