Fetching UDF's values from usermanager object in OIM 11gR2

Hi Experts,
I am implementing a code to generate and update a random password using a post event handler. The idea is to append the iniatals (user login) of the user along with a UDF say (section_code). The label for section_code is "Sect Code" I am using 11g API's and the code is as:
HashMap<String, Serializable> parameters = orch.getParameters();
String user_Key = getParamaterValue(parameters , "User Login");
String section_code = getParamaterValue(parameters , "Sect Code"); -- this is not fetching the valueand then getting these values from
if(parameters.containsKey(key)){
String value = (parameters.get(key) instanceof ContextAware) ? (String) ((ContextAware)
parameters.get(key)).getObjectValue() : (String) parameters.get(key);
return value;
}But i noticed that User Login is getting fetched but the section code which is a UDF is not coming. Is there a way?

Set<String> retAttrs = new HashSet<String>();
retAttrs.add(UserManagerConstants.AttributeName.USER_LOGIN.getId());
retAttrs.add(UserManagerConstants.AttributeName.EMPTYPE.getId());
retAttrs.add("Floor");
// Add any attributes you'd like here to return only specific attributes instead of whole set. This will cut down on time to search for users.
//This code will order the list by usr_key
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("STARTROW", 0);
parameters.put("ENDROW", -1);
parameters.put("SORTEDBY", "usr_key");
parameters.put("SORTORDER", "SortOrder.ASCENDING");
SearchCriteria criteria = new SearchCriteria(UserManagerConstants.AttributeName.USER_LOGIN.getId(), userlogin, SearchCriteria.Operator.EQUAL);
List<User> users = UserManager.search(criteria, retAttrs, parameters);
//You can also use UserManager.search(criteria, null, null); if you do not want to supply the return attributes or parameters.
User user = null;
if (users.size()!=0) user = users.get(0);
String employeeType = user.getAttributes().get(UserManagerConstants.AttributeName.EMPTYPE.getId()).toString();
String floor = user.getAttributes.get("Floor").toString();
//If there are more than 1 returned user, you can use for(User user:users){ loop through here   }
-Kevin

Similar Messages

  • How to get attribute value from an object inside an object in Xpress

    Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
    <ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
    <ObjectRef type='Resource' name='Google Apps'/>
    </ResourceInfo>
    I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.

    If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
    <invoke name='getResourceName'>
      <ref>myResInfo</ref>
    </invoke>

  • To fetch the srtfd value from PCL2 based on Pernr

    Hi,
    is there any function module to fetch field (srtfd ) value from PCL2 based on the pernr. My selection screen is having only pernr as the input and now have to get the srtfd value from PCL2.
    Kindly suggest me if any FM or best procees existed.
    Thanks,
    Murthy.

    Please somebody reply.

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • To fetch particular tag value from xmlType

    Hi,
    The requirement is to fetch the particular tab value from a XmlType column.
    Here is the table schema:
    CREATE TABLE DTCC_REF (
    MESSAGE     XMLTYPE NOT NULL,
    CashFlowId varchar2(20)
    This table is already populated with only value in Message column. cashFlowId is null for all the rows.
    Here is the sample data of MESSAGE:
    <?xml version="1.0" encoding="UTF-8" ?><env:Envelope xmlns:rm="OTC_RM_15-Apr-2005" xmlns:pmnt="OTC_Payment_15-Apr-2005" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fpml="http://www.fpml.org/2004/FpML-4-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OTC_RM_15-Apr-2005 ../OTC/OTC_RM_15-Apr-2005.xsd OTC_Payment_15-Apr-2005 ../OTC/OTC_Payment_15-Apr-2005.xsd http://schemas.xmlsoap.org/soap/envelope/ /xmls/OTC/soap-envelope.xsd"><env:Header><OTC_RM xmlns="OTC_RM_15-Apr-2005"><Manifest><PaymentMsg><Activity>Modify</Activity><Status>Matched</Status><LinkStatus>Linked</LinkStatus><TransType>Payment</TransType><AssetClass>Credit</AssetClass><DTCCUserId>00006151</DTCCUserId><CounterpartyId>00006132</CounterpartyId></PaymentMsg><MsgId>1</MsgId></Manifest></env:Header><env:Body><OTC_Payment xmlns="OTC_Payment_15-Apr- 2005"><Payment><ReferenceIdentifiers><TradeId>1001513M</TradeId><ContraTradeId>CREC5856</ContraTradeId><LinkId>LINKEE1DSL890420</LinkId><MatchId>PYMTEKGDRP784788</MatchId><CashFlowId>2005/12/200INTEUREUR1001513M</CashFlowId><NetId>61326151EUR1220</NetId><GroupRefId></GroupRefId><ContraGroupRefId></ContraGroupRefId></ReferenceIdentifiers><TradeDetails><TradeType>EXOTIC</TradeType><TradeDate>2004-09-13</TradeDate><EffectiveDate>2004-09-14</EffectiveDate><ScheduledTerminationDate>2014-09-20</ScheduledTerminationDate><NotionalAmount><fpml:currency>EUR</fpml:currency><fpml:amount>6000000.00</fpml:amount></NotionalAmount><EffectiveRate>0.3150000</EffectiveRate><ReferenceEntity></ReferenceEntity></TradeDetails><SettlementDetails><SourceSSI></SourceSSI><DestinationSSI></DestinationSSI></SettlementDetails></Payment></OTC_Payment></env:Body></env:Envelope>
    Now i need to populate tag CashFlowId value into 2nd column of table.
    How can i fetch da value? Plase help me...

    gulamoh wrote:
    The xml has been posted in my first mail. I didnt get why you are saying it as wrong.
    Posting it again:What he was saying was that you haven't provided your data within {noformat}{noformat} tags so it gets corrupted by the forum.
    It's also handy if you format the XML to make it readable, so people haven't got to try and decipher it all for themselves...<?xml version="1.0" encoding="UTF-8" ?>
    <env:Envelope xmlns:rm="OTC_RM_15-Apr-2005" xmlns:pmnt="OTC_Payment_15-Apr-2005" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fpml="http://www.fpml.org/2004/FpML-4-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OTC_RM_15-Apr-2005 ../OTC/OTC_RM_15-Apr-2005.xsd OTC_Payment_15-Apr-2005 ../OTC/OTC_Payment_15-Apr-2005.xsd http://schemas.xmlsoap.org/soap/envelope/ /xmls/OTC/soap-envelope.xsd">
    <env:Header>
    <OTC_RM xmlns="OTC_RM_15-Apr-2005">
    <Manifest>
    <PaymentMsg>
    <Activity>Modify</Activity>
    <Status>Matched</Status>
    <LinkStatus>Linked</LinkStatus>
    <TransType>Payment</TransType>
    <AssetClass>Credit</AssetClass>
    <DTCCUserId>00006151</DTCCUserId>
    <CounterpartyId>00006161</CounterpartyId>
    </PaymentMsg>
    <MsgId>2</MsgId>
    </Manifest>
    <Delivery>
    <RouteInfo>
    <From>DTCC</From>
    <To>DTCC00006151</To>
    </RouteInfo>
    <RouteHist>
    <Route>
    <RouteAddress>http://db.com/route</RouteAddress>
    <ReceiveTime>2005-11-26T13:59:29.593Z</ReceiveTime>
    <ReleaseTime>2005-11-26T13:59:29.593Z</ReleaseTime>
    </Route>
    <Route>
    <RouteAddress>www.dtcc.net</RouteAddress>
    <ReceiveTime>2005-11-26T09:47:00.000-05:00</ReceiveTime>
    <ReleaseTime>2005-11-26T09:47:00.000-05:00</ReleaseTime>
    </Route>
    </RouteHist>
    </Delivery>
    </OTC_RM>
    </env:Header>
    <env:Body>
    <OTC_Payment xmlns="OTC_Payment_15-Apr-2005">
    <Payment>
    <ReferenceIdentifiers>
    <TradeId>1006299M</TradeId>
    <ContraTradeId>0900000702811</ContraTradeId>
    <LinkId>LINKEBHBKD364294</LinkId>
    <MatchId>PYMTEKUBMKN02373</MatchId>
    <CashFlowId>2005/12/200INTUSDUSD1006299M</CashFlowId>
    <NetId>61516161USD1220</NetId>
    <GroupRefId></GroupRefId>
    <ContraGroupRefId></ContraGroupRefId>
    </ReferenceIdentifiers>
    <PaymentDetails>
    <PaymentDirection>REC</PaymentDirection>
    <PaymentAmount>
    <fpml:currency>USD</fpml:currency>
    <fpml:amount>625625.00</fpml:amount>
    </PaymentAmount>
    <PaymentDate>2005-12-20</PaymentDate>
    <PaymentReason>Unknown</PaymentReason>
    <LegType>Fixed</LegType>
    </PaymentDetails>
    <TradeDetails>
    <TradeType>EXO</TradeType>
    <TradeDate>2004-09-30</TradeDate>
    <EffectiveDate>2004-09-30</EffectiveDate>
    <ScheduledTerminationDate>2009-03-20</ScheduledTerminationDate>
    <NotionalAmount>
    <fpml:currency>USD</fpml:currency>
    <fpml:amount>247500000.00</fpml:amount>
    </NotionalAmount>
    <EffectiveRate>1.0000000</EffectiveRate>
    <ReferenceEntity></ReferenceEntity>
    </TradeDetails>
    <SettlementDetails>
    <SourceSSI></SourceSSI>
    <DestinationSSI></DestinationSSI>
    </SettlementDetails>
    </Payment>
    </OTC_Payment>
    </env:Body>
    </env:Envelope>

  • How to Get property values from Shared Object in client's load event - Very urgent

    I am using shared object to share data between two users. First user connect to shared object and set some value in shared object. Please consider that second user has not connected with the shared object yet.
    Now when second user connects to the server and try to get that property set by first user, he could get shared object but could not get properties of Shared object set by first user. I observed few times that Second user can get these properties within "Sync" event between two users. But I would like to get these values for Second user in any stage (i.e. in load event etc.). Whenever Second user tries to get the property of Shared object, the object will reset the actual property value and then return reset value.
    Anyone faced such issue while using shared object between two users. If so, I would appreciate if you could let me know your suggestions for following questions:
    1) Is there any way to get all the properties of shared object before sync event called, as I want to get it immediately when second user connect to the application and perform next task based on the values stored in shared object.
    2) Is it possible for second user to check whether any property has been set by first user? So that second user can use the property instead of reset it.
    Any kind of help would be greatly appreciated.
    Thank You.

    I am using shared object to share data between two users. First user connect to shared object and set some value in shared object. Please consider that second user has not connected with the shared object yet.
    Now when second user connects to the server and try to get that property set by first user, he could get shared object but could not get properties of Shared object set by first user. I observed few times that Second user can get these properties within "Sync" event between two users. But I would like to get these values for Second user in any stage (i.e. in load event etc.). Whenever Second user tries to get the property of Shared object, the object will reset the actual property value and then return reset value.
    Anyone faced such issue while using shared object between two users. If so, I would appreciate if you could let me know your suggestions for following questions:
    1) Is there any way to get all the properties of shared object before sync event called, as I want to get it immediately when second user connect to the application and perform next task based on the values stored in shared object.
    2) Is it possible for second user to check whether any property has been set by first user? So that second user can use the property instead of reset it.
    Any kind of help would be greatly appreciated.
    Thank You.

  • How to retrieve line Item values from an object using groovy

    def RevenueObject = nvl(ChildRevenue,0);
    println('revenueItems==='+revenueItems.size());
    while(RevenueObject.hasNext())
    def revenueLine = RevenueObject.next();
    revenueLine.setAttribute('Test_c', 'Hello');
    } Groovy Scripting
    Error : Getting null value for Revenue object
    Exception in expression "OpportunityEO" trigger "getRevenueItems" : groovy.lang.MissingMethodException : No signature of method: oracle.jbo.server.ViewRowSetIteratorImpl.size() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), find(), use([Ljava.lang.Object;), with(groovy.lang.Closure), sleep(long), find(groovy.lang.Closure)
    at "OpportunityEO" trigger "getRevenueItems" line 7
    No signature of method: oracle.jbo.server.ViewRowSetIteratorImpl.size() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), find(), use([Ljava.lang.Object;), with(groovy.lang.Closure), sleep(long), find(groovy.lang.Closure)

    Depending on the message the line number might be in one of the fields:
    MESSAGE_V1
    MESSAGE_V2
    MESSAGE_V3
    MESSAGE_V4
    Although if the message simply is not meant to include the line number, it won't be there. That's the way it is. If there is a user exit available, you may add your custom messages with the line number. In some user exits (in sales order for sure) there is a special variable (flag), which is set when the BAPI runs the transaction.

  • Can i copy values from one object to another ?

    One more help..
    How do i compare the input values with the ones in an object of another class ?
    Can i copy values of one object of a class to different object of another class ?
    Thanks,
    Sanlearns

    How do i compare the input values with the ones in an
    object of another class ?By getting and comparing them?
    Can i copy values of one object of a class to
    different object of another class ?Yes, you can. But you shouldn't, as you're breaking encapsulation all over the place. You could use setter methods (if available) to set the values.

  • Error when fetching a binary value from a resul set

    SQL ERROR CODE: 17002; SQL ERROR MSG: Io exception: Bigger type length than Maximum
    The above mentioned error occurs when I try to fetch a binary column from a result set. I execute the following statement in my code.
    byte[] byteArr = jresultset.getBytes(columnIndex);
    i also tried to use getObject instead of getBytes and experienced the same problem.
    Any help is appreciated.

    Hi Isaias,
    we are working with this versions:
    SAP_BASIS     700     0015     SAPKB70015     SAP Basiskomponente
    SAP_AP                     700     0013     SAPKNA7013     SAP Application Platform
    We are not working with developer studio, only with the regular tools of the abap development workbench Transaction SE80.
    Thanks,
    Fouad

  • Using EL to get values from View Objects

    Hello again!
    I' m using jdev 11.1.1.4.0, with adf and business components
    Is there any way i can get a value to an af:outputText from a view object's field without
    a) having to expose all fields that I need in bindings tab?
    b) having to declare all fields to a backing bean
    I have a statistical table with about 30 numbers in a record and it would make my project impossible to follow!
    Some EL on the af:outputText with a parameter to a function on my backing bean, would sound perfect, but I've read that it's impossible...
    Any clues?
    Thank you for your efforts!
    Nikos

    I did not understand you.
    will the drag and drop your attribute on your page will solve your problem?
    or do you need to create attributeValues biding for single attribute? if yes do the following:
    1- From your page, right click and select Go to Page Definition.
    2- From the binding section, click the plus green icon to create a new control biding, and choose attributeValues from the list.
    3- select your data source from the list or create a new one, then select the attribute you need.
    4- now you have a biding, and you can set the value for your output text.
    value =#{biding.yourAttribute.inputValue}

  • Can af:selectOneRadio initial selection be set to values from view object?

    Using JDeveloper 11.1.1.4
    Hi all. I have a selectOneRadio on a data entry page which works well. Now I want to (if possible) use the selectOneRadio on an edit page--setting the choice initially to the values that were stored in a database table's record (from the data entry page). I am able to retrieve the data selected in the data entry page, but I can't find anything referencing what I want to do on the edit page. Note that my selectOneRadio objects are actually on jsff's in a region on a page. I've supplied how I designed selectOneRadio on the data entry page in hopes that someone can gleen from it and tell me how to set one up on the edit page and set its initial value to the value combination stored.
    There are two columns in the data displayed (example):
    Short Format / Text
    Short Format / Comma Delimited
    Long Format / Text
            <af:selectOneRadio value="#{bindings.Pay_File_Data_FmtVO1.inputValue}"
                               shortDesc="#{bindings.Pay_File_Data_FmtVO1.hints.tooltip}" id="sor1"
                               inlineStyle="text-align:left; font-size:2.0em;"
                               autoSubmit="true" showRequired="false" label="File Format">
              <f:selectItems value="#{bindings.Pay_File_Data_FmtVO1.items}" id="si111"/>
            </af:selectOneRadio>
    public class FileTypesBean {
        String fileFormat = null;
        String dataFormat = null;
        public BindingContainer getBindings() {
            return BindingContext.getCurrent().getCurrentBindingsEntry();
        public void getFileTypesSelection(ActionEvent actionEvent) {
            fileFormat =
                    (String)resolveExpression("#{bindings.Pay_File_Data_FmtVO1.attributeValue}");
            dataFormat =
                    (String)resolveExpression("#{bindings.Pay_File_Data_FmtVO1.attributeValues[1]}");
            //System.out.println("dataFormat = " + dataFormat);
            // now put in ParamsBean for use
            AdfFacesContext afci = AdfFacesContext.getCurrentInstance();
            ParamsBean params =(ParamsBean)afci.getPageFlowScope().get("paramsBean") ;
            params.setFileTypeParam(fileFormat);
            params.setFileDataTypeParam(dataFormat);
        public Object resolveExpression(String el) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ELContext elContext = facesContext.getELContext();
            ExpressionFactory expressionFactory =
                facesContext.getApplication().getExpressionFactory();
            ValueExpression valueExp =
                expressionFactory.createValueExpression(elContext, el,
                                                        Object.class);
            return valueExp.getValue(elContext);
    }Thanks in advance,
    Troy
    Edited by: Hoopestr on Apr 18, 2012 10:54 AM

    in the amimpl have an edit method, get the value you want to set and set that value for your af:selectOneRadio, row.setAttribute(PayFileDataFmtVO1, value);

  • How to return Values from Oracle Object Type to Java Class Object

    Hello,
    i have created an Oracle Object Types in the Database. Then i created Java classes with "jpub" of these types. Here is an example of the type.
    CREATE OR REPLACE TYPE person_type AS OBJECT
    ID NUMBER,
    vorname VARCHAR2(30),
    nachname VARCHAR2(30),
    geburtstag DATE,
    CONSTRUCTOR FUNCTION person_type RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_id NUMBER) RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_vorname VARCHAR2,
    p_nachname VARCHAR2,
    p_geburtstag DATE) RETURN SELF AS RESULT,
    MEMBER FUNCTION object_exists(p_id NUMBER) RETURN BOOLEAN,
    MEMBER PROCEDURE load_object(p_id NUMBER),
    MEMBER PROCEDURE save_object,
    MEMBER PROCEDURE insert_object,
    MEMBER PROCEDURE update_object,
    MEMBER PROCEDURE delete_object
    MEMBER PROCEDURE load_object(p_id NUMBER) IS
    BEGIN
    SELECT p.id, p.vorname, p.nachname, p.geburtstag
    INTO SELF.ID, SELF.vorname, self.nachname, SELF.geburtstag
    FROM person p
    WHERE p.id = p_id;
    END;
    My problem is, that if i use the member function "load_object" from my java app it doesnt return the selected values to the java class and i dont know why. I use the java class like this:
    PersonObjectType p = new PersonObjectType();
    p.load_object(4);
    There is a reocrd in the database with id = 4 and the function will execute successful. But if i try to use "p.getVorname()" i always get "NULL". Can someone tell me how to do that?
    Thanks a lot.
    Edited by: NTbc on 13.07.2010 15:36
    Edited by: NTbc on 13.07.2010 15:36

    CallableStatement =
    "DECLARE
    a person_type;
    BEGIN
    a.load_object(4);
    ? := a;
    END;"
    And register as an out parameter.
    Edited by: michael76 on 14.07.2010 05:01

  • How to show value from another Object as Default value from Prompt

    Hi,
       I am creating a web Report with the following filter :
    Enrollment Date FROM :   01/01/2011 12:00:00 AM  (Default 1st day of previous month)
    Enrollment Date TO :     01/02/2010 12:00:00 AM    (Default: 1st day of current month)
    There are values for Enrollment date from 01/01/ 2004 till today but user want to have a default value as in brackets above.
    When I select prompt option for 'Enrollment Date' all the dates (from 01/01/ 2004 till today) are shown as usual. Database is Oracle and I am able to create Objects in Universe that show the default required dates, but not sure how I use them in the prompt. Is there any way or workaround?
    Nanda Kishore.

    If i Understand Correctly you requirement you want to set a default value for date in prompt but user should have the ability to change these values if the want ?
    In order to implement this you can create a Object in Universe with definition
    Date Choice - @prompt('Default or Custom Date','A',{'Default','Custom'},mono,constrained)
    Then use this along with the date prompt in query filter as follows.
          Set Data choice =Default
            Date1= Default Date
            and
            Date2= Default Date
      OR
           Set Date Choice=Custom
            Date1 = Prompt
            and
            Date2= Prompt

  • Function module to fetch SOBID field value from hrp1001 table

    Hi,
    Is there any function module, to fetch the value of the SOBID field from hrp1001 table by passing RSIGN,RELAT,OTYPE,SCLAS field values to that function module.
    Regards,
    Shalini.

    Hi Sikindar,
    I am not able to find these function modules.I am getting message as function module not found.Please let me know is there any other function module.
    Thanks,
    Shalini.

  • Reading Null Values From Request Object

    For a proof-of-concept, I wrote a mini program that has 2 files. File #1 is main.html. There's a javascript function called addNewRowToThisTable that isn't displayed but it basically allows the user to create as many rows in the table as user desires. When the "Submit" button is clicked the file ReadIt.jsp is called and it's supposed to display on the first and last names of the people who had the checkbox for that row checked. The best way to illustrate the problem I'm having is through an example. Let's say there are 3 rows:
    [x] Alan Anderson [Add New Row]
    [ ] Bob Brady [Add New Row]
    [x] Carl Chadwick [Add New Row]
    [Submit]
    Let's assume that only rows 1 and 3 are clicked. After the form is submitted the JSP will print...
    firstNameArr .length = 3
    lastNameArr .length = 3
    isSelectedArr.length = 2
    firstNameArr[0] = Alan
    lastNameArr[0] = Anderson
    firstNameArr[1] = Bob
    lastNameArr[1] = Brady
    Unfortunately firstNameArr[1] and lastNameArr[1] should be "Carl", and "Chadwick" respectively. I know the reason why it's failing is because my program relies on the array index of the "isSelected" field to perfectly match up with the "firstName" and "lastName" fields. It's unreliable because if the checkbox for a row is not checked then it won't show up in the JSP String array isSelectedArr. I'm not really sure how to get around this problem. I have 2 ideas at the beginning of solutions but I'm not sure how to follow through on either and I'm also not sure if either is the proper approach to take. My guesses are...
    1) There's some way in JSP to use "getParameterValues('isSelected')" to retrieve the full array of "isSelected" items regardless of whether or not they're checked. That would guarantee that my arrays would match up correctly. Unfortunately, I haven't been able to find this.
    2) Maybe I can put in some sort of ID in the "isSelected" field that would relate the checkbox to the rest of the data in the row. The problem with this is that I've got a dynamic # of rows due to my addNewRowToThisTable method.
    So the bottom line is that I'm thoroughly stumped. If anyone can offer advice I'd be very grateful.
    main.html
    <html><head><title></title></head><body>
    <form method="get" action="ReadIt.jsp">
    <table>
    <tr>
         <td><input type="checkbox" name="isSelected" /></td>
         <td><input type="text" name="firstName" /> </td>
         <td><input type="text" name="lastName" /></td>
         <td><input type="button" value="Add New Row" onClick="addNewRowToThisTable(this)" />
    </tr>
    <tr>
         <td colspan=4><input type="submit" value="submit"></input></td>
    </tr>
    </table>
    </form>
    </body></html>
    ReadIt.jsp
    <%
    String[] isSelectedArr = request.getParameterValues("isSelected");
    String[] firstNameArr = request.getParameterValues("firstName");
    String[] lastNameArr = request.getParameterValues("lastName");
    if (firstNameArr != null) System.out.println("firstNameArr .length = " + firstNameArr .length);
    if (lastNameArr != null) System.out.println("lastNameArr .length = " + lastNameArr .length);
    if (isSelectedArr != null) {
         System.out.println("isSelectedArr.length = " + isSelectedArr.length);
         for (int i=0; i < isSelectedArr.length; i++) {
              System.out.println("firstNameArr["+i+"] = " + firstNameArr);
              System.out.println("lastNameArr["+i+"] = " + firstNameArr[i]);
    %>

    it's sort of a kludge, but try this:
    your javascript function adds new for fields that get submitted to the servlet. name the checkboxes uniquely with a patterm with said function, say isSelected-1, isSelected-2, isSelected-3... now also name the first and last name fields the same way. fname-1, fname-2, fname-3... lname-1,lname-2,lname-3.
    when you get to the page that is supposed to match them up, go through all the request parameters looking for those that start with "isSelected-" take the last char (the index), convert it to an int, and then from your request do:
    String first = request.getParameter("fname-" + indexThatWasFound);
              String last = request.getParameter("lname-" + indexThatWasFound);in looping over the request for each index recovered from the searching of the request for the isSelected-n values, you will get the matching first and last name.
    I TOLD you it was a kludge.

Maybe you are looking for

  • How do I handle my Final SELECT based on a @ReportType Run Parameter

    So I have multiple CTEs in my SQL... WITH CTE_1 AS (SELECT...) CTE_2 AS (SELECT...) CTE_3 AS (SELECT...) My Final SELECT then will be based on my CTE drill-downs and the filtering will be based on the @ReportType that will be chosen within SSRS and R

  • Office 365, Office 2013 and IaaS

    Hello all, I am planning to use a RDS environment built on AWS with Office 2013 pro plus deployed in it. Office 2013 pro plus would be licensed with a Volume License from a SPLA. I would like to know if I can subscribe to Office 365 business essentia

  • Importing finished DV short as a whole project

    i am attempting to import a finished short film (11 minutes) in order to then save as an mPEG to save to my iPOD. unfortunately imovie will only accept the project in 4.24 second chunks. how can i get imovieHD to accept all 11 minutes at once? and th

  • Setting findTextPreferences is not working

    Hi! I have an old script (written in javascript) we developed for InDesign CS3. It worked in that version of InDesign. Now we are moving to InDesign CC, so I started to adapt that script. It seems script is stopping in the following line of code: app

  • Help! I missed the code

    Sorry to have to ask this but I am a newbie and have to "attend" a job interview on Skype this afternoon for the first time. I just received a 15 second phone call giving an automated Skype message about a code for the call I am expecting at 3 o'cloc