8 Replies Latest reply on Oct 13, 2009 2:23 PM by ztelo

    Custom webPart wich consume a RTTreeView

    ztelo

      I created a custom webpart wich consume a RTTreeView. The custom webpart implementes the IParametersOutConsomer. In the ParametersOutReady method, i try to get the value for the selected node from the RtTreeView.

       

      I tryed : selectedtag = parametersOutReadyEventArgs.ParameterValues[0]; =>This give me an empty value.

       

      I tryed : selectedtag = parametersOutReadyEventArgs.ParameterValues[1];=>This give me the value, but when i select another node from the RtTreView it does not give the selected value!!

       

      And so on.. i tried ParameterValues[3]; ParameterValues[4]; i am not able to know witch case in the ParameterValues Array that contain the value for the selected node.

       

      Does any one have any idea how can i get the seleced node value?.

       

      Thank you in advance.

        • Re: Custom webPart wich consume a RTTreeView

          What do you mean by the value for the selected node exactly? If you mean the name/path of the selected module, then that would be ParameterValues[3] and ParameterValues[5].

           

          If you mean the actual snapshot value for the PI Points referenced by the PI Aliases resolved in the selected node, then I'm afraid this cannot be done... RtTreeView can provide information about the selected node, as well as a listing of the resolved aliases/properties - not their actual value.

           

          Did you try getting that information from RtTable web part? (maybe a hidden one)

            • Re: Custom webPart wich consume a RTTreeView
              ztelo

              Thank you for your reply.

               

              In fact, i need to get the tagname (or tag name list) contained in the alias(es) of the selected node.

               

              I checked ParameterValues[1] and ParameterValues[2] but I'm not sure which one is the actual tag name. For example, sometimes the correct tag name is in ParameterValues[1], but at other times this field is empty and the tag name is in ParameterValues[2].

               

              I would need to know what information each element in the ParameterValues array is supposed to contain, or what rules are used to populate each element (e.g. why is ParameterValues[1] sometimes filled, and sometimes empty?)

               

              Thank you in advance.

                • Re: Custom webPart wich consume a RTTreeView
                  cescamilla

                  I'll verfiy that in a bit... I wish there were a webpart that showed all the parameters that it is receiving and that also published the same parameters out, in that way it could work as a debuggin webpart.

                  • Re: Custom webPart wich consume a RTTreeView
                    formerpigeek

                    Your IParametersOutConsumer should implement the ParametersOutProviderInit event handler.

                     

                    This event will provide the ParametersOutProviderInitEventArgs object which specifies the schema for the data received in ParametersOutReady.

                     

                    In this schema, where ParameterOutProperties.ParameterName is equal to "AliasTagList"; "i" will indicate the ordinal for that data in ParametersOutReady (e.g. ParameterValues).

                      • Re: Custom webPart wich consume a RTTreeView

                        Indeed, there is just no way to document what each parameter is in ParameterValue[] – it depends on how the web part is configured. Two different instances of RtTreeView can have two different parameters at the same index, because the web part instances are configured differently. As Robert pointed out, the best (well, the only!) way to know what's at each index and react accordingly in ParametersOutReady, is to check ParametersOutProviderInitEventArgs in ParametersOutProviderInit.

                         

                        In the case of RtTreeView, more than 1 parameter will provide the names of the tags for the selected mode: 1 for each tag resolved from the module aliases, and 1 which provides a semicolon-separated list of those tags. Look for "AliasTagList" to discover which one provides that list.

                  • Re: Custom webPart wich consume a RTTreeView
                    cescamilla

                    The RTTreeview is one of the webparts that do not accept parameters from other webparts, so I guess you mean to say that you created a web part that is consuming parameters fron the RTTreeView.

                     

                    If that is indeed the case, then you need to use the IParametersInConsumer or the IParametersOutConsumer.

                     

                    The method you are calling corresponds to IParametersOutProvider and, as such, will not be able to receive the parameters you expect.

                     

                    Please use ParametersInReadyEventArgs instead.

                    • Re: Custom webPart wich consume a RTTreeView
                      cescamilla

                      There is something I forgot to ask you...

                       

                       

                       

                      Are you running this code client side or server side?

                       

                       

                       

                      If it is client side do not forget to create the JavaScript file that will allow the object to send the parameters to another web part in the client, otherwise you would need to do a full postback.