Current filter:
                                You should refresh the page.
                                  • Hello again DevEx team.

                                    I have a mobile application with an object with string property shown in its detail view.

                                    There is a view controller targeting that object that has an action.

                                    Is it possible to add the action's button (or implement a custom button/editor to perform the necessary logic) to that string property editor?

                                    Thanks!

                                    - Kyle

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Kyle,

                                Our mobile string property editor does not provide this functionality. You can either create a custom property editor as described in the How to: Add an XAF Mobile Custom Module article or add an action to the Detail View as described in the How to: Include an Action to a Detail View Layout article.

                                Show all comments
                                • Kyle Cohen 10.14.2019

                                  I began implementing this solution, but the XAF Mobile UI Template that it instructs to create is not an option in the template gallery.

                                  However, I believe that this will achieve what I'm trying to accomplish. I already created actions and added them to the detail view, but the client doesn't like the single-column layout and wants the action's button to appear in the field that it will be editing.

                                  Would you tell me the required references to be able to access the XAF Mobile UI Template or how to otherwise access this template so that I can create the custom editor?

                                  Thanks!

                                • Dennis (DevExpress) 10.15.2019

                                  Hello Kyle,

                                  With v19.1.5, the "XAF Mobile UI Custom Module" Item Template is removed from the Add New Item dialog. If you need it, download and extract the attached XAF_Mobile_UI_Custom Module.zip file's content into the YourSolutionName.Mobile project.

                                  Take special note that the Mobile UI is in maintenance mode. For more information, see OBSOLETE - XAF Mobile UI (Maintenance Mode) FAQ.

                                • Kyle Cohen 10.15.2019

                                  Thank you Dennis.

                                  I downloaded the module template files and added them to my solution.

                                  I then followed the instructions in the recommended article, but I've reached a point where I'm unsure of how to proceed. I did the following, but the application doesn't ever finish loading (no exceptions thrown).

                                  Steps Taken:
                                  - I modified the files to change the name of the module.
                                  - I registered the module in the mobile application.
                                  - I added the editor that inherits Mobile String Property Editor
                                          - The example only showed how to implement for view mode, but I need to add the button in edit mode.
                                          - My editor overrides "CreateEditModeControlCore" instead of "CreateViewModeControlCore".
                                          - My editor overrides "ReadEditModeValueCore" instead of  "ReadViewModeValueCore".
                                  Editor:

                                  [VB.NET]
                                  Public Class CurrentScanEditor Inherits CustomComponent Public Sub New() Type = "currentscaneditor" End Sub End Class <PropertyEditor(GetType(String), False)> Public Class CurrentSerialNumberTextEdit Inherits MobileStringPropertyEditor Public Sub New(ByVal objectType As Type, ByVal info As IModelMemberViewItem) MyBase.New(objectType, info) End Sub Protected Overrides Function CreateEditModeControlCore() As Component Dim editor As New CurrentScanEditor() editor.AddStyle("padding", "0px") Return editor End Function Protected Overrides Sub ReadEditModeValueCore() Dim linkControl As CurrentScanEditor = CType(Control, CurrentScanEditor) linkControl("text") = BindToCurrentObjectProperty() End Sub End Class

                                  - I modified widget.js to add a button (I believe this is where I'm going wrong):
                                  widget.js:

                                  [JavaScript]
                                  var componentInfo = { componentViewModel: (viewModel) => { var result = $.extend({}, viewModel); //var parentViewModel = viewModel.parentViewModel(); //var globalViewModel = viewModel.globalViewModel(); return result; }, defaults: { style: { /*width: "auto", height: "auto"*/ } }, buttons: [ { location: "after", name: "scanButton", options: { stylingMode: "Contained", text: "Scan", type: "default", width: "10", onClick: function (e) { if(cordova && cordova.plugins && cordova.plugins.barcodeScanner) { cordova.plugins.barcodeScanner.scan( function (scanResult) { if (!scanResult.cancelled) { $model.CurrentObject.PreviousSerialNumber = scanResult.text; } }, function (scanError) { DevExpress.ui.notify({ closeOnClick: true, message: scanError, type: 'error' }, 'error', 5000); } ); } } } ] }; DevExpress.ExpressApp.Mobile.updateComponentInfo("currentscaneditor", componentInfo);

                                  - I then changed the model to use the new editor in place of the Mobile String Property Editor.

                                • Vladimir Sh (DevExpress) 10.16.2019

                                  Hi Kyle,

                                  I don't see the reason why you have endless loading. I suppose what any errors occurred on the client. Press F12 and check if you have client-side errors in the browser console.

                                  Also, as I can see from your code, you are using the buttons property. This property was introduced in version 19.1 of the DevExtreme components. But in XAF Mobile, version 18.1 is used. To use the StringPropertyEditor and additional buttons together, you can use the approach from the Buttons in dxTextBox ticket. If this information does not help, please send a sample project where the issue is reproducible.

                                  Thanks

                                • Kyle Cohen 10.16.2019

                                  It kind of helps. It's what I'm looking for, so that's great!

                                  However, it doesn't resolve the issue for me. First, because the only information in that question is a little bit of JS code that creates the widget instances in a JS file that doesn't exist in the module template (or I'm confused). Second, because it doesn't say how it is implemented to a custom module.

                                  I don't see any details of how that is implemented, so if you could elaborate on how to implement the code below in relation to what I've already posted above I'd really appreciate it:

                                  HTML:

                                  [HTML]
                                  <div style="width:290px;border-style:solid;border-width:1px;"> <div data-bind="dxTextBox: {}" style="width: 200px; float: left;border-style:none;"></div> <div data-bind="dxButton: { text: 'Button1' }"></div> </div>

                                  JS:

                                  [JavaScript]
                                  ko.applyBindings();

                                  Finally, the errors that I'm seeing in the dev console are 404 not found on the new module's "module" file that definitely exists in the solution and the bin folder build. It appears to be searching for the files in a default location that isn't where the files exist.
                                  - Physical path from error: <mobile module folder>\Static\19.1.5.0\modules@1.20.24\scaneditor\module.json
                                  - Actual physical path: <mobile module folder>\ bin\Debug\modules\scaneditor\module.json

                                  Thanks!

                                • Uriah (DevExpress Support) 10.17.2019

                                  Hello Kyle,

                                  We need additional time to answer your question. Please bear with us. We will get back to you as soon as possible.