• No replies
28 Posts

Pinned topic Using paramvalues to enable Reuse of Custom Dialog with dynamic Description

‏2013-10-28T20:57:57Z | custom dialog offering self service
In Self Service, we are creating offerings. Most of the offerings have the same basic format, just a different title and description. We wanted to reuse the same custom dialog for many Offerings, so we needed a way to pass a variable into a custom dialog for offerings. In the XML for the dialog, pmscoffering.xml, we have "dialog beanclass" for each custom dialog, and we have set the label for that dialog to label = "{0}" in the hopes that offering description will be passed to the dialog when it is painted. The field to be passed is the offering description: 

I want to share with the group what that syntax is in the xml, to be able to pass in the Description to the 
label field so we can re-use a custom dialog for many offerings.

Here is what I found:

To alter your xml code to allow for dynamic use of the Description field, in pmscoffering.xml:

<dialog beanclass="" headercss="pmscoffcat_dialog_header" id="YourDialogName" label="{0}" labelcss="pmscoffcat_dialog_header" relationship="PMSCCRSPEC">

<datasrc id="YourDatasourceID" relationship="PMSCOFFERING"/>

        <paramvalues id="basicDialog" property="label">

            <paramvalue dataattribute="DESCRIPTION" datasrc="YourDatasourceID" id="basicDialog01" position="0"/>


Explanation: Above you see datasrc referenced down in the paramvalue section. This tells the system the identification of the object you are working on. Dataattribute  shows DESCRIPTION, that is what you are passing to the dialog from the main program. Paramvalues id is arbitrary, as is the id="basicDialog01", but they must be different.

Position="0" is a reference up to the {0} in the dialog beanclass header line.

You may not need this now, but it might be helpful later.

Good Luck,