How can an ExtraColumn type property be used in a Custom Control in XPages? - custom-controls

When defining the properties of a custom control in the "Property Definition" section, you can choose as "Type" in the "Property" tab the option of "extraColumn" and "iconColumn".
How should this type be used ?

Both iconColumn and extraColumn relate to the corresponding tags of the dataView control. You would typically use these when your custom control contains a dataView and you wish to allow an outside control to pass in details about the columns to be used in the dataView.

When a data view is used in a standard XPage, the extraColumns appear as actual columns. The summaryColumn is the first column and shows as a link.
However, in a mobile application, extra columns show up as additional lines of data in the mobile data row. The summaryColumn value shows as "header" in the data row, while the extraColumn values show underneath that value.
<xe:dataView id="dataView1" pageName="#contactDetails" collapsibleDetail="true">
<xe:this.data>
<xp:dominoView var="view1" viewName="TeamDirectoryNameLU">
</xp:dominoView>
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="Name"></xe:viewSummaryColumn>
</xe:this.summaryColumn>
<xe:this.extraColumns>
<xe:viewExtraColumn columnName="Office" style="font-size:12pt"></xe:viewExtraColumn>
<xe:viewExtraColumn columnName="OfficePhone" style="font-size:12pt"></xe:viewExtraColumn>
<xe:viewExtraColumn columnName="Email" style="font-size:12pt"></xe:viewExtraColumn>
</xe:this.extraColumns>
</xe:dataView>
One row of that might display as:
Ian Kennedy
London Office
44-22-830-6000
ian.kennedy#company.co.uk

Related

Hide/Remove Text in the Column in CRM View "Items Available To Work on" for Queue Item entity

When a user opens the view "Items Available To Work on" for QueueItem entity, a related entity's column is showing some data in the view. I want to remove or hide that data when another column in the view has some specific data in it.
Here is the actual example which I need to achieve.
When the field "Case Type" has text "Revenue Collection" then hide text "Dummy Taxpayer" from the field "Taxpayer". Both fields are showing from related entity Case in this QueueItem view.
I have checked the following possibilities but these are not working.
1- RetrieveMultiple message cannot be used with the QueueItem entity.
2- Tried with entity "SavedQuery" on RetrieveMultiple, but that is giving FetchXML of the view. We cannot change the result of the FetchXML dynamically here also.
3- In the properties of the column "Taxpayer" in the view, we do not have the option to run a JavaScript as my CRM version is 2016. This feature is available in Dynamics 365.
So, there is no supported way to achieve this as per my understanding. Any help/suggestion is appreciated on this issue
In Grid,
You cannot Hide/show column dynamically depending on your condition. Rather you can enable/disable field so that users cannot edit field based on Condition.
Please find Link Article as Example.
This is more of a data captured problem rather than data hide/show problem.
When the case type is "Revenue Collection", the value of the "Tax payer" should be null. Then this problem is solved in grid/view or form and everywhere.

Rails: disable input tag upon selection from a dropdown menu

Scenario/Context
I've got a drop down menu with two input elements underneath.
From the dropdown menu, are names of companies (with values set to the respective company id's), and another prompt to Add a new company.
If the option to Add a new company is selected from the dropdown, then the user is to fill out the 2 input field elements (i.e. company name and company email).
Otherwise, if an available company is selected from the dropdown,
then the 2 input fields (for company name and email are to be disabled).
My question
Is this possible to do without an AJAX call if I want things to happen without a page refresh?
Can anyone suggest some other alternatives??
Many thanks!
That is absolutely possible, though you'd need to use some JavaScript to make it happen and load a bit more data to the DOM on the initial page load.
For each option in your company select dropdown, add a data attribute for the name and email.
Then, watch that dropdown for the change event in JavaScript. Whenever that event is fired, if the data-company-name and data-company-email attributes are defined for the selected option, disable the input fields and populate them with those values. If those data attributes are not defined for the option (likely only for your 'Add a new company' option), then clear the values from the input fields and enable them.

How do I link two fields to the same table in ServiceNow?

Forgive my ignorance for the proper terminology, but let me try to explain what I want to happen.
I have two custom fields on the incident table/form. I have created a custom table with 2 columns. I have figured out how to reference the table in one of the fields, allowing me to search the entries. Now I want to link the field selection to the other field via the custom table I made. When I make a selection in field A, I want field B to populate with the other column on the same row Field A pulled from in the first place. How would I do that?
Sounds like you want what's commonly referred to as a "derived field" or a dot-walked field.
You have a reference field which stores the reference to the other table, and want a second field on the form that shows another field on that referenced table. You don't actually need to create a new element, you just need to add a dot-walked form element.
Once you have the reference field added, go to Personalize/Configure the form layout.
In the slushbucket of available fields, you'll notice that reference
fields show up in green text with a little [+] next to them.
Select your reference field and a little button will show up between the two
lists, just above the "Add" button
Click that button and the left-side available fields will show the fields available on that reference field's table.
From here, select that second field that you want to display on your form, and bring it over to the right side where you want it.

Kendo Grid - Customize Filter Row

there is a feature called "Filter Row" in Kendo Grid
http://demos.telerik.com/kendo-ui/grid/filter-row
I want to add a drop-down list instead of a text box or a number box, to the filter box. It's for filtering a column that has countries. So I want list of countries in a drop-down list. How can I do this?
It's very similar to the custom Filter Menu (http://demos.telerik.com/kendo-ui/grid/filter-menu-customization). I made the mistake of no using valuePrimitive: true. You might not want it in your situation but keep that in mind.
Here's a sample: http://dojo.telerik.com/OKaS
Also, the filter menu should take up the editor model of the column but it's not always what you want.
Edit
Starting from 2014 Q2 SP1, the template function now receives an object containing "datasource" and "element". In my example, you would have to change the dropdown initialization from "container.kendoDropDownList" to "container.element.kendoDropDownList". The datasource is empty in my example but I'm assuming this can be used to pass the choices to a control without requiring another datasource or to externalize your current. I have not experimented with this feature but I suggest you do before taking my sample blindly.
As Pluc mentioned earlier valuePrimitive: true will help you create a custom filter for your grid/columns to send id's to your controller, if you are not using setting this property true you will receive an Object in your controller instead of a number, the conversion will not be made automatically . This is still working as of 2019

Showing date from two rows in table view, respectively in two text fields, via binding

I have a class named as transaction in which one attribute is transactionDate which is of type NSDate.
I am using NSArrayController to display a list of transactions in a table view.
My requirement is-
I want to show date in first row in a
text field labeled as "From" and date
in last row in a text field labeled as
"To".
My questions is-
Can I achieve this via binding in IB?
If yes then how?
Thanks,
Miraaj
Yes, you can do this (or something like it), see the #min and #max array operators.
Here's how to do a very simple version of this:
Open Interface Builder - create a new application
Add an NSArrayController, set it to automatically prepare content.
Add a Table, label the two columns "name" and "age"
Add a Button (labelled "+") and two Labels (change name to maxval, minval)
Wire up the NSArrayController bindings as follows:
Here's the application running (just in interface builder "simulate" mode). To use it, click + then click on the top row of the table and put a name in the first column and an age in the second. Then repeat for a few more people.
This all looks a bit cryptic, but it is sufficient. I added the labels "Max Age" and "Min Age" for clarity in my version.
Unfortunately this is not something Bindings is particularly good at. You could achieve it but it would be very hacky.
The NSTableViewDataSource protocol is still a perfectly relevant and valid way to provide data to a table. In cases like these (where you're not just presenting a straight-vanilla set of uniform data to a table) the data source protocol is the only sane way to solve the problem. This way you're in complete control of what the table displays.
The only "hard" part is that, if you're using Core Data, your data source class will need to observe the Managed Object Context for changes and reload the data (either -reloadData to refresh the whole table or use -reloadDataForRowIndexes:columnIndexes: to cherry pick the rows you want to refresh).

Resources