Question

Button in an Edit Page

I have a section where within the Edit page of Manifests, there is a detail grid (Stops). When you enter Stops, there is a detail grid (Passengers).

 

I have gotten a button working on the Stops page, but I cannot get a similar button working on Passengers. The button does not show up. 

 

Do these act differently and how can I get it to show up on Passengers.

 

Thanks!

Like 0

Like

8 comments

Heather,

Heather,

define("UsrSchema00abbfacDetail", [], function() {
	return {
		entitySchemaName: "UsrManifestStops",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "PassengerEmailButton",
				"values": {
					"itemType": 5,
					"style": "default",
					"caption": {
						"bindTo": "Resources.Strings.UsrPassengerSendEmailButton"
					},
					"click": {
						"bindTo": "onPassengerEmailButtonClick"
					},
					"visible": {
						"bindTo": "getPassengerEmailButtonVisible"
					},
					"classes": {
						"textClass": [
							"actions-button-margin-right"
						]
					}
				},
				"parentName": "LeftContainer",
				"propertyName": "items",
				"index": 9
			},
			{
					"operation": "merge",
					"name": "DataGrid",
					"values": {
						"unSelectRow": {"bindTo": "unSelectRow"}
					}
			},]/**SCHEMA_DIFF*/,
		messages: {
			"SandboxMessage_selectedDetailRows": {
        		mode: this.Terrasoft.MessageMode.PTP,
        		direction: this.Terrasoft.MessageDirectionType.PUBLISH
    		},
			"SetPassengerEmailButtonVisibility": {
                		mode: this.Terrasoft.MessageMode.PTP,
                		direction: this.Terrasoft.MessageDirectionType.PUBLISH
            		},
		},
		methods: {
 
			getPassengerEmailButtonVisible: function() {
 
                this.sandbox.publish("SetPassengerEmailButtonVisibility", true, [this.sandbox.id]);
 
                return true;
            	},
 
			onPassengerEmailButtonClick: function() {
				console.log("************************onPassengerEmailButtonClick BEGIN*******************************");
				/*console.log("selectedDetailRows: "+this.get("selectedDetailRows"));
				var processParam=this.get("selectedDetailRows");
				console.log("processParam: "+processParam);
				var args = {
                    	sysProcessName: "UsrProcess_60a5043Custom4",
                    	parameters: {
                        	//UsrStopList: this.get("selectedDetailRows")
							UsrStopList: processParam
                    	}
                	};
                ProcessModuleUtilities.executeProcess(args);*/
				console.log("************************onPassengerEmailButtonClick END*******************************");
			},
 
 
 
 
 
 
 
 
				rowSelected: function(primaryColumnValue) {
					console.log("**********STOPS rowSelected START**********");
					this.callParent(arguments);
					var rowsSelected =  this.get("SelectedRows") + "; " + primaryColumnValue ;
					console.log("rowsSelected: "+ rowsSelected);
					this.sandbox.publish("SandboxMessage_selectedDetailRows", { value: rowsSelected }, ["SandboxMessage_selectedDetailRows"]);
					console.log("**********STOPS rowSelected END**********");
 
				},
 
				unSelectRow: function(e) {
					console.log("**********STOPS unSelectRow START**********");
					console.log("unSelectRow: "+ e);
					var rowsSelected =  this.get("SelectedRows");
					console.log("rowsSelected: "+rowsSelected);
					if(e != null&&rowsSelected!="undefined"&&rowsSelected!=null)
						{
							var rowsSelectedAdjusted = rowsSelected.toString().replace(e," ");
							console.log("rowsSelectedAdjusted: "+rowsSelectedAdjusted);
							this.sandbox.publish("SandboxMessage_selectedDetailRows", { value: rowsSelectedAdjusted}, ["SandboxMessage_selectedDetailRows"]);
						}
					console.log("**********STOPS unSelectRow END**********");
				},
		}
	};
});

 

Heather,

define("UsrSchema5a69bc7aPage", [], function() {
	return {
		entitySchemaName: "UsrManifestStops",
		attributes: {
			"IsPassengerEmailButtonVisible": {
                dataValueType: this.Terrasoft.DataValueType.BOOLEAN,
                value: true
            }
					},
		messages: {
            "SetPassengerEmailButtonVisibility": {
                mode: this.Terrasoft.MessageMode.PTP,
                direction: this.Terrasoft.MessageDirectionType.SUBSCRIBE
            }
        },
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{
			"UsrPassengers": {
				"schemaName": "UsrSchema96dcd22dDetail",
				"entitySchemaName": "UsrManifestPassengers",
				"filter": {
					"detailColumn": "UsrManifestStop",
					"masterColumn": "Id"
				}
			}
		}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
				subscribeSandboxEvents: function() {
                this.callParent(arguments);
                this.sandbox.subscribe("SetPassengerEmailButtonVisibility", function(result) {
					this.set("IsPassengerEmailButtonVisible",true);
                }, this, [this.sandbox.id]);
            }
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
                "operation": "insert",
                "name": "PassengerEmailButton",
                "parentName": "CombinedModeActionButtonsCardLeftContainer",
                "propertyName": "items",
                "values": {
                    "itemType": Terrasoft.ViewItemType.BUTTON,
                    "style": Terrasoft.controls.ButtonEnums.style.DEFAULT,
                    "caption": {"bindTo": "Resources.Strings.UsrPassengerSendEmailButton"},
                    "visible": { "bindTo": true},
					/*"IsPassengerEmailButtonVisible" },*/
                    "click": {"bindTo": "onCardAction"},
                    "tag": "onPassengerEmailButtonClick",
                    "classes": {
                        "textClass": ["actions-button-margin-right"]
                    }
				}
			},
			{
				"operation": "insert",
				"name": "UsrNameda876bf8-62eb-40b2-b8c2-8961afd7d75a",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "ProfileContainer"
					},
					"bindTo": "UsrName",
					"enabled": false
				},
				"parentName": "ProfileContainer",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "UsrManifest8681bc69-62cc-4e47-90da-02bdb0fa2619",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 1,
						"layoutName": "ProfileContainer"
					},
					"bindTo": "UsrManifest",
					"enabled": false,
					"contentType": 5
				},
				"parentName": "ProfileContainer",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "STRING64619b44-5b72-4e36-b8e8-11e5d7fb354c",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "Header"
					},
					"bindTo": "UsrStopID",
					"enabled": false
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "STRINGbcf14d4f-8472-4894-93cb-a7b3bca7a697",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 1,
						"layoutName": "Header"
					},
					"bindTo": "UsrStopNumber",
					"enabled": false
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "STRING12558636-f4a5-461a-9ea5-5b7f5244c14e",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 2,
						"layoutName": "Header"
					},
					"bindTo": "UsrStopName",
					"enabled": false
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 2
			},
			{
				"operation": "insert",
				"name": "UsrDetails",
				"values": {
					"caption": {
						"bindTo": "Resources.Strings.UsrDetailsTabCaption"
					},
					"items": [],
					"order": 0
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "UsrPassengers",
				"values": {
					"itemType": 2,
					"markerValue": "added-detail"
				},
				"parentName": "UsrDetails",
				"propertyName": "items",
				"index": 0
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Heather,

Did you write this button on the Passengers page?

Can you please show this page?

Dmytro Vovchenko,

It's not on the Passengers page, it is on the Stops page.

Heather,

It's in the first code section I provided.

Dmytro Vovchenko,

I got this working. I think I had just confused which page should have which functions, but I re-did it more carefully and now it's working. Thanks.

Show all comments