Am implementing the Ribbon toolbar button. On button click depending upon the schema name, I need to create the popup with corresponding url (Aspx page). Previously I worked with only one aspx page and I am succeeded in the same, I created a popup java script file with the same name as aspx page and configured it in configuration file. But in case of multiple aspx pages even if I create multiple popup javascript files.It is not calling the respected javascript file.
How to map the popup java script files to aspx pages in case of multiple aspx pages?
PFB the code samples.
Button java script file code fragment:
if (some condition) {
//Creating the url
var url = "Editors/RTFExtension/Popups/ButtonReferencePopup_2.aspx?schemaId='" + schemaId + "'";
var popup = $popup.create(url, "toolbar=no,width=500,height=200,resizable=yes,scrollbars=yes", null);
}
else{
//Creating the url
var url = "Editors/RTFExtension/Popups/ButtonReferencePopup.aspx?schemaId='" + schemaId + "'";
var popup = $popup.create(url, "toolbar=no,width=500,height=200,resizable=yes,scrollbars=yes", null);
}
Config file code fragment:
<cfg:group name="RTFExtension.ButtonReference">
<cfg:fileset>
<cfg:file type="script">/Popups/ButtonReferencePopup.js</cfg:file>
<cfg:file type="script">/Popups/ButtonReferencePopup_2.js</cfg:file>
<cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
</cfg:fileset>
<cfg:dependencies>
<cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
</cfg:dependencies>
</cfg:group>
Please help me out in this issue. Thanks in advance. Early response is appreciated.
I believe you need to configure different groups for each config - something like this:
<cfg:group name="RTFExtension.ButtonReference.Popup1">
<cfg:fileset>
<cfg:file type="script">/Popups/ButtonReferencePopup.js</cfg:file>
<cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
</cfg:fileset>
<cfg:dependencies>
<cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
</cfg:dependencies>
</cfg:group>
<cfg:group name="RTFExtension.ButtonReference.Popup2">
<cfg:fileset>
<cfg:file type="script">/Popups/ButtonReferencePopup_2.js</cfg:file>
<cfg:file type="style">/Themes/ButtonReference.css</cfg:file>
</cfg:fileset>
<cfg:dependencies>
<cfg:dependency>Tridion.Web.UI.Controls</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
<cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
</cfg:dependencies>
</cfg:group>
In your popup code-behind you then need to reference the relevant group:
namespace Button.Reference.Popups
{
[ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
[ControlResources("RTFExtensions.ButtonReference.Popup1")]
public partial class PopupReference1 : TridionPage
Or:
namespace Button.Reference.Popups
{
[ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
[ControlResources("RTFExtensions.ButtonReference.Popup2")]
public partial class PopupReference2 : TridionPage