How can I get a selector to do a partial lookup on any field in the list - acumatica

I have a selector that is selecting cases among several other fields, as follows:
[PXSelector(typeof(Search2<CRCase.caseCD,
InnerJoin<PMProject,
On<CRCase.customerID, Equal<PMProject.customerID>>>,
Where<PMProject.contractID, Equal<Current<EPTimecardDetail.projectID>>>,
OrderBy<Desc<CRCase.caseCD>>>),
typeof(CRCase.caseCD),
typeof(CRCase.subject),
typeof(CRCase.createdDateTime),
typeof(CRCase.caseClassID),
typeof(CRCase.status),
typeof(CRCase.contactID),
typeof(CRCase.ownerID))]
When the selector is open, the search bar will only search on the first field - the CaseCD. If I type part of the Subject field text, I want it to show, as in other lookups, the entries that have that snippet of text in them. i.e., if I know part of the Subject field, I want it to filter or show entries filtered on that bit of text I enter.
Is there a setting in the PXSelector attribute that allows this, or would it be on the aspx page for the Selector?

In the past (unless there is something new) we set the FastFilterFields in the page.
Ex from project entry on contract cd (page PM301000):
<px:PXSegmentMask ID="edContractCD" runat="server" DataField="ContractCD" DataSourceID="ds" AutoRefresh="True">
<GridProperties FastFilterFields="Description, CustomerID, CustomerID_Customer_acctName" />
</px:PXSegmentMask>
Each field listed in FastFilterFields will be searchable in the selector.
Use of FastFilterFields will apply to PXSegmentMask or PXSelector.
Another example showing selector:
<px:PXSelector ID="edReceiptNbr" runat="server" DataField="ReceiptNbr" AutoRefresh="true">
<GridProperties FastFilterFields="InvoiceNbr, VendorID, VendorID_Vendor_acctName">
</GridProperties>
</px:PXSelector>

Related

Xpages Extlib dataView control sets "display:none;" style when column has empty value

I have a xpage with Extension Library DataView control. I have defined several extra columns there.
<xe:dataView id="dataView1"
<xe:this.data>
<xp:dominoView var="vMyView" />
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="$DateFrom"
columnTitle="Date From">
</xe:viewSummaryColumn>
</xe:this.summaryColumn>
<xe:this.extraColumns>
<xe:viewExtraColumn columnName="$DateTo"
styleClass="hidden-xs" headerStyleClass="hidden-xs" columnTitle="Date To"
style="hidden-xs">
</xe:viewExtraColumn>
<xe:viewExtraColumn columnName="$Information"
columnTitle="Information">
</xe:viewExtraColumn>
</xe:this.extraColumns>
</xe:dataView>
My view data source contains same cells where information is empty. Those cells are rendered with style="display:none;".
How can I avoid this attribute and display those empty cells? I'd like not to change my view to fill empty cells with i.e. "-" char
An empty column value gets rendered with style="display:none;":
You can avoid this if you add a custom converter to your column definition and replace an empty value by a space:
<xe:viewExtraColumn columnName="$Information"
columnTitle="Information">
<xe:this.converter>
<xp:customConverter>
<xp:this.getAsString><![CDATA[#{javascript:value == "" ? " " : value}]]></xp:this.getAsString>
<xp:this.getAsObject><![CDATA[#{javascript:value}]]></xp:this.getAsObject>
</xp:customConverter>
</xe:this.converter>
</xe:viewExtraColumn>
It gets rendered to a "normal" grid cell without display:none then:
The code for getAsObject doesn't matter as long as the cell is not editable. So it's OK to just leave the value as it is.
Instead of using a converter to "fake" some content, you could also adjust the css. Just implement
.lotusTable TD {
display: inline !important;
}
in a style sheet resource used in your custom control(s).
So you also won't have to apply a converter to every potentially empty column.

Sharepoint Custom Field Render Pattern: Render to multiple fields

Initial Question
Can I render the data from one field into multiple columns?
Background
I have created a custom field that contains a drop down list and two text boxes. The idea is that users can select a supplier from the drop down list that is connected to a list of suppliers. Which will get the contact name and number of the supplier and populate the corresponding textboxes.
I have done it this way as it is important to be able to override the contact number and the address but the client wants to see the defaults.
Heres what it looks like:
On saving the new entry the value of the field is saved as follows:
;#1;#Supplier 1;#Contact Name;#01234 567890;#
I chose to save the data in this was so I can treat it like a multi-column field when I render it.
I am using the below code to split the data and override the display pattern for the list view:
<RenderPattern Name="DisplayPattern">
<Switch>
<Expr>
<Column />
</Expr>
<Case Value="" />
<Default>
<!--<Column SubColumnNumber="0" HTMLEncode="TRUE" />
<HTML><![CDATA[<br/>]]></HTML>-->
<Column SubColumnNumber="1" HTMLEncode="TRUE" />
<HTML><![CDATA[ - ]]></HTML>
<Column SubColumnNumber="2" HTMLEncode="TRUE" />
<HTML><![CDATA[ - ]]></HTML>
<Column SubColumnNumber="3" HTMLEncode="TRUE" />
<HTML><![CDATA[]]>]></HTML>
</Default>
</Switch>
</RenderPattern>
This allows me to present the data to the end user as follows:
Question
I would like to be able to display this split data in seperate columns. I notice that the build in title field SharePoint uses has four types of columns you can add to a view for a single field. I am trying to reproduce this kind of functionality so each section of the data can be added or removed from views. Is this possible?
It turns out you have access the list item which meant I was able to simply just add to additional fields within the list item by overriding the UpdateFieldValueInItem method.
Public Overrides Sub UpdateFieldValueInItem()
Me.ItemFieldValue = ddlSupplier.SelectedItem.Value
If Me.Item.Fields.ContainsField(Me.Field.InternalName & "-" & "Telephone") Then
Me.Item(Me.Field.InternalName & "-" & "Telephone") = txtTelephone.Text
End If
End Sub
A much more effective way of doing this.

Export Telerik RadGrid with EditMode lines

I need to export a RadGrid table, and it contains several EditMode lines.
I would like to choose which content to export or ideally, if possible, change the lines to
EditMode = false
before exporting, so it looks how I need.
Code Details:
I have a few GridTemplateColumn, here is one of them:
<telerik:GridTemplateColumn
ItemStyle-Wrap="false" UniqueName="DataInicioAtividade"
DataField="DataInicioAtividade" HeaderText="*Data Inicio">
<ItemTemplate>
<telerik:RadDatePicker runat="server" ID="data_inicio" MinDate="1900/1/1">
<DateInput runat="server"
CssClass="date-picker" ID="rad_dateInput_data_inicio"
MaxLength="10" CausesValidation="true" />
</telerik:RadDatePicker>
</ItemTemplate>
</telerik:GridTemplateColumn>
And a button that simply executes the code:
rgd_grid_naoiniciada.ExportExcel();
The problem is, as it looks, telerik RadGrid exporting just dumps the HTML code of the resulting table to an Excel file.
The behaviour of the component is just like it should be, but the resulting file should have the field values, instead of HTML code containing input fields, links, images of RadCalendar etc...
Thanks in advance.
When you export Set the Templatecolumn values to the text property of Template column and then give ExportOnlyData="true";
This will work for Template columns also now.
In ItemBoundEvent, give the following code.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((isExport) && (e.Item is GridDataItem))
{
GridDataItem item = e.Item as GridDataItem;
item["DataInicioAtividade"].Text = ((RadDatePicker)item["DataInicioAtividade"].FindControl("data_inicio")).SelectedDate.ToString();
}
}

How to Disable ToolTip without Removing the "title" attribute [ASP.NET]

I have 3 TextBoxes
<asp:TextBox ID="txtTitle" runat="server" class="txtFields" title="Title" />
<asp:TextBox ID="txtName" runat="server" class="txtFields" title="Name" />
<asp:TextBox ID="txtDescription" runat="server" class="txtFields" title="Description" />
I'm using the watermark plugin on these 3 TextBoxes:
jQuery('.txtFields').watermark();
This is the plugin:
http://code.google.com/p/jquery-watermark/
jQuery('.txtFields').watermark();
Uses the Title Attribute of the TextBox to Show the Watermark but the problem is that this also Generates ToolTips which is something I do Not want, is there anyway to disable the tooltips without removing the title attribute?
Or is there anyway to use custom attributes with this plugin? By that I mean making the plugin use another attribute instead of the title attribute.
Thank you.
Looks like watermark will allow you to specify any text to display in there, so you're not stuck with the title. Any attribute that you could select with jQuery you could use as the watermark value. The problem with that is there are no other attributes you could add in there and still have nice compliant code. Best bet is to give them a value, assign a variable that value, unset it and add watermark. Something like:
$('input').each(function() {
var wmark = $(this).val();
$(this).val('');
$(this).watermark(wmark);
});
Try adding UseAccessibleHeader = false
like this:
<asp:TextBox ID="txtTitle" runat="server" class="txtFields" title="Title" UseAccessibleHeader = false />

How to Filter a DropDownList from another DropDownList (SPDataSource + ControlParameter way)

I’m trying to connect two DropDownList (ddlCountry and ddlCity) together. I want that when the user changes the Country, the ddlCity is updated consequently.
To do it, I created two lists:
· Country (ID, Title)
· City (ID, Title, Country) [Country is a lookup field]
Then I created an ASPX page with 2 DropDownList connected to Country and City through 2 SPDataSource (dsCountry and dsCity).
When I load my page, the City DropDownList is populated accordingly to the Country DropDownList, but when I change the Country, nothing happens and ddlCity shows null always
This is my code:
<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="<Query><OrderBy><FieldRef Name='Title' /></OrderBy></Query>" id="dsCountry">
<SelectParameters>
<asp:Parameter Name="ListName" DefaultValue="Country"/>
</SelectParameters>
</SharePoint:SPDataSource>
<p>Country:
<asp:DropDownList runat="server" id="ddlCountry" DataValueField="Title" DataTextField="Title" DataSourceID="dsCountry" AutoPostBack="True" />
</p>
<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="<Query><Where><Eq><FieldRef Name="Country" /><Value Type="Lookup">{country}</Value></Eq></Where></Query>" id="dsCity">
<SelectParameters>
<asp:parameter DefaultValue="City" Name="ListName"></asp:parameter>
<asp:controlparameter name="country" controlid="ddlCountry" propertyname="SelectedValue"/>
</SelectParameters>
</SharePoint:SPDataSource>
<p>City:
<asp:DropDownList runat="server" id="ddlCity" DataValueField="Title" DataTextField="Title" DataSourceID="dsCity" />
</p>
Please note:
· In ddlCountry AutoPostBack = True
· In dsCity, in the CAML query there’s a parameter called “country”, connected to ddlCountry through a ControlParameter
I don’t understand why my filtering doesn’t work when I change the country… I can see the page reloading, but nothing happens… any suggestion?
Shouldn't the variable be:
{$country}
Interested in knowing if you ever found a solution.
I realise this is serious thread necromancy, but in case you're still interested, or anyone else finds this through Google...
Try setting the EnableViewState attribute of the second (filtered) dropdown to false. This will force the control to get a new set of data (with the new filter) from the SPDataSource, instead of getting its previous set from before the post back from the View State.
Have a look at this page for this specific example, and this page for a more general overview of the View State and what it does.

Resources