8 Replies Latest reply: Apr 11, 2013 2:18 AM by BSR RSS

    Assigning two editors to a attribute

    Nelash Jindal
      Hi,

      Can any body tell me if its possible to assign two attribute editors to a single attribute and then choosing on rum time what editor it should call to edit the data??

      Thanks in advance

      Ragards,
      Nelash Jindal
        • 1. Re: Assigning two editors to a attribute
          BSR
          Hi,

          FatWire doesn't provide a feasibility to assign multiple attribute editors to a single attribute.
          By "runtime", if you mean, you have to show different attribute editors for a same attribute in different asset type edit screen. It is possible.

          ~BSR
          • 2. Re: Assigning two editors to a attribute
            Nelash Jindal
            Hey BSR,


            Thanks for the reply.

            But I am still confused. We assign a attribute editor to a attribute at the time of its creation. So how will I show different attribute editors for a same attribute in different asset type edit screen?

            Can you help me this?


            Thanks,
            Neash Jindal
            • 3. Re: Assigning two editors to a attribute
              BSR
              Hi Nelash,

              I would suggest two ways for this. Please verify with experts before you implement.

              1. Create two different attributes A1, A2 with same display name A,A and assign two different attribute editors AE1, AE2 for each. Add both attributes to your asset definition and show them selectively on both inspect & edit screens, based on subtypes ST1,ST2. Say, you need to show AE1 for ST1and AE2 for ST2 & your original attribute will be A1.
              So, when you save ST1, value provided in AE1 will be saved to A1, absolutely no problem. But when you save ST2, value provided in AE2 must be copied to A1, instead of A2 & this can be implemented in Filter, with subtype check.

              2. No need to create A2 and AE2. Have A1-AE1 combination for any subtype. Do an asset type check in your cs-element(written to code your custom attr. editor) & display corresponding attribute editor only, based on check.

              Hope this helps!
              Reply if any more elaboration needed!


              Mark Helpful or Correct if applicable..
              ~Sushanth Reddy

              Edited by: B S R on Mar 14, 2013 12:55 PM

              Edited by: B S R on Mar 14, 2013 12:58 PM
              • 4. Re: Assigning two editors to a attribute
                997392
                Why not simply have a single attribute with a one attribute editor that dispatches to a different element based on whatever logic is required to choose the appropriate attribute editor.

                For example if the subtype was the deciding factor then you might have the following elements.

                OpenMarket/Gator/AttributeTypes/MyAttributeEditor
                OpenMarket/Gator/AttributeTypes/MyAttributeEditor/<subtype1>
                OpenMarket/Gator/AttributeTypes/MyAttributeEditor/<subtype2>

                OpenMarket/Gator/AttributeTypes/DisplayMyAttributeEditor
                OpenMarket/Gator/AttributeTypes/DisplayMyAttributeEditor/<subtype1>
                OpenMarket/Gator/AttributeTypes/DisplayMyAttributeEditor/<subtype2>

                Of course in 11g you can also put the subtype elements under CustomElements/OpenMarket/Gator/AttributeTypes/.........

                Of course depending on how you configure the attribute editor it might make your XML Attribute Editor a little complex. You could have separate elements for each subtype in the example above and you read from Presentation Object based on the subtype.

                Regards,

                Graham

                Edited by: 994389 on Mar 17, 2013 2:35 PM
                • 5. Re: Assigning two editors to a attribute
                  Mahalwar
                  Hi,

                  tell me a real life example where we need 2 editor for single attribute??


                  one attribute can be of one data type and for each data type there is one editor.
                  • 6. Re: Assigning two editors to a attribute
                    vivek lal
                    Can you share what is the requirement?
                    • 7. Re: Assigning two editors to a attribute
                      Nelash Jindal
                      Hi,

                      Sorry for replying late.

                      My requirement is like i have one drop down menu. and based on the value selected in this, I want to assign a separate editor to a single attribute.

                      Eg: in Drop down , if I choose Offer as value, editor should be one creating radio button and if I choose product, editor should be one creating another dropdown.


                      Thanks,
                      Nelash Jindal
                      • 8. Re: Assigning two editors to a attribute
                        BSR
                        Hi, I don't think there is any 'Dependent Choice List' kind of option in Webcenter Sites. You may have to use some out-of-box jquery to achieve this..