1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Problem in master-detail form on "Apply"

Discussion in 'JAVA, SOA and Application Development' started by ac.arijit, Dec 15, 2012.

  1. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hi experts,

    I've got a master-detail OAF page and in the details resultsTable (based on a VO, which is based on an EO) i've
    1. one messageLovInput item
    "Location(View attr: LocationCode[transient])".
    2. two messageTextInput items
    "LocationId(View Attr: LocationId[EO])",
    "LocationNameId(View Attr: LocationNameId[transient])"
    3. three more messageStyledText items
    "LocationType(View Attr: LocationType[EO])",
    "LocationName(View Attr: LocationName[transient])" and
    "SubinventoryCode(View Attr: SubinventoryCode[transient])"

    Now, the ideal situation or ideal way how the program should run:
    1. On invoking and selection of LOV, the values for all the 6 items should be returned from the lov(*which is working fine).
    2. I've two VO attributes VendorId and OrganizationId which i need to set the value of LocationNameId[transient](mentioned above) depending on the LocationType
    attribute. So, i've a custom logic to iterate through the VO and set these attributes, which is executed when "Apply" button is clicked before getTransaction().commit();
    (But, this is not happening actually when i do this iterate portion, the changes ain't committed. And when i removed this iteration portion, changed are committed, but my
    objective ain't fulfilled)
    3. When on-ProcessRequest() of the page the executeQuery() of VO runs, i need to get the respective values in the transient attributes of VO also to display them in detailsTable
    so, after executeQuery() i've added a custom logic to iterate through the VO and retrieve the values for transient attributes by using PreparedStatement. (This is also not
    working)

    Plz help experts .. ASAP
    Regards
    Ari :hurray
     
  2. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Hey experts,

    Plz reply ASAP .. :)
    Regards
    Ari
     
  3. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Haah !! finally i figured it out ... pheew! :hurray

    Thanks 2 all for the support ;)
    Regards
    Ari
     
  4. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    ....and the solution was?
     
  5. ac.arijit

    ac.arijit Forum Advisor

    Messages:
    217
    Likes Received:
    22
    Trophy Points:
    280
    Location:
    Kolkata, India
    Wow !! ... someone's interested 1/256 .. nice :D

    Alright, as stated earlier the 1st issue was initially working fine.
    So,
    Firstly we should resolve the 3rd issue ... i.e
    Instead of using transient attributes use non-EO based calculated attributes in the VO to derive the values you wanna display in the advancedTable. And i believe u don't need to use any preparedStatement for this.

    Secondly, the 2nd issue .. i.e
    the problem was that the messageStyledText items weren't returning the values to the VO attribute. So, here's a workaround .. infact the ideal approach.

    Let the display items be as it is of type messageStyledText and create extra formValue items with rendered property true for as many messageStyledText items you have in the advancedTable and set the View Attribute corresponding to the attributes referred by the messageStyledText items. And walla !! job is done :hurray

    E.g: in my case,
    i changed the items "LocationId" and "LocationNameId" as formValue items and ViewAttributes as it was intended to.

    And took 3 extra formValue items for "LocationType", "LocationName" and "SubinventoryCode". And its done.. probably this will work for everyone seeking solution to this sort of issue.

    "All u need is formValue items" .. Best of luck !! :D
    Regards
    Ari
     
    DTSIGuy likes this.
  6. chandresh

    chandresh Active Member

    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    75
    Location:
    India
    I want to put validation on my column Invoice Date (i.e. take only sysdate-2 and sysdate+7) ..Can u Please Help me out..

    Thanks...