In a another blog post, we covered how to open dialogs within Aras Innovator using custom forms and HTML pages. However, Aras Innovator also supports a number of built-in dialogs that offer common functionality. A previous blog post also covers how to open a date dialog from within a custom Method, but you can also use this same approach to open numerous other dialogs like an Item Search Dialog and a File Selector as well.

You’ve most likely seen a number of these before, and in this blog post, we will cover how to open these dialogs from your own client-side methods.

Standard Aras Dialogs

In addition to opening forms or custom HTML pages as dialogs, Aras Innovator 11.0 also comes with several differentuilt-in dialog types as well.

Search Dialogs

One of the most common of these is the SearchDialog which allows a user to search for, select, and return one or more Items. In the example below, I am opening a SearchDialog on the Part ItemType and printing out the item number of any part selected.

  var param = {
  aras: top.aras,
  type: 'SearchDialog',
  dialogWidth: 700,
  dialogHeight: 450,
  itemtypeName: 'Part'
  };
   
  function callback(res) {
  if (res) {
  var itemNumber = res.keyed_name;
  alert("Part #" + itemNumber + " was selected");
  }
  }
   
  var topWnd = top.aras.getMostTopWindowWithAras();
  var wnd = topWnd ? topWnd : window;
  wnd.ArasModules.MaximazableDialog.show('iframe', param).promise.then(callback);

This sample also demonstrates the MaximazableDialog  (with that spelling). There is no functional difference between this and a regular dialog except for an additional button in the toolbar that will expand the dialog to the dimensions of the parent window.

Other standard Dialogs

You can see that we can display different dialogs by passing in an argument to the “type” parameter. A full list of “types” and the arguments that can be passed in can be found below. Note that not all arguments may be necessary.

  1. All (Every dialog type expects these parameters)

    • aras – The aras object to give the dialog access to the standard aras functions
  2. SearchDialog
    • itemtypeName – The name of the ItemType to open a search dialog for
    • itemtypeID – The ID of the ItemType to open a search dialog for
    • handler – A function that handles the return value of the search dialog
    • sourceItemTypeName – *See below*
    • sourcePropertyName – You can trigger an “onSearchDialog” event of a property by specifying both the name of the parent ItemType and the property name that contains the event
    • mutliselect – A boolean indicating if a user can return more than one value
  3. ImageBrowser
    • showOnlyExternalFile – A boolean indicating if a user should be able to select one of the internal Aras icons
  4. Date
    • date – The default date that the date dialog will start on when it is opened
    • format – The date format of the string that will be returned
  5. HTMLEditorDialog
    • sHtml – The source HTML that will load in the editor when it is opened
  6. RevisionsDialog
    • itemID – The ID of the item to open the revisions dialog for
    • itemTypeName – The name of the ItemType the item is an instance of
    • doNotOpenItemOnDblClick – A boolean indicating whether a user should be able to open an item from the revisions dialog
  7. ManageFileProperty
    • onchange – A function to run if the file property is changed
    • fileNode – The node of the File Item
    • fileId – The ID of the File Item
    • editable – A boolean indicating whether the File should be able to be changed
    • cleanup – A boolean indicating whether the File can be deleted
  8. Text
    • content – The text to be displayed in the dialog
    • isEditMode – A boolean indicating whether the text should be editable
  9. Color
    • oldColor – The color that should be initially selected when the dialog is opened

Aras Alerts

In addition to all of these dialogs, Aras Innovator 11.0 also includes several different single-use dialogs to display messages to the end user.

AlertError

If a user inputs some invalid data or if something serious goes wrong in client-side code, you can easily throw an error using the sample below.

aras.AlertError("Something went very wrong");

AlertWarning

If something less serious goes wrong, you can use instead throw a warning to the user.

aras.AlertWarning("Something went only slightly wrong");

AlertSuccess

Lastly, when you want to inform your users that something has gone right, you can display an unobtrusive success message using the following sample.

aras.AlertSuccess("Something went right!");

Success alerts are very helpful in providing feedback. For example, you can use a success message to indicate that data has been successfully copied to a user’s clipboard.

Aras Prompts

Aras Innovator 11.0 also comes with two different kinds of dialogs to get simple information from users. These functions are very similar to the built-in JavaScript prompt and confirm functions. However, using the Aras prompt and confirm will ensure that the dialogs look similar across all browsers.

prompt

You can pass in both a message or question you want answered from the user as well as a default value to the textbox of the prompt.

aras.prompt("Are you excited to try out all of these cool new dialogs?", "Yes!");

confirm

There are times when you want users to confirm that they really want to go through with an action. For example, you could have a button on a form that deletes an item. In these cases, you can use the built-in confirm function.

aras.confirm("Are you sure you want to delete this item?");

Confirms will display a window with your message as well as an OK and cancel button. If a user clicks OK the function will return true, otherwise it will return false.

In Conclusion

The built-in Aras dialogs offer a simple way to accomplish common tasks. Additionally, they can ensure that any custom functionality you create keeps a consistent look with the rest of Aras Innovator.

Leave a comment if you learned something or if you have any questions about dialogs that this blog post didn’t cover!

Standard Aras Dialogs的更多相关文章

  1. Xamarin.Forms 开发资源集合(复制)

    复制:https://www.cnblogs.com/mschen/p/10199997.html 收集整理了下 Xamarin.Forms 的学习参考资料,分享给大家,稍后会不断补充: UI样式 S ...

  2. Xamarin.Forms 开发资源集合

    收集整理了下 Xamarin.Forms 的学习参考资料,分享给大家,稍后会不断补充: UI样式 Snppts: Xamarin Forms UI Snippets. Prebuilt Templat ...

  3. Devexpress VCL Build v2013 vol 14.1.3 发布

    我修,我修,修修修. New Major Features in 14.1 What's New in VCL Products 14.1 Breaking Changes To learn abou ...

  4. 整理 Xamarin.Forms - Plugins

    Open Source Components for Xamarin Xamarin官方整理的一些开源组件,有需要可以先到这里找 GitHub: xamarin/XamarinComponents: ...

  5. SharePoint 2010 Pop-Up Dialogs

    转:http://kyleschaeffer.com/sharepoint/sharepoint-2010-pop-up-dialogs/ SharePoint 2010 makes it incre ...

  6. Aras Innovator如何配置SMTP中转Office365

    参考文档:http://www.ebdadvisors.com/blog/2015/7/31/configure-an-smtp-server-in-windows-iis-for-aras-inno ...

  7. 理解 .NET Platform Standard

    相关博文:ASP.NET 5 Target framework dnx451 and dnxcore50 .NET Platform Standard:https://github.com/dotne ...

  8. Standard C 语言标准函数库介绍

    全面巩固所知所学,往精通方向迈进! Standard C 语言标准函数库速查 (Cheat Sheet) from:http://ganquan.info/standard-c/function/ C ...

  9. Python语言中对于json数据的编解码——Usage of json a Python standard library

    一.概述 1.1 关于JSON数据格式 JSON (JavaScript Object Notation), specified by RFC 7159 (which obsoletes RFC 46 ...

随机推荐

  1. SQL Server DATEADD() 函数 一步步使用教程

    SQL Server DATEADD() 函数 DATEADD() 函数在日期中添加或减去指定的时间间隔. DATEADD(datepart,number,date)date 参数是合法的日期表达式. ...

  2. C++ Primer Plus 6 笔记(3)

    第5章 1.cout在显示bool值之前将它们转换为int,但cout.setf(ios:: boolalpha)函数调用设置了一个标记,该标记命令cout显示true和false,而不是1和0 2. ...

  3. 5G/NR OTA (Over The Air) 测试详解

    原文链接:http://www.sharetechnote.com/html/5G/5G_OTA.html 1 什么是OTA (Over The Air) OTA代表Over The Air.为了使用 ...

  4. JDK8~JDK11的新特性

    #JDK 1.8 新特性接口中的静态方法 只能由接口自己调用 接口中的默认方法 可以不被覆盖 #JDK 1.9 新特性(可能在JDK8中被忽略了,没来得及加)接口可以定义私有方法,但是只能让自己调用, ...

  5. 046、Java中使用if…else判断

    01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...

  6. 初学者的困惑:OOP与一般编程的区别

    *在写<程序猿的思维修炼>随笔中,我们大概猜想到了,OOP的思想更趋于模块化,更独立,因此称为一个个对象,本次随笔将对OOP和一般编程的区别有更详细的解释 面向对象编程的含义: 面向对象编 ...

  7. 一文详解scala泛型及类型限定

    今天知识星球球友,微信问浪尖了一个spark源码阅读中的类型限定问题.这个在spark源码很多处出现,所以今天浪尖就整理一下scala类型限定的内容.希望对大家有帮助. scala类型参数要点 1. ...

  8. 使用Hibarnate: 出现 java.sql.SQLException: ORA-00911: 无效字符, 解决思路

    1. 查看到: Hibernat自动生成的sql查询语句 Hibernate: select * from ( select module0_.MODULE_ID as MODULE_ID1_1_, ...

  9. 虚拟机安装centos6.5出现Error processing drive:pci-0000:00:10-scsi-0:0:0:0问题

    vmware安装linux系统出现Error processing drive:pci-0000:00:10-scsi-0:0:0:0问题 问题出现原因:我给虚拟机的内存太小了,只给了512M 解决办 ...

  10. 【STM32H7教程】第51章 STM32H7的LTDC应用之LCD汉字显示和2D图形显示

    完整教程下载地址:http://www.armbbs.cn/forum.php?mod=viewthread&tid=86980 第51章       STM32H7的LTDC应用之LCD汉字 ...