3 Replies Latest reply: Jun 17, 2013 9:23 AM by Peddi RSS

    changing coulmn Read only on CWB based on value

    user469514

      Hi

      Could some one please help me, I have a Req. of CWB (Compensation Table) to make read only on "Proposed Rating" based on value, i don't findthe column on "Personalize Dynamic Column". Is there a way to iterate the value inside the table on Processrequest and by extending CO, and make is read only like how we do in Oracle Forms Post query. Any ideas would be greatly Appreciated.

       

      Thanks  you

        • 1. Re: changing coulmn Read only on CWB based on value
          Peddi

          You have to use SPEL to do this.

           

          Let us say, you want to make Proposed Rating as read only when the vo attribute VOAttr1 is TRUE(boolean). If it's FALSE(boolean), then the Proposed Rating should be as normal text.

          As the deciding attribute type is boolean, then just set the Read Only property of Proposed Rating to ${oa.yourViewInstance.VOAttr1} using personalization. It will work.

          If the deciding attribute is not of type boolean then follow below procedure

           

          Now extend the base VO and create a transient attribute called ProposedRatingRO with type BOOLEAN.

          In the VORowImpl of your extended VO, override the getter method of the transient attribute(getProposedRatingRO) and write your logic to set it to TRUE or FALSE based on the deciding attribute(comment the existing code in the getter method).

          And using personalization set the Read Only property of Proposed Rating to ${oa.yourViewInstance.YourNewTransientAttribute}. It will work.

           

          Regards,

          Peddi.

          • 2. Re: changing coulmn Read only on CWB based on value
            user469514

            Thank you Peddi,

             

              Since the "AllocationVO" is referencing 5EO, I extended the CO added dynamicViewAttribute and initialize the value True or False, Since its programmatically created its java.lang.Object). When i set the SPEL on Read Only for Proposed Rating (MessageChoice Bean) its not reflecting, is this because the Attribute type is not Boolean?. Any thoughts will be help full

             

            Thanks

            • 3. Re: changing coulmn Read only on CWB based on value
              Peddi

              It doesn't matter if the VO is based on 5 EOs or 1 EO. You are adding transient attributes, that means you are not changing the base query.

              For your kind of requirement, it's always recommended to extend the VO and create a transient attribute of type Boolean and return(true/false) the value accordingly in the getter in extended VORowImpl.

               

              Regards,

              Peddi.