4 Replies Latest reply: May 30, 2013 8:12 AM by Tarun Prakash RSS

    Detaching viewinstance of an item programatically

    Tarun Prakash
      Hi,

      Can we detach the viewinstance of an item programatically in controller.??
      If it is possible, please provide the code sinippet


      Regards,
      Tarun
        • 1. Re: Detaching viewinstance of an item programatically
          SumitSharma
          There is something called SetViewUsage & SetViewInstanceName.. you can explore further yourself. :)
          • 2. Re: Detaching viewinstance of an item programatically
            keerthioaf
            Hi Tarun ,

            You can try creating a multiple instance of view object and work accordingly , when you shuttle VO to AM the instance will be create
            with increment of numeric value eg : xxvo1 , xxvo2 etc , see if you can handle through multiple vo instance .

            Instead of removing VO instance , try restricting the functionality and scope of each instance individually .

            Let us know your requirement clearly , will try to help you out .


            --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
            • 3. Re: Detaching viewinstance of an item programatically
              Sandeep M.
              You can try below code (I assume your item is OAMessageTextInputBean else change the class accordingly):


              OAMessageTextInputBean omt = (OAMessageTextInputBean)webBean.findChildRecursive("Item_name");
              if(omt!=null)
              {
              omt.setViewUsageName(null);
              omt.setViewAttributeName(null);
              }