This discussion is archived
7 Replies Latest reply: Nov 16, 2012 10:37 AM by Santhu Kalewar RSS

REG:How to get the webBean Of the Single Selection in Table Region

Santhu Kalewar Newbie
Currently Being Moderated
Hi Techies,


How to get the webBean Of the Single Selection(Checked And Unchecked Val) in Table Region
I have one Query Region(Auto Customization Criteria) -------> Table Region------------>SingleSelection.
After Selection of Radio Button ----->Click on Submitt Button.
Then I need To Get Row Reference Value .

Thanks & Regards
San
  • 1. Re: REG:How to get the webBean Of the Single Selection in Table Region
    keerthioaf Expert
    Currently Being Moderated
    Hi San ,

    Your Logic should go like this ,

    Step 1 : Create an transient attribute and attach to the VO associated to table region .

    Step 2 : When ever you select radio button set the transient attribute to ' Y' dynamically .

    Step 3 : Iterate the table rows from first record till last record ( till rowCount ) .

    Step 4 : On click of a submit button You need to select the record which is having transient value as 'Y' which means current selected record .

    I have achieved the same using below code .

    if(oapagecontext.getParameter("CreateOffer")!= null)

    {
    String vacancyname = null;
    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);



    OAViewObject oaviewobject =(OAViewObject)am.findViewObject("ApplicationsListVO");
    if(oaviewobject!=null)
    {


    int rowcountValue = oaviewobject.getRowCount();

    Row rowAdv= oaviewobject.first();
    RowSetIterator iterator = oaviewobject.createRowSetIterator("iterator");
    iterator.setRangeStart(0);
    iterator.setRangeSize(oaviewobject.getRowCount());



    for(int i=0; i<iterator.getRowCount(); i++)
    {

    rowAdv =iterator.getRowAtRangeIndex(i);
    if(rowAdv != null)
    {

    if(rowAdv.getAttribute("SelectFlag")!=null)
    {

    String flagValue = rowAdv.getAttribute("SelectFlag").toString();

    if("Y".equalsIgnoreCase(flagValue))
    {

    // You logic


    }
    }
    }


    Please let me know if its not clear .

    Keerthi
  • 2. Re: REG:How to get the webBean Of the Single Selection in Table Region
    Santhu Kalewar Newbie
    Currently Being Moderated
    Hi Keerthi

    not working for me .after selection of radio button i need to click Submit button When iam click on submit button it's automatically Single selection showing Un check.And i always getting very first row reference only please help on this

    Thanks & Regards
    San
  • 3. Re: REG:How to get the webBean Of the Single Selection in Table Region
    keerthioaf Expert
    Currently Being Moderated
    San ,

    Before proceeding further i would like to know if you have created a transient attribute with name as " SelectFlag"
    and which is of Boolean type ??


    Keerthi
  • 4. Re: REG:How to get the webBean Of the Single Selection in Table Region
    keerthioaf Expert
    Currently Being Moderated
    San ,

    Note that you don't have to set any fire action for this .

    Keerthi
  • 5. Re: REG:How to get the webBean Of the Single Selection in Table Region
    Santhu Kalewar Newbie
    Currently Being Moderated
    Hi Techie,

    when iam selecting Single selection radio button after that clicking on Submitt button it's automatically Unchecks and showing all row reference values (IF ANY Single Selection RADIO BUTTON CLICK IAM GETTING ALL VALUES AND Automatically RADIO BUTTON Unchecks)So Please Help on this
    I used Your code like this.
    if(pageContext.getParameter("SubmittBtn")!= null)
    {
    String vacancyname = null;

    OAViewObject oaviewobject =(OAViewObject)am.findViewObject("YcaPpoListVO");

    if(oaviewobject!=null)
    {
    int rowcountValue = oaviewobject.getRowCount();
    Row rowAdv= oaviewobject.first();
    RowSetIterator iterator = oaviewobject.createRowSetIterator("iterator");

    iterator.setRangeStart(0);
    iterator.setRangeSize(oaviewobject.getRowCount());

    for(int i=0; i<iterator.getRowCount(); i++)
    {
    rowAdv =iterator.getRowAtRangeIndex(i);
    vacancyname=rowAdv.getAttribute("PpoNumber").toString();

    System.out.println("PpoNumber Value:"+vacancyname);

    if(rowAdv != null)
    {

    if(rowAdv.getAttribute("SelectFlag")!=null)
    {
    String flagValue = rowAdv.getAttribute("SelectFlag").toString();
    System.out.println("flagValue:"+flagValue);
    if("Y".equalsIgnoreCase(flagValue))
    {

    // My logic

    try
    {
    CallableStatement cs =
    (CallableStatement)am.getOADBTransaction().getJdbcConnection().prepareCall("{call SSP_PPO_PKG.Clone_PPO(?,?,?,?,?,?,?)}");

    System.out.println("Try Block");
    cs.setString(1,"T");
    cs.setString(2,"T");
    cs.registerOutParameter(3, Types.VARCHAR);
    cs.registerOutParameter(4, Types.INTEGER);
    cs.registerOutParameter(5, Types.VARCHAR);
    cs.setString(6,vacancyname);
    cs.registerOutParameter(7, Types.VARCHAR);
    cs.execute();

    //am.getOADBTransaction().commit();
    OAExceptionUtils.checkErrors(am.getOADBTransaction());


    throw new OAException("Created sucessfully", OAException.CONFIRMATION);
    }

    catch(Exception e)
    {
    System.out.println("Catch::"+e.getMessage());
    throw new OAException(" Created sucessfully", OAException.CONFIRMATION);
    }
    }
    }


    }

    }
    iterator.closeRowSetIterator();
    }


    }
  • 6. Re: REG:How to get the webBean Of the Single Selection in Table Region
    keerthioaf Expert
    Currently Being Moderated
    San ,

    Hope you have not attached any fire action .Instead of single selection , you can also try just by creating column and select column item style as radio button .
    attach Transient attribute to this column , make it selected will return 'Y ' unselected will return 'N' .

    And use the above code i have mentioned in the thread . Please mail me your skype id / gmail id . I will give you a walk through how to do it .

    Keerthi

    Edited by: keerthioaf on Nov 16, 2012 6:00 AM
  • 7. Re: REG:How to get the webBean Of the Single Selection in Table Region
    Santhu Kalewar Newbie
    Currently Being Moderated
    Hi Techie

    the radio button also Same issue replicating.

    For the Table --->Flow Lay Out---------->item Style is Radio Button For this also Same issue Replicating

    Thanks & Regards
    Santhu.kalewar@gmail.com

Legend

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