This discussion is archived
5 Replies Latest reply: Feb 5, 2013 1:46 AM by SaurabhAg RSS

Multi Select LOV for a single field

ArpitaChakrabarty Newbie
Currently Being Moderated
Hi All,

I have a requirement where in I have a single field(LOV) in the advanced table of a base page (abcd.xml).
Now on click of the LOV, an LOV page should open and I should be able to select multiple lines from the LOV(containing a table with four columns) and eventually return an array. This array should contain all the values of 1st column appended in a string. So my return item should be an array of Strings.

How to implement an Multiselect LOV? And how to return the array from LOV page to the base page.

Please help me in finding a solution for this requirement.

Thanks in advance.

Regards,
Arpita
  • 1. Re: Multi Select LOV for a single field
    SaurabhAg Explorer
    Currently Being Moderated
    Hi Arpita,

    I understood that once the POP up opens up, from that screen you want to select multiple values, append them to one string and then return that complete string to your base page.

    Can you please explain me what is the role of this field (you mentioned as LOV) on base page. I mean what information will it display.

    Regards,
    Saurabh Agrawal
  • 2. Re: Multi Select LOV for a single field
    ArpitaChakrabarty Newbie
    Currently Being Moderated
    Thanks Saurabh for the quick reply.

    Let me elaborate the fields.
    Base Page:
    ----------------
    I have Claim information like claim id , Claim Line Amount(summation of all claim lines) and Status of the claim.
    This field "claim line amount" (Number) is an LOV. Let me say I type 123% and select the LOV. This line amount is not the criteria item. Criteria item is the claim id which I sent via a form value and forms the where clause of the LOV query.

    Claim id Claim Line Amount Status
    ---------- -------------------------- -----------
    101 25 (LOV) Open

    LOV page
    --------------
    Based on the query, LOV displays information of claim lines. For a single claim, there will be one or many claim lines.
    Now in the LOV page, a table displays. Column one is Claim line id and column 2 is claim amount. Let me select two lines, in the base page.
    Summation of column 2 will be done for the two selected lines of the table and sent to base page and this amount will be then displayed in base page column "Claim Line Amount".(Answer to your question).
    Next return item to base page will be the selected line's Claim Line id appended as String.

    <Checkbox> Claim Line Id Claim Line Amount
    ------------------ -------------------- -----------------------------
    <selected> 120120 15
    <selected> 130130 10
    <Not Selected> 140140 77

    Now since two rows got selected in the LOV page, so summation of claim line amount (i.e. 15+10=25) is sent as return item to the base page. And the Claim line id appended i.e "120120, 130130" is been sent.

    Please let me know if this explained your question.

    Thanks,
    Arpita
  • 3. Re: Multi Select LOV for a single field
    SaurabhAg Explorer
    Currently Being Moderated
    Hi Arpita,

    I think I understood your requirement. If there is no design constraint of having a LOV, I would suggest you a simple design.

    Make that LOV filed( Claim amount of say Base Page A.xml) as simple text field and associate a fire partial action to it .

    So whenever you enter an amount and tab out, a pop up will open where you can display a table with line details and you can have a multi select option for that table.

    This pop up window(say B.xml) you can make it MODAL, so until B.xml is open, user cannot access A.xml.

    After selecting one or more lines from the pop up window. Click a button say Apply. Now at click of Apply button your processformRequest of B.xml will be executed. From there you can redirect to same ProcessRequest of same B.xml.

    Fetch the selected Line amount, make a sum of it, use a small JavaScript to close this Modal Window and return the sum of amount back to your A.xml appropriate field.

    This is just a work around, if it suits you. Let me know, if you have any questions.

    Regards,
    Saurabh Agrawal
  • 4. Re: Multi Select LOV for a single field
    ArpitaChakrabarty Newbie
    Currently Being Moderated
    Thanks Saurabh.
    I need one more info and that is ... how do I make B.xml as MODAL?
    I liked this idea of making it MODAL and then you cannot type anything on A.xml until B.xml closes.

    Request you please elaborate the MODAL term and how to make a page as MODAL.
  • 5. Re: Multi Select LOV for a single field
    SaurabhAg Explorer
    Currently Being Moderated
    Arpita,

    Modal means, that the pop up window will only be active and the base page from where this pop up has launched will be inactive, until you close the pop up.

    javascript:openWindow(top, url, 'modal',{width:750, height:550, resizable:'yes'}, true);

    URL : 'OA.jsp?page=/xxx/yyy/webui/PopUpPG&param1={@XXX}&retainAM=Y&addBreadCrumb=Y'

    If you set the above java script in the destination URI of any button, then it will launch PopUpPG.xml as modal window.

    Also have a look at the thread Help on javascript pop windows

    Here you will find the code to run the Java Script Programmatically.

    Regards
    Saurabh

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points