Accessing field values using property names

Hi all,
I have the following problem:
I have several hundred simple beans which act as value holders:
public class MyBean1 {
private String field1;
private String field2;
Getters
Setters etc.
Now I have a class which receives the MyBean1 class encapsulated in an Object. I also have access to a list of propertynames i.e. field1, field2 etc.
Having that info is it possible for me to retrieve the values from the bean without actually instantiating it in my implemantation class.
I was thinking in the direction of something like a Factory helper class or so but wasn't quite able to figure out how to go about it.
Any help would be appreciated.
Regards
Michael

>
Having that info is it possible for me to retrieve the
values from the bean without actually instantiating it
in my implemantation class.
This does not make sense to me. If an object is not instantiated, then it does not exist nor do any of its fields. The operation of obtaining values that do not exist is undefined.
I think you must mean something else but you need to explain it better.

Similar Messages

  • Access field value in ALV

    Hello experts,
    I have created an simple ALV Grid report, in that I have implemented double click event n I want to create a new ALV grid with new data to be displayed. So I want to access field value ie using SLIS_SELFIELD or anything. Could anyone please guide me how can I access a field value using slis though SLIS_SELFIELD has methods like SEL_TAB_FIELD... I wan to access something like SEL_FIELD_VALUE but its not available in the class.
    Thanks in advance...
    Regards,
    Viral Patel

    Hi Viral,
    SLIS_SELFIELD has an attribute named VALUE which holds the value you selected row & TBAINDEX holds the row number.
    Refer below code snippet :-
    FORM user_command
              USING s_ucomm LIKE sy-ucomm
              s_selfield TYPE slis_selfield.                    "#EC CALLED
      CASE s_ucomm.
        WHEN '&IC1'.
          CLEAR wa_podat2.
          READ TABLE itab_podat2 INTO wa_podat2 INDEX s_selfield-tabindex.
          CHECK sy-subrc = 0.
          IF wa_podat2-ebeln = s_selfield-value.
            SET PARAMETER ID 'BES' FIELD wa_podat2-ebeln.
            IF wa_podat2-ebeln IS NOT INITIAL.
              CALL TRANSACTION c_tcode.
            ENDIF.
    For above event to happen, you have to use parameter I_CALLBACK_USER_COMMAND of  REUSE_ALV_GRID_DISPLAY as below :-
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = l_repid
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = itab_fieldcat
          it_events               = itab_events
        TABLES
          t_outtab                = itab_podat2[].
    Regards
    Abhii
    Edited by: Abhii on Nov 30, 2009 11:25 AM

  • Can JVM security policy be modified to access field values of private field

    Can JVM security policy be modified to access field values of "private" field in a Class?

    See http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html#ReflectPermission.
    Note that you will have to use reflection to access the fields once the security policy allows you to supress the access controls.
    Chuck

  • Check list field values using LINQ

    I have to check if the CURRENT USER is already in the list USERS by comparing his AccountName to the list field ACCOUNTNAME.
    If the USER is on the list I have to check if the field IsFollower is YES or NO and change it according to some conditions.
    I think LINQ would be the correct way of doing this but I have no clue how to do that.
    Any ideas pls, thanks

    Hi,
    Yes, you can query the list using LINQ.
    You need to get the SPList Object firstly, and then you can query list item value using LINQ.
    More information about how to check list field value using LINQ:
    http://msdn.microsoft.com/en-us/library/office/ee538250(v=office.14).aspx
    http://www.wolfsys.net/query-sharepoint-lists-with-linq/
    http://geekswithblogs.net/TanviBlog/archive/2013/06/06/linq-in-sharepoint-and-querying-list-items.aspx
    More information about how to use Server Object Model in SharePoint lists:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.aspx
    http://msdn.microsoft.com/en-us/library/office/ms456030(v=office.14).aspx
    Best regards

  • Accessing recordset field values using labview Active X

    dear friends,
    i have opened recordset using labview active X Refenum opening dbengine,workspace ,opendatabase,openrecordset
    i need to access the field value from the record
    but labview doesnot show any propery or methods that r related to fields ,except count.
    in short i am looking for a code statemant in labview which is equivalent to VB
    Recordset.Fields("Name").Value or Recordset.Fields(Index).Value
    can anybody help
    thanks in advance
    regards
    shridhar joshi

    try something like this .
    "shridharjosh" wrote in message
    news:[email protected]..
    > dear Ben Schulte
    > i am using MS Access Database and i opened
    > Acitve X class and necessary database connection parameters
    >
    > thing is Fields is a collection in VB and
    > has a two default properties 1-Count 2-Index
    >
    > I am Able to get count property but un succesfull in accessing index
    > this is important inorder to acces the value of a individual field in
    > a recordset
    > i am attaching data vi with this please ahve a look at it
    >
    > thanks in advance
    [Attachment Fields.PDF, see below]
    Attachments:
    Fields.PDF ‏175 KB

  • Field value as file name when export as fdf

    When running a batch process in Adobe Acrobat Professional that exports a pdf as fdf to a file path, is there a way to name the file with one of the pdf field values?

    Hi,
    Please check the below link..
    Number ranges for Spool Requests
    hope it may help you
    Kuber

  • Issue facing : Deletion of Qualified Look up field value : Using Import Map

    Hi All,
    We are having qualified multi-valued look up field in the main table. Using import map for the main table record update, we are trying to delete the qualified look up field value. But it is not working.
    Please guide on how you have achieved this.
    One approach is to supply NULL value, though I am not sure or have tried this.
    Regards,
    Ganga

    Hi Ganga,
    I assume that you are trying to delete the Qualifier values for the Qualified look up table. The only possibility is to pass the Null values to the already Existing records in the Main table. Please note that if you are passing one Null value only one record will get deleted. So you will have to pass the Null values equivalent to the number of values for the Multi Valued Qualified table.
    Kind Regards,
    Thamizharasi N

  • Reading deleted field values using change pointer

    hi
    i am triggering DEBMAS06 using change pointer technique for XD01/02/05/06 transactions.
    now when i delete data(make nulll values) in partner functions the generated IDOC is not showing the complete field itself.when i am deleting the field value and making it null the IDOC must send the fields with null values.but unable to trace out how to do this.
    can anyone let me know how to handle this situation?
    and i have extended DEBMAS06 with customer hierarchy data i.e. KNVH.i have written change pointers.now how can i populate these fields into my extension?

    Hello Moorthy,
    1. This message function in the Idoc is populated as 005 then it should replace the entrire values while posting,
    2. To populate KNVH extension you have to populate this only if you have KNVV data.. so you can either create enhance menti perfrom FILL_SEGMENT_E1KNVVM i(nf Function moduler MASTERIDOC_CREATE_DEBMAS) inclduer LVV01F01. or you can write the logic in BAdi CUSTOMER_ADD_DATA->FILL_ALE_SEGMENTS_OWN_D or in user eixt EXIT_SAPLVV01_001.
    Regards
    Naresh

  • How to Set Field value using javascript?

    I have a Field in First Page called 'SO'. I want to populate this field from the field value of SD_ITEMS.DATA.VBELN first row in the each page. Please help me with javascript to set this value.
    Thank you.
    Ranji

    I have a Field in First Page called 'SO'. I want to populate this field from the field value of SD_ITEMS.DATA.VBELN first row in the each page. Please help me with javascript to set this value.
    Thank you.
    Ranji

  • [AS2] how to access a TextInput using its name?

    I want to change the text of a TextInput using its name for example.
    ("name1").text = "123"
    or is it possible to create an array of components?:
    txt[0].text = "123"
    how to do it? thanks in advance

    I'm not certain what your intention is, but if the instance name of the textfield is name1, then you can assign its text using:
    name1.text = "123";
    If you have an array of the instances, the same applies, so long as the array is assigned the instances and not string versions of their names.
    var txt:Array = new Array(name1);
    txt[0].text = "123";
    If you have an array with strings of the instances names, then you need to use bracket notation to have the strings interpretted as instances...
    var txt:Array = new Array("name1");
    this[txt[0]].text = "123";

  • Forcing created by field to use alias name

    Hi,
    How can I modify User Profile Service in SharePoint 2007, so that "Created by" field uses "domain\user" as opposed to fullname in the created by field or any hidden person field like "modified by".
    Thanks

    Hi,
    Per my understanding, you might want to set default value for the “Business Unit” column by looking up to another list.
    You can apply
    JavaScript with Client Object Model to the NewForm.aspx page to meet your requirement.
    A possible solution can be like this: When user opens the NewForm.aspx page of the current list, the custom JavaScript will be executed to get information about the
    current user, then query the other list for the default value, set the value to the drop down list of the “Business Unit” column dynamically. The JavaScript can be added into a Content Editor Web Part and insert into the NewForm.aspx page.
    The links below would be helpful for implementing this scenario:
    About how to
    select an option of drop down list using JavaScript:
    http://www.imranulhoque.com/javascript/javascript-beginners-select-a-dropdown-option-by-value/
    About
    how to use JavaScript Client Object model to access SharePoint list:
    How to: Create, Update, and Delete List Items Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx  
    Common Programming Tasks in the JavaScript Object Model
    http://msdn.microsoft.com/en-us/library/office/hh185015(v=office.14).aspx
    Here are two links about how to
    add code into SharePoint page via Content Editor Web Part:
    http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
    http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
    Best regards
    Patrick Liang
    TechNet Community Support

  • Get form field value using an offset

    I have a Form created using Perl that has a table with a row for each invoice in a large table. I display all the rows in a table and allow the user to edit some info for each record:
    for ($item_cntr = 0; $cntr < $record_cnt; ++$item_cntr)
    { print qq(<tr>
    <td><input type="text" name="c_freight_$item_cntr" value="$i_freight[$item_cntr]" onBlur="linetotal($item_cntr)" ></td>
    <td><input type="text" name="c_miscamt_$item_cntr" value="$i_miscamt[$item_cntr]" ></td>
    <td><input type="text" name="c_price_$item_cntr" value="$i_price[$item_cntr]" ></td>
    </tr>);
    I want to create a Function that is called when they change the Freight value and that causes the rows total Price (freight + miscamt = price) to be calculated again (without hitting a Submit button on the Form).
    I created a Function:
    function linetotal(whatline) {
         var fixed_freight = "document.editform.c_freight_" + whatline;
         var fixed_misc = "document.editform.c_miscamt_" + whatline;
    var linetotal = parseFloat(fixed_freight.value) + parseFloat(fixed_misc.value);
    document.editform.c_price_whatline.value = linetotal; } }
    So, if the first row in the table is 0, then the Function is passed "0" and should get the value of the form fields:
    'c_freight_0' and 'c_miscamt_0' and set 'c_price_0' to a new value in the form.
    The fixed_freight is showing that the string it has is correct, but it does not get the value from the form. Any ideas?

    DrClap wrote:
    DrLaszloJamf wrote:
    DrClap wrote:
    Although there are [Java sites|http://www.javaranch.com/] which do have an [HTML and Javascript forum|http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=20].
    Don't forget the free hugs forum there, too!
    You must mean [this one|http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=44].
    Oh yeah. Are you a JavaRanch regular, Dr.C? I was for a while, but not recently.

  • Accessing param values using RichFaces Drag n Drop

    Hello everyone,
    I'm using RichFaces drag and drop support and I want to pass an additional parameter so that I can access it's value when processing the dragged/dropped object.
    My JSP has:
    <rich:dragSupport dragIndicator=":indicator" dragType="measure" dragValue="#{measure}">
           <a4j:actionparam name="operator" value="#{aggOp}" assignTo="#{SessionBean.tempAggOp}"/>
           <rich:dndParam name="label" value="#{measure.name} (#{aggOp})"/>
    </rich:dragSupport>
    <h:outputText value="#{aggOp}" style="font:11px arial;"/>On my backing bean method that processes the event, I can access the object's properties fine, but the param has a strange behaviour:
    The first time I drag an object, the param value is null on the bean. The second time, it has the value it should have for the first dragged object, and so on.
    Apparently the param value is being updated after the drop event method is called. Any ideas on how to change this please?
    Thanks in advance,
    ~Ruben

    To solve this problem I used <f:param> instead of actionParam:
    On the drag support component:
    <rich:dragSupport dragIndicator=":indicator" dragType="measure" dragValue="#{measure}">
                                                        <f:param name="operator" value="#{aggOp}" />
                                                        <rich:dndParam name="label" value="#{measure.name} (#{aggOp})"/>
    </rich:dragSupport>     On the backing bean:
        //dropped item processors
        public void processDropSupportTable(DropEvent dropEvent) {
            if (dropEvent.getDragType().compareTo("measure") == 0) {
                SOLAPMeasure dragged = (SOLAPMeasure)dropEvent.getDragValue();
                FacesContext context = FacesContext.getCurrentInstance(); 
                Map requestMap = context.getExternalContext().getRequestParameterMap(); 
                String tempAggOp = (String)requestMap.get("operator");
                System.out.println("dropped: " + dragged.getId() + " named: " + dragged.getName() + " whose operator is: " + tempAggOp);
        }

  • Upload interactive form and access field values in WD component

    Hi Experts,
    I want to upload a prefilled  interactive adobe form in my webdynpro component and then I want to read the values filled in the form in my webdynpro component.
    I don't want to display the interactive form in the WD component. Just need to read the values.
    Please let me know how can I do it.
    Warm regards,
    Sushant Singh

    You can use the fileupload and filedownload uielements.
    Check these links:
    [File Upload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm]
    [File Download|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    When you upload a file and save in SAP, are you saving it as xstring.
    If yes follow these steps for filedownload.
    Follow these steps for file download:
    1 Create FileDownload uielement in your View
    2.Create an Attribute of type xstring.
    3.Bind this attribute to the data property of your Filedownload uielement.
    4. during fileuplaod as you are saving the document in xstring format, fetch the same from your database table and pass the value to filedownload i.e set the attribute bound to data property of filedownload uielement with the xstring content.

  • How to access an element using its name or id if it is not a class variable?

    I am trying to retrieve the element I added to my UI in a different  function. I am using actionscript 3. I know I can put the variable into a  class variable, so it can be access anywhere in the class, but I have  too many elements. Is there anyway I could access them without putting  them into class variable?
    Thanks.
    public class Test extends SkinnableContainer{
    // private var image:Image; <-- I try not to do this, too messy
    private function func1() {
        var image:Image = new Image();
        addElement(image);
    private function func2() {
        var image:Image = /* how to get the element from my UI without putting into class variable */

    Here is what works for me:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   creationComplete="init()"
                   minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import spark.components.Image;
                private var  image:Image;
                private function init():void
                    image = new Image();
                    addElement(image);
                    trace(this["image"]);
            ]]>
        </fx:Script>   
    </s:Application>

Maybe you are looking for

  • Windows 7 on external drive

    Hey all, I want to have a copy of Windows 7 available for rare use. I don't want to have a Bootcamp partition on my hard drive. Is it possible to have Bootcamp on an external drive? I want to use a flash drive. I tried using WinClone and found out th

  • How can I save my current Firefox customization to install on a new Windows 7 installation

    This is not asking for a problem fix. How can I save my current Firefox 3.6 customization, toolbar set-up, plug-ins, add-ons, etc. to a file or files so I can install it, pre-customized, after I do a re-format and clean install of a new Windows 7 ope

  • SQL Loader and conditions

    Hello, I have a table: mytable(ID number, file varchar2(256), data blob) and I try to migrate data (blob) with file and id from my table my input.dat file would be containt the ID input file(1,2,3,4,5,6,...) and control file Would be: LOAD DATA INFIL

  • FPGA : socketed CLIP

    Hello, I am currently using PXIe-7966R with IO module 6583. For my application, i need to access FPGA I/O with a imported vhdl design. As a consequence, i try to use a socketed CLIP. Following process from NI tutorial, i have imported a socketed CLIP

  • Unresolved/Unresolvable Shockwave Flash Compatibility Issues - "shockwave flash may be busy, or it may have stopped responding..."

    As an early adopter (and champion) of Firefox, it is with great sadness that after more than 10 years I find that I will need to un-install Firefox and move to another browser due to your ongoing compatibility issues with Shockwave Flash (a page free