Add Dropdown to infragistics WebDataGrid in Edit mode - infragistics

I have two issues:
I have a complex object with Id and Text underneath. For display, I am using TemplateDataField with eval function. Can I bind the complex object to a BoundDataField?
The reason behind binding the complex object to BoundDataField is, I need to make it editable grid. I could not find any documentation or samples which uses Template field, and make that column editable. (I agree it might not be possible.) Now I need to put a dropdown, where user selects a value and I can assign it to the id field of my complex object. I am able to put a dropdown (using EditorProviders) to a bounddatafield, but how can I do it for the template data field described above?
Here is a link to the samples of Editing WebDatagrid: Controls & Application Samples

When using a TemplateDataField you are specifying what you want to use as the template and you can put an editor in that Field. Note that if you do put an editor in that field, you need to handle updates to the grid's value or list that your grid is bound to.
Note that if the values in your drop down have an id associated with them and that can be the value of the grid cell it would be better to use the DropDownEditorProvider with the grid having a bound field where that field is the id of the item that you are selecting.

Related

How to set a value to an application item in oracle apex 5

I have several tabs. There is a date picker on each tab. I need that date to be the same on all tabs no matter what. So, if the user changes the date on Tab 1, then goes to tab 2, the date on tab 2 will have changed also. I have never created an application level item before and I thought that might be the most efficient way to accomplish what I need (by setting that item's value to the date the user selected). My problem is that I don't know how to set the value of the application item and also how to retrieve that value on another tab.
You didn't describe what exactly you're trying to do, but - if each tab represents its own table, why do you keep the same date value in all of them? Doesn't look like a normalized data model. Consider using a single date column (in one - master - table) and use (i.e. reference) it in others (i.e. details).
As of your question: How about creating a global page (i.e. page 0) and having a date picker item on it? You can display it on any other page you want. For example, if you set its value while on tab 1 and then move on to tab 3, you can again modify that value which will be visible on all other pages. Basically, you'd maintain just one item instead of as many as number of tabs involved. (BTW, doesn't that remind you of what I described in the first paragraph?).
Alternatively, create a date picker item on tab 1 page; on all other pages, create a "lookup" (display) item which would simply display what's been selected on tab 1. That's easy to do, just make its source to be an "Item", such as P1_DATE_ITEM.
In Shared Components > Application Items create new Item called G_DATE.
Then for every datepicker add Dynamic Action on Event Change.
In True action Set Value select Type PL/SQL Expression with code
:G_DATE := :P1_DATEPICKER1;
and Items to Submit :P1_DATEPICKER1
Next in every datepicker Source set Type PL/SQL Expression with code
:G_DATE
used Always (...)
Regards

Using different controls in a editable column

I have a kendoGrid initialized in cshtml. It use ajax binding.
The grid model looks like
int id,
int typeId,
string name.
string value.
The grid has 2 columns Name and Value and value is editable InCell.
For now grid works well with using by default usual textbox as editor.
I have to improve the grid to have possibility of using different controls in the "value" field depending of the value of "typeId".
I tried to use custom EditorTemplate for that but I cannot find a way to pass typeId to the template (the column is bound to "value").
Is it possible to pass there an extra parameter from the grid model or reach it somehow from the template?
Regards, Alexey

Display one value and return another in text field with autocomplete Oracel Apex 5

I want to be able to have a text field with autocomplete in Apex 5 that displays a client name, city and state, but just returns that client's client_id from the table.
I'm currently using a popup LOV
Is something like this even possible? I've been digging around for hours for a way to make it happen.
There are plugins out there that accomplish this, but I haven't personally used them.
Here's what I've done:
Add a hidden item
Create a dynamic action to parse the autocomplete item and set the hidden item equal to this value.
Create a validation to ensure that the hidden item's value meets your expectations.

Predicting the placeholder for a dynamic placeholder

I am using the Dynamic Placeholders from Fortis, but need to setup a page template where the Dynamic Placeholders contains renderings. I am setting the page template up, by setting layout detail on the standard values of the page template.
I have been unable to succeed in this, since the dynamic placeholder is postfixed by a GUID which is generated. Is there a way to predict this GUID? According to the documentation, the GUID is generated using the following logic:
Dynamic Placeholders simply use the rendering ID to create a unique placeholder name. If more than one dynamic placeholder with the same name is in a rendering it will also append on an incrementing number
I tried another approach, by using a home brewed dynamic placeholder library, which just prepended the dynamic placeholder with a sequential number, e.g. row1, row2, row3. But this approach makes the content editors unable to move rows in the experience editor, since the content inside the row is tied to a fixed number, which changes when the rows are moved.
As this question have been answered on sitecore.stackexchange.com, I want to bring the answer here as well. Big credit to Richard Seal and Thomas D.
Thomas D:
You can try to open the standard values item with the Experience Editor and add the renderings you like.
Richard Seal:
This is an alternative to the method mentioned by Thomas D.
The Fortis solution uses the UID for the rendering attached to the placeholder key that you enter. You can get this by changing to Raw Values view and copying the xml out of the renderings or final renderings field.
Find the rendering that contains your placeholder. There will be an xml element like this:
<r id="{CA76EB6F-2934-4B8A-BB6A-508A8E44A7C5}"
ph="body"
uid="{0FD41EBD-43CF-4647-8A0F-F1F1D2E00CCD}" />
There may be other fields too. The 2 that are important are id, which is the item id of your rendering item and uid, this is the unique rendering id that is added to your placeholder key.
The key is built like this: string.Format("{0}_{1}", placeholderName, renderingId);
So if you have a placeholder key called title, the key for the above xml snippet would be: title_{0FD41EBD-43CF-4647-8A0F-F1F1D2E00CCD}

Infragistics UltraGrid - How to use displayed values in group by headers when using an IEditorDataFilter?

I have a situation where I'm using the IEditorDataFilter interface within a custom UltraGrid editor control to automatically map values from a bound data source when they're displayed in the grid cells. In this case it's converting guid-based key values into user-friendly values, and it works well by displaying what I need in the cell, but retaining the GUID values as the 'value' behind the scenes.
My issue is what happens when I enable the built-in group by functionality and the user groups by a column using my editor. In that case the group by headers default to using the cell's value, which is the guid in my case, so I end up with headers like this:
Column A: 7F720CE8-123A-4A5D-95A7-6DC6EFFE5009 (10 items)
What I really want is the cell's display value to be used instead so it's something like this:
Column A: Item 1 (10 items)
What I've tried so far
Infragistics provides a couple mechanisms for modifying what's shown in group by rows:
GroupByRowDescriptionMask property of the grid (http://bit.ly/1g72t1b)
Manually set the row description via the InitializeGroupByRow event (http://bit.ly/1ix1CbK)
Option 1 doesn't appear to give me what I need because the cell's display value is not exposed in the set of tokens they provide. Option 2 looks promising but it's not clear to me how to get at the cell's display value. The event argument only appears to contain the cell's backing value, which in my case is the GUID.
Is there a proper approach for using the group by functionality when you're also using an IEditorDataFilter implementation to convert values?
This may be frowned upon, but I asked my question on the Infragistic forums as well, and a complete answer is available there (along with an example solution demonstrating the problem):
http://www.infragistics.com/community/forums/p/88541/439210.aspx
In short, I was applying my custom editors at the cell level, which made them unavailable when the rows were grouped together. A better approach would be to apply the editor at the column level, which would make the editor available at the time of grouping, and would provide the expected behavior.