Dynamic runtime typecasting

Hey, i've been trying all night to figure out a way to implement dynamic typecasting in Java.
So say if we have a class Dog which extends Class Animal:
Animal a = new Animal("dingo");
Dog d = new Dog("BillyG");
System.out.println((Animal)d);
Note the casting is specified at compile time, instead i'd like to do it
during runtime.
Animal a = new Animal("dingo");
Dog a = new Dog("BillyG");
System.out.println((a.getClass())d);
I realize the above code is illegal, but i'd like to do something
essentially similar even if it involves some hacks.
Regards,
d33p.

It is not possible to cast at runtime to any class.
But you can cast at runtime to different classes you
specify at design time by using istypeof.
"instanceof", you mean?
if ( anObject istypeof Animal.class ){
that should be ... instanceof Animal) {
animal = (Animal) anObject;
else if ( anObject istypeof Dog.class ){
dog = (Dog) anObject;
}That will cast everything to Animal by the way, since every Dog is an Animal.
By the way if you find yourself needing that kind of thing, look up the visitor pattern.

Similar Messages

  • Dynamic [Runtime] type casting in Java

    Hello,
    This is my requirement.
    I have a method that takes class name as a parameter.
    Ex:
    Object myMethod(String classname){
    Object xyz = getObject(); //userdefine method which returns some object
    /*<b>I need to typecast above object with the class name passed as the method parameter</b>*/
    /*<b>How can i type cast this object</b>*/
    Object obj = (classname) xyz;
    return obj;
    In the above example, how can i dynamically typecast the object with class whose name is passed as the method parameter?

    Hello,
    This is my requirement.
    I have a method that takes class name as a parameter.
    Ex:
    Object myMethod(String classname){
    Object xyz = getObject(); //userdefine method which
    returns some object
    /*<b>I need to typecast above object with the class
    name passed as the method parameter</b>*/
    /*<b>How can i type cast this object</b>*/
    Object obj = (classname) xyz;
    return obj;
    In the above example, how can i dynamically typecast
    the object with class whose name is passed as the
    method parameter?Perhaps a little more background on the project (what you are trying to do) will help the experts here answer?
    /*with a class that takes a noarg constructor*/
    public Object getObject(String classname) throws Exception
      //might want to get a bit more specific with which exceptions it will throw
      return Class.forName(classname).newInstance();
    }Do I think this sometimes is indicative (perhaps even more often than not), of a possible design flaw? Yes..
    It gets a little trickier if you have constructors (you have to create a Class object representing the string with the .forName(..) ..and then use some reflection to determine constructors and then a bit of logic to determine which of those to use...)
    ~Dave

  • Dynamic runtime shared libraries in Flash

    Runtime shared libraries in Flash only seem to work if there
    is a direct import link into the file that wishes to use the shared
    library item. Why can't the main swf dynamically load a shared.swf
    containing the shared library items into itself and therefore allow
    all child swf's that are loaded after that event to access the
    items? Or why can't you load the shared.swf containing the shared
    library items into the requesting file on the fly and grant access
    to the items from the requesting file that way? Creating direct
    import links to shared libraries in all child flash documents is
    very annoying in larger applications!
    Ideally it should work like this...
    All cross domain security issues have been dealt with.
    I have a main container.swf.
    The main container loads a remote shared library swf that
    contains the shared library items.
    After the load, the main container loads swf files that will
    need to access shared library items.
    One of the loaded child swf's contains a TextField with a style
    sheet attached. We need to have access to a shared font from the
    shared.swf library to enable us to set embedFonts to true and to
    have the TextField render correctly. Unless the import link to the
    shared library was created manually within the child swf containing
    the TextField, the TextField will not render the text with the
    embedFonts set to true.
    This also seems to be the case when dynamically attaching
    shared move clips with linkage id's to the stage. Unless a direct
    import link to the shared library was created within the requesting
    file or should I say the file that is running the script, the
    script fails. It seems that libraries are kept isolated from one
    another, probably to stop linkage id confliction etc. the same way
    as the _global scope isn't shared between swf's originating from
    different domains.
    Using something like, libraryName.linkageID could combat
    this, but I need to know if I'm wasting my time...
    I hope this makes sense. There wasn't a solution last time I
    checked, but it's been awhile and I was hoping someone out there
    has come up with a solution at this stage or even knows the
    official word on the subject.
    Is this possible Adobe?
    Cheers,
    Derek.

    I found the answer. So long as I keep the folder structure in
    my shared library exactly as I have it in my referencing projects,
    I don't need to change anything in the mxml code itself. After
    synchronizing the folder structure, I no longer receive the "1046:
    Type was not found or was not a compile-time constant" error that I
    was getting yesterday.
    France

  • Bowstreet - Dynamic Runtime Assembly on J2EE?

    Has anyone heard of this company called Bowstreet? They claim to be a "mass customizing run-time dynamic assembly engine for services such as web services, EJBs, etc." that runs within a J2EE Container. I have read in a couple of books that due to the inefficiencies of JSP (maintenance cost, non-loosely coupled services) that dynamically assembled applications will be the way to go. Especially when web services are commonplace. Any input would be helpful.
    Thanks,
    Rob

    yep, i have worked with it... what it does is to break down a webpage into components which can be shared by other pages, local pages or even remote pages on other servers.... the one I worked with was the pretty buggy. Bowsteet also uses lots of XML, epecially in passing and containing data. The coolest about Bowstreet is the remote component, which lets say you wanna a stock quote component, instead of writing and licensing one yourself, you can have the Bowstreet Application Components service to remotely give you the component... all you gotta do is put the remote service URL and some other security parameters. Yeah, it is an easy concept, but it works quite well, bascially the local server doesn't need to have the actualy component.
    bottom line is the Bowstreet had the most original ideas, their implementaion is good as well, however, due to the nature, or better said the immaturirty of XML and Web, the Bowstreet application was very buggy and confusing. I think the version we did was 3.

  • Dynamic runtime reporting

    Hello,
    We are planning to develop an asp.net web application where we require a facility that the users may select a number of required fields at runtime and then can view a report in crystal reports for that fields only.
    In terms of explanation, there should be only one report with no connections and no fields within it. At runtime a connection would be established and a dataset would be sent to CR on which it should simply set the report with all the fields in the detail section and render the report with the data avaliable in the dataset.
    Is this facility available with CR. if yes then which version has this facility.
    Any help would be appreciated.
    Ali
    Edited by: Ali Imran Kitabi on Nov 14, 2008 8:03 PM

    Hi Ali,
    For the functionality you are looking for is to create report at runtime for that we need a RAS SDKu2019s.
    We can create runtime with crystal report 10 and above.
    Have a look at this training document:
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b840c0-623f-2b10-03b5-9d1913866b32]
    Link for our SDK library:
    [https://boc.sdn.sap.com/node/10619]
    Hope this helps!!
    Regards,
    Shweta

  • Howto create a ValidateSet with dynamic (runtime) values?

    Hi Scripting Guys!
    I want to use the auto complete feature in my function for a specific parameter using a "dynamic" validate set (Similar to the Get-Service function and the Name parameter). 
    For example, instead of this:
    function Test-Function
    Param
    [ValidateSet("Folder1", "Folder2", "Folder3")]
    $Param1
    I want to get the validate set populated by a function like all Folders from the C drive :
    function Test-Function
    Param
    [ValidateSet(ls c:\ -Directory | select -ExpandProperty Name)]
    $Param1
    Any suggestions?
    Thanks,
    Martin

    Funny you should ask. Martin Schvartzman has recently posted an example of exactly
    how to use dynamic validate set.
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

  • Dynamic creation of variables and alv grid output/internal table

    Dear Experts
    I am stuck in an inventory ageing report which is to be done year wise. the scenario is as follow.
    selection screen i enter the year 2011 or 2010 or 2009.
    the output should show me 2011-2007 or 2010-2007 or 2009-2007. the alv grid should always start from 2007 and end at the year that is entered in the selection screen.
    Now how can i create a dynamic variables to store the values of the corresponding yr and also how can i create a dynamic internal table to store these values.
    Thanks & Regards
    Zamir Parkar

    Hi Zamir,
    if you are new to ABAP you may leave old and buggy techniques behind.
    If you want to create the table dynamically, please do not use l_alv_table_create=>create_dynamic_table because it is limited and always triggers a possibly unwanted database commit.
    You better use RTTS dynamic runtime type services, i.e. check the example for [Creating Flat and Complex Internal Tables Dynamically using RTTI|http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI].
    As done here, leave all outdated ALV technologies behind and start with CL_SALV_TABLE. It is following the object-oriented approach and does not need a field catalog.
    You will get used to field-symbols that can be compared to the data referenced by a pointer. For dynamic fields, you may build the field names dynamically, i.e.
    DATA:
          lo_structdescr         TYPE REF TO cl_abap_structdescr,
          lo_typedescr           TYPE REF TO cl_abap_typedescr,
          lo_tabledescr          TYPE REF TO cl_abap_tabledescr,
          lr_data                TYPE REF TO data,
          lt_comp_all            TYPE cl_abap_structdescr=>component_table,
          lv_index               TYPE numc2.
        FIELD-SYMBOLS:
          <any>                  TYPE ANY,
          <component>            TYPE LINE OF abap_component_tab,
           <table>                TYPE table.
        DO nnn TIMES.
          lv_index = sy-index.
          lo_typedescr   =  cl_abap_typedescr=>describe_by_name( <name of data element> ).
          APPEND INITIAL LINE TO lt_comp_all ASSIGNING <component>.
          <component>-type ?= lo_typedescr.
          CONCATENATE 'YEARVAL' lc_underscore lv_index INTO <component>-name.
          <component>-as_include  = abap_true.
          CONCATENATE lc_underscore lv_index INTO <component>-suffix.
        ENDDO.
    * create description object for structured type
        lo_structdescr = cl_abap_structdescr=>create( lt_comp_all ).
    *  create table description object for this
        lo_tabledescr = cl_abap_tabledescr=>create(
                        p_line_type  = lo_structdescr
                        p_table_kind = cl_abap_tabledescr=>tablekind_std
                        p_unique     = abap_false ).
    * create data object
        CREATE DATA lr_data TYPE HANDLE lo_tabledescr.
    ASSIGN lr_data->* to <table>.
    This is a fragment. Please adapt to your needs.
    Regards,
    Clemens

  • Dynamic File name in FTP Communication Channel

    Hi All,
    We have requirement where ,we create a filenames dynamically ( runtime).These filenames whihc do change for every execution needs to be added in FTP communication channel.
    1. How can we add the this generated file name in FTP CC Communication Channel.
    2. Does this file needs to part of target structure during graphical mapping ?
    3. Can we also dynamically append the Directory name to file names aswell ?
    Please provide your valuable sugestions.
    Thanks for your support.

    1. How can we add the this generated file name in FTP CC Communication Channel.
    3. Can we also dynamically append the Directory name to file names aswell ?
    to get the FileName:
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    To get the Directory:
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    Then append:
    key+key1
    And then in the CC select the Directory checkbox under the ASMA properties...
    2. Does this file needs to part of target structure during graphical mapping ?
    The file which is sent using the CC will have the FileName as configured in the UDF of the graphical mapping....and if i am not wrong then the target structure resembles the file (if there is no FCC done)....
    Regards,
    Abhishek.

  • Dynamic value help for a table field to fill two fields, how to?

    Hi all gurus,
    In SRM 7 I defined a dynamic value help for a single field (ZZ_PROLE_R3) of my header custom table.
    That's the code from WDDOMODIFYVIEW in the webdynpro /SAPSRM/WDC_DODC_CT, view V_DODC_CT:
    DATA: lo_tabnode        TYPE REF TO IF_WD_CONTEXT_NODE.
          DATA: lo_tabnode_info   TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
          DATA: tab_value         TYPE WDR_CONTEXT_ATTR_VALUE_LIST,
                wa_value          TYPE WDR_CONTEXT_ATTR_VALUE.
          lo_tabnode = wd_context->GET_CHILD_NODE( name = 'THCUS' ). "the custom table node
          lo_tabnode_info = lo_tabnode->get_node_info( ).
          wd_this->GET_VALHELP_ZZ_PROLE_R3( EXPORTING iv_guid = lv_guid
                                            IMPORTING ZZ_PROLE_R3_VALHELP = tab_value ). "this method returns the dyn value table
          lo_tabnode_info->set_attribute_value_set( name = 'ZZ_PROLE_R3'
                                                     value_set = tab_value ).
    The method GET_VALHELP_ZZ_PROLE_R3 dynamically builds the value help table tab_value; such table is made up by two fields:
    value : contains the value of the field
    text   : contains a description of the value
    The above solution works; now I'd like to enhance it. The custom table THCUS contains also a field called ZZ_PROLE_R3_DESC, which represents the description of ZZ_PROLE_R3. It is, exactly, the TEXT field in tab_value.
    So I'd like to do as follows:
    - the user clicks on the search help for ZZ_PROLE_R3 field of the table;
    - the above described value help appears;
    - after the selection, both ZZ_PROLE_R3 and ZZ_PROLE_R3_DESC are filled with the selected couple value - text chosen from the value help.
    Could anyone help me achieving such a behaviour?
    Again, a little request... when I open the above value help dialog box, the window itself has a label "Floorplan Manager application for OIF.." that obviously I'd like to redefine (e.g. "Role selection value help"). Is there any way to do that?
    Thanks in advance

    Chris Paine wrote:
    It seems to me - given that your code is in wddomodifyview that you are trying to have different dropdowns per row
    - I'm not sure where you are populating lv_guid - but I'd guess it is an attribute of the row selected? If it isn't then I can't see any reason that you would do this code in wddomodifyview and not wddoinit.
    Hi Chris and thanks for your help,
    lv_guid is the GUID of the document's header; I need to pass it to the method that populates my value help table because the values in it are derived from some fields on the document. (the situation actually is more complex; there's an RFC call on the backend for which the document is intended for to retrieve the data that populate the value help...).
    I'm quite unexperienced on webdynpro and terminology; if dropdown menus are fixed selection option that appears on a field, I guess this is not my case. I did a pair of screenshot to provide an idea of what the solution by now is, and what "I would like to have":
    [Pre-selection (F4 icon on the field in table)|http://imagebin.ca/view/npIsaqF.html]
    [Value Help popup for the field ZZ_PROLE_R3|http://imagebin.ca/view/8fZUh3T.html]
    [Result by now |http://imagebin.ca/view/3PaqdvE.html]
    [Result I'd like to have.|http://imagebin.ca/view/dExR0J.html]
    Chris Paine wrote:
    However - by your comment on the "value help dialog box" I am guessing you are using an input field? If this is the case then I would strongly suggest that you change/enhance the structure of the context node THCUS (btw, better coding practise to refer to it as wd_this->wdctx_thcus when using the get child node construct) so that you refer to an actual SAP ddic search help, if you then associate in the structure the value and text fields then populating the text field should happen automatically. Also you'd have the nice side effect that your value help dialog would be named after the associated ddic search help.
    Thanks for the code suggestion, I'll apply that. For what concerns the context node THCUS... It is, by standard, a node which I can't explictly find in the context for the view V_DODC_CT. The problem is that ZZ_PROLE_R3 and the corresponding description field ZZ_PROLE_R3_DESC of the table must be filled with data retrieved dynamically @ runtime from the backend. So I guess I can't populate a val help referring to a dictionary table/field; I'd rather do as follows:
    - retrieve what's the target backend for the document (to do so, I have to process the document .. that's why the header guid passed to my method);
    - RFC call to a custom method that extracts possible values for the specific backend;
    - bind the ammissible values to the value help.
    Chris Paine wrote:
    I realise that this is rather a lot - so if you have any specific question please do respond - hopefully I or someone else will be able to clarify.
    Thanks again for your help; additional info as well as code examples would be highly appreciated

  • Web Dynpro ABAP Table in runtime

    Hi,
    I have an ui table that has 3 table columns but in runtime i want to add 3 table columns more for it i use add_grouped_column( lr_column ). but when i do a test i see that the 3 table columns that i want to add in the last of table is in the begining.  How can i do that the table column that i add is created in the last of table?
    Thnx.

    Hi Paulina,
    I dont think you can add the colums to a table UI element dynamically @ runtime. Instead, you can add all the columns to your TABLE UI @ one shot and hide the unwanted elements using a WDUI_VISIBILITY Context element. Set this context element based on your requirement to display the columns dynamically.
    FYI...For WDUI_VISIBILTY variable 1 - Hide and 2 - Display.
    Hope this helps.
    Regards
    Raja Sekhar

  • Dynamic method signatures

    This does not compile:
    public class Main {
      public static void main(String[] args) {
        Object sok = Socket.class.newInstance();
        foo(sok); // syntax error only as help to prevent runtime errors?
        Object x = ArrayList.class.newInstance();
        foo(x);  // syntax error because method linkage must happen and i don't know the class of "x" yet.
      public static void foo(Socket s) { println("i am a socket");  }
      public static void foo(List l) { println("i am a list"); }
    }Is the compiler complaining only to prevent a possible runtime (typecast) error? Or, is there actually some real problem (perhaps method linkage)?
    I read that methods live in their own special place in memory (and each has an address)? And is that address inserted into the bytecode when the Java source is compiled? So, while in the runtime every object knows its type, and this would enable selection of the correct method, you can't wait because of the need for compile-time method linking? Or, while waiting is technically possible, you can't because the developers of Java wanted to help developers to minimize run-time errors.
    If this question makes no sense, please help clear-up my misunderstanding about method linkage. thanks.

    dpxqb wrote:
    It only cares about the reference type of the expression you pass to foo(expression), which is Object for both cases.awesome. So, I hope this means that the "type" of the concrete object is not relevant for method signature. Rather, it is the "type" of the reference .Correct. I believe it's common to say class when talking about the concrete runtime object, and "type" when talking about the compile-time reference.
    And "reference typing" (aka "casting") happens at compile-time while "object typing" happens in the run-time.Yes and no. Your terminology is non-standard, so I'm not sure exactly what you mean, but approximately, yes, references types matter at compile time and object classes matter at runtime (for polymorphism in overridden methods, for example).
    Casting is both a compile-time and a runtime operation, however. At compile time, the reference type has to be one that could possibly be cast to whatever the target type is, and at runtime, the actual object has to be of an appropriate class for the cast to succeed.
    String s1 = (String)new Date(); // compile time error can't cast "across" the hierarchy
    String s2 = (String)new Object(); // compiles fine, but ClassCastException at runtime
    Object o1 = "abc";
    String s3 = (String)o1; // success

  • UWL dynamic URL

    Hi,
    We are creating a UI application with workflow at the backend. The problem I am facing is that I do not know how to pass the URL dynamically.
    For instance, in the URL http://www.myApp.com/AS how do I add a dynamic variable like http://www.myApp.com/AS/(dynamic_variable)  ?
    Appreciate your inputs.
    Regards,
    Arjun.

    Hi Arjun
    I hope you are well and many thanks for using the SAP Discussion Forums
    Now in relation to the scenario that you have described and the passing of dynamic URL's kindly take a look at the following core guidance documentation:
    Setting a Dynamic Runtime URL
    http://help.sap.com/saphelp_nw73ehp1/helpdata/en/49/80317fc6242221e10000000a42189d/content.htm
    Dynamic URL's and Tasks - iViewLauncher
    http://help.sap.com/saphelp_nw70/helpdata/EN/b1/cc1357eead454bb144face4a66be7d/content.htm
    Creating Dynamic Tasks Subjects & Descriptions in SAP NW
    http://scn.sap.com/community/bpm/blog/2011/06/10/creating-dynamic-task-subjects-and-descriptions-in-sap-netweaver-bpm
    Kindly update me as per your findings and let me know how you get on.
    Kind Regards
    Troy Cronin - Enterprise Portal Support Engineer
    Follow Troy Cronin

  • Dynamically creating a CF Tag

    Greetings,
    I would like to dynamically determine what attributes are
    present in a ColdFusion tag. I have done the following to test the
    theory:
    <cfset inputAttr['name'] = "tControlName">
    <cfset inputAttr.label = "Control Label">
    <cfset inputAttr.value = "Some string value">
    <cfset inputAttr.type = "text">
    <cfform name="fTest" method="post" action="">
    <cfset tagAttr = "<cfinput ">
    <cfloop collection=#inputAttr# item="attr">
    <cfset tagAttr = '#tagAttr#
    #attr#="#inputAttr[attr]#"'>
    </cfloop>
    <cfset tagAttr = "#tagAttr# >">
    <cfoutput>#tagAttr#</cfoutput>
    </cfform>
    If I look at the source for the page it is correct, but no
    input is creates. If however I change it to "<input" instead of
    <cfinput" it works fine. Unfortunately I would like to use
    attributes like validate that are only available in
    <cfinput>.
    I assume that the stuff within the <cfoutput> tags are
    bding sent directly to the browser and bypassing the processing be
    CF. So I have tried leaving out the "<cfinput " and ">" from
    the tagAttr and using the following:
    <cfinput "#tagAttr#" >
    in a variety of forms but keep getting an error of one sort
    or another.
    Am I missing something or is this not possible?
    Thanks for your help.

    Hi Adam,
    If I understand you correctly, you can do a similar sort of
    thing in CF as
    per what I touched on with <cfinvoke
    argumentCollection="#stArgs#">. In
    which the "real" argument is actually the collection, and the
    other ones
    are just "treated" as arguments as part of the compilation
    process.
    That is true.
    In one of the previous CF betas I did lobby for this to be the
    approach for
    all CF tags. I'm not sure if it got addressed as an issue.
    As some background, the reason why I lobbied for it was for
    the exact
    reason you have raised: <cfinput>, and doing pretty
    much what you're trying
    to do. I've since worked around it.
    Exactly. So I wasn't so far off in what I wanted to do. From
    the snippet I included you could see where I was going. Which is
    something that you had tried to do as well. So had you said this, I
    would have understood immediately you knew where I was going, that
    you had been down that path and that it was a dead end. Mind you,
    then I would not have meandered about for another couple of hours
    learning interest things.
    One thing you could look @ for these dynamic runtime forms is to
    have a
    gander @ the various CF frameworks out there. You'll probably
    find the
    work's already been done for you. And at the very least you
    can dissect
    the code and see how they've done it.
    Will do.
    Glad you actually seem to WANT to learn. A lot of
    people here don't seem to.
    Too true.
    Yes. I'm reading a book that is like that (in peripheral places)
    at
    present. And there is a lot of shite code out there. Then
    again... look
    at your own old code. You probably see a lot of shite there
    too. I
    certainly do when I look @ MY old code (and, cough, some of
    my new code
    too!).
    Too true. Yes my early code was not as good as today. But the
    tools were not as good as today. (Not that there aren't problems
    with the tools today. Some have just too much useless stuff that is
    overkill. Who can learn the 10,000 classes available in .NET?) And
    I always look at the code i've written, and not where it wasn't
    very good and how it could have been done better. And then I apply
    it to the next project.
    Then too, I have written some strange code that works and
    saves time, but was kluged to get around short comings in the
    language. (That language now allows me to do what I wanted without
    the work arounds.)
    Good thinking. And hence you have situations as per this thread
    in which
    Ian asked what you were actually trying to achieve, as
    perhaps what you
    were asking was not the best question.
    Pretty much. It more sends it to "STDOUT", if I can borrow
    and absuse a
    *nix term... in this case STDOUT generally being the HTTP
    response, which
    finds its way back to a client browser. But that's just *in
    general*: the
    data that CF generates does not need to be text, let alone
    HTML, and it
    does not have to be send to the HTTP response. Indeed it
    doesn't have to
    generate ANYTHING.
    Agreed. Pardon me for being less than precise.
    Ian touched on the notion of writing your CFML code to a string
    and then
    writing it to a file. There's not response or browser or HTML
    involved in
    that.
    But it is not elegant and maybe not efficient. Unless one
    writes out the whole form to one file and then loads it. Hmmm. But
    not really a good answer I think.
    Well I do have a tendency to call a spade a f***ing spade. And
    then -
    sometimes - proceed to hit the person I'm talking to with
    it.
    That's a good description. And I have been there too. But I
    got away from it, and try to make comments in a positive way. Which
    has its own problems.
    Blimin' heck. I hope you're not accusing me of being Australian.
    That's
    not on at all.
    Never! I had intended to include NZ, but it dropped out of my
    mind. At least I didn't think you were English. (My wife is.) NZ is
    nice. I have visited Christchurch and Marlborough. And a very brief
    time in Nelson (I think. I drove from Marlborough to Nelson and
    flew to Auckland and then back to States.)
    Okay. So in the future you can reply to my posts. And I will
    keep it in mind that you are a Kiwi and filter things
    appropriately.

  • [SOLVED] Missing libsmime3.so

    Hi, everyone.
    I'm trying to run a native application which relies on dynamic runtime libraries that are missing in my system, one of those is libsmime3.so.
    I've googled it and found that the missing library is either libsmime3 or libnss3, none of which I could find in Arch repos. Can somebody please advice if that library is available as a part of some other Arch package?
    The software I'm trying to run is LightTable.
    % ./LightTable
    ./LightTable: error while loading shared libraries: libsmime3.so: cannot open shared object file: No such file or directory
    Kind regards.
    Last edited by dmi3y (2012-11-06 19:26:00)

    Use pkgfile to find what you are looking for.

  • Problem in getting the TextBox object to Javascript....

    Hi All,
    Below is the code which i'm using to calculate the percentage and amount(vice versa).
    <script language="JavaScript" type="text/JavaScript">
    function fillAmt(obj) {
    alert(obj.name);
    var mks_Val = document.billingCycleDistribution.mks0.value;
    var obj_Name = obj.name;
    var obj_Val = obj.value;
    obj_Name = obj_Name.substr(7);
    var disp_Amt = (mks_Val * obj_Val) / 100;
    var txt = "amount"+obj_Name;
    alert("TXT "+txt);
    document.billingCycleDistribution.txt.value = disp_Amt;
    //alert(obj_Name);
    //alert(document.billingCycleDistribution.mks0.value);
    //alert(document.billingCycleDistribution.mks1.value);
    //document.billingCycleDistribution.mks0.value
    </script>
    <%
    Calendar cal = Calendar.getInstance();
    int max_Days = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
    for(int rowCount=1; rowCount <= max_Days; rowCount++)
    { %>
    <tr>
                                  <td width="57" height="27" align="center" class="ms-formlabel" style="border-style: solid; border-width: 1">
                                  <p align="center"><input type="checkbox" name= "C1" value=<%=rowCount%>> <%=rowCount%></td>
                                  <%
                                  for(int txt_box = 0; txt_box < marketSegList.size(); txt_box++) {
                                  %>
                                       <td width="153" height="27" align="center" style="border-style: solid; border-width: 1">
                                  <div id= <%="percentdiv"+rowCount%> style="display:block"><p align="center">
                                       <input type="text" name=<%="percent"+rowCount+txt_box%> size="15" onblur="fillAmt(this)">
                                       </div>
                                       </td>
    <td width="153" height="27" align="center" style="border-style: solid; border-width: 1">
                                  <div id= <%="amountdiv"+rowCount%> style="display:block"><p align="center">
                                       <input type="text" name=<%="amount"+rowCount+txt_box%> size="15" onblur="fillPer(this)">
                                       </div>
                                       </td>
                                  <%
                                  %>
    When i try to set the value in amount if a percentage is entered, it gives me an error.
    The problem is since both the text fields are named dynamically @ runtime I'm unable to get them in the Javascript function.
    Kindly help me out in this.
    Thanks
    ss

    Hi Annie,
    Thanks for your reply. I found a method which can be used to set the values.
    It is eval(). Here is the code.
    Working Code:
    eval("document.billingCycleDistribution."+txt+".value = disp_Amt;");
    Not Working Code:
    document.billingCycleDistribution."+txt+".value = disp_Amt;
    Cheers
    Srini

Maybe you are looking for

  • Mail problem following auto upgrade to 10.6.7 OS

    I have upgraded my IMAC to 10.6.7 and am now unable to open my mail box, the old app 4.4 says incompatible with this version of the OS and when I go into applications and try and use 4.5 it looks like it isnt properly set up, instead of the normal po

  • Lumia 1020 - No Speed Dial

    Having just moved from Android SGS4 I am shocked to find that the Lumia 1020 (possibly the most expensive mobile phone on the market) does not have speed dial under the phone pad keys. Forget about the inconvenient pinning of a contact to the home wi

  • Can't Download After Effects CS6 Trial

    Error communicating with Adobe.com(Error 107). Restart Adobe Download Assitant and try to add the product again.

  • ADF- Iterator and Where Clause

    Hi all: How can I do where clause on the iterator? Thanks in advance.

  • Cracked S400 Screen

    I have recently had the same issue with my Ideapad s400.   I am absolutely furious with the Lenovo support as they have been unwilling to discuss the issue or come to a resolution.  I purchased the machine from Best Buy on the 12th of Aug.  We have n