I've received a question on if it's possible and how to disable the paging option of certain selector fields and instead enable full scrolling of values.
Ultimately I have already discussed the negative effects of doing so in regards to performance, memory utilization, speed, etc.
In looking into it though, at first I thought it would be a simple item of setting the AllowPaging option to false but this doesn't seem to be all that's needed.
If I in my selector field (inventory lookup in sales order for example) add the following (XML view)
<PXSegmentMask DataField="InventoryID" ParentId="phG_tab_Items#0_grid_Levels#0_edInventoryID" TypeFullName="PX.Web.UI.PXSegmentMask">
<Prop Key="GridProperties.AllowPaging" Value="False" />
</PXSegmentMask>
The resulting view does indeed disable the paging options on the selector however the resulting record count shown is still the same.
Looking at the generated SQL query, i can see it does indeed now select all the records but looking at the overflow property on the div I see that it's set to "hidden" for the vertical scroll bars.
That leads me to believe that the Scroll settings need to be adjusted but the PXSelector does not expose scroll settings in GridProperties.
Short of setting the pagesize to int.Max value, is there something else that I'm missing or is this perhaps a build issue?
Thanks
Related
I have a page with a PXTab control and want to show or hide individual tabs on the page dynamically. How can I control visibility of tabs at runtime?
You can do it in one of the following two ways:
By setting a VisibleExp property on PXTabItem in ASPX page
By
enabling/disabling AllowSelect property of the view that serves as a
DataMember of the grid that is displayed on that tab
Method 1 – VisibleExp
In this method, you directly write the conditions under which the tab should be visible in the screen's ASPX code.
<px:PXTabItem Text="Tax Agency Settings" BindingContext="tab"
VisibleExp="DataControls["chkTaxAgency"].Value = 1">
Note that the binding context is important as it specifies which element's DataControls you want to access in the VisibleExp.
Also DataControls is collection of values for user interface fields, so you need to specify there IDs of controls (not data access class fields).
However, this method is extremely limited in many ways:
The condition checking is restricted to controls available in the UI,
so it is not possible to condition visibility upon the internal state
of the system.
Sometimes this method will require you to include
"fake" data controls into ASPX that will only be checked in
VisibleExp, but won't actually be ever seen by the user.
There seem to be no support for complex conditions including AND/OR.
Ugly " entities instead of normal quotes in the expression – not
particularly readable.
Most importantly, if you need to disable the tab for a particular document type, there is no way around hard - coding a constant into a VisibleExp. You would be explicitly writing something like: VisibleExp="DataControls["edDocumentType"].Value != CHK"
Hard-coding is generally considered a very poor development practice. It poses a significant threat to code maintainability: probably the above code is going to break something in the future. For example if you decide to rename the document codes form CHK to CHQ.
In addition to that, this solution is not easily generalized to situations when you suddenly discover the need to hide the tab not only for checks, but also for other document types. This is due to lack of complex conditional expressions mentioned above.
Method 2 – AllowSelect
Idea of this method is - if you hide all controls from the tab item, than Acumatica will automatically hide tab with no visible controls.
Lets do an example: assume that you need to hide a tab named Applications depending on the document type selected in SO303000 (Invoices):
The tab that we're interested in has a grid control with a data member set to Adjustments:
<px:PXTabItem Text="Applications" RepaintOnDemand="false">
<Template>
<px:PXGrid ID="detgrid" DataSourceID="ds" SkinID="Details">
<Levels>
<px:PXGridLevel DataMember="Adjustments">
............
</px:PXGridLevel>
</Levels>
</px:PXGrid>
</Template>
</px:PXTabItem>
And not that this tab item has only one control - PXGrid.
Also note required property here - RepaintOnDemand="false". This property indicates whether the control refresh tab items content (and select data) after the item becomes visible. Unfortunately, setting it to false incurs certain performance losses. In particular, the Adjustments view' Select will be called much more frequently.
Currently, the Tab is "smart" in the way that it understands that when its child control (PXGridLevel) cannot perform a select on its data member; in this case, the tab hides itself from the UI. This is why you can control the visibility of the tab by setting the AllowSelect property of the cache that corresponds to the Adjustments:
Adjustments.Cache.AllowSelect =
doc.DocType != ARDocType.CashSale
&& doc.DocType != ARDocType.CashReturn;
The above code is written in the ARInvoice_RowSelected handler of the graph, where ARInvoice is the primary DAC and the type of the master records of the page. So, every time ARInvoice is selected, the tab item will become visible or invisible depending on the document type.
This method has its own limitations too:
You should always remember that it is not enough to disable
AllowSelect, you should also enable it when needed. So you need to
evaluate this property every time when event is called.
This method doesn't seem to work without setting the PXTabItem's RepaintOnDemand
property to false (see above).
Source: http://asiablog.acumatica.com/2016/05/hiding-tab-from-user-interface.html
I have an xpage with a categorized view and the first column shows categories that the user may not have access to see the documents underneath them. So they should be hidden from the view on the web. I am sure there is an easy way to do this using something like......
<xp:viewPanel value="#{view1}" var="rowData" id="viewPanel1" rows="50">
if (rowData.IsCategory()) {
if (rowData.(WHATEVER THE PROPERTY IS THAT SHOWS # OF DOCUMENTS FOR THE CATEGORY)) < 1 {
DON'T SHOW ROW
}
}
But I can't find the property for # of documents. Is there one? If not, then would you use a repeat control to handle empty categories? If that's the proper way to handle this, can you point me to some code example that would handle this using the repeat control. It's one of the trickier concepts for me right now. Thanks in advance.
There's a setting on the view itself (not the view panel, the actual view design element) to suppress empty categories. If you enable that setting for the view, any view panel bound to it should respect the setting.
I have an application that makes use of the Application Layout Control. The UI has two tabs defined in the Title Bar section. The UI also contains a Navigator control in the sidebar that allows users to select links to open other pages. What I am having troubles with is keeping the current tab set as the active tab when users click on links in the current navigator.
The "configuration" property of the Application Layout Control is a complex type, which in turn supports all the properties that define the layout itself. One of those properties is "navigationPath". If Netflix used this control on their site, the value of that property when viewing the movie information page for Ghostbusters might look something like:
/home/genres/comedies/541018
So this property can be thought of as a way of describing the page's current location in the "site map" using *nix filepath syntax.
Each titleBarTab is also a complex type; one of its properties is "selection". This property is intended to be given a value that matches part or all of the current navigationPath for the overall layout. So, continuing the Netflix example, you might define your tabs like this:
<xe:this.titleBarTabs>
<xe:pageTreeNode
page="/genre.xsp"
label="Action"
queryString="genre=action"
selection="/home/genres/action/*" />
<xe:pageTreeNode
page="/genre.xsp"
label="Comedy"
queryString="genre=comedies"
selection="/home/genres/comedies/*" />
<xe:pageTreeNode
page="/genre.xsp"
label="Drama"
queryString="genre=dramas"
selection="/home/genres/dramas/*" />
</xe:this.titleBarTabs>
On the page for Ghostbusters, then, because navigationPath property for the layout matches the pattern defined for the selection property of the pageTreeNode with a label of "Comedy", that tab will appear selected, but the others will not.
Also perhaps worthy of note is that the layout configuration also includes a property called "defaultNavigationPath". The value of this property will be compared against the selection property of each titleBarTab if the navigationPath property has no value. So you typically want to set this to a path that would cause the first tab to appear selected.
Bruce, if I am reading this right, I ran into a similar problem a while back. Does this help at all? Setting a sessionScope variable for a TitleBar tab
I have a kentico CMSListMenu which contains 4 levels at it deepest, i want to display the menu as a nested list down the left hand side of my content, this works fine for 3 levels but i cant get the 4th level to display.
I have this working on another site using the exact same code so i must be missing something, these are the menu expressions i have tried using:
<cc1:CMSListMenu ID="CMSTreeMenu1" runat="server" Path="/{0}/{1}/{2}/%" DisplayHighlightedItemAsLink="True" DisplayOnlySelectedPath="true" Indentation="0" MaxRelativeLevel="5" /></cc1:cmslistmenu>
<cc1:CMSListMenu ID="CMSTreeMenu1" runat="server" Path="/Products---Solutions/%" DisplayHighlightedItemAsLink="True" DisplayOnlySelectedPath="true" Indentation="0" MaxRelativeLevel="5" /></cc1:cmslistmenu>
do i need to set this somewhere else? perhaps somewhere inside of kentico to output so many levels down?
Any help would be greatly appreciated, this has been causing me problems for days
I believe that the CMS List Menu only displays cms.Page (Menu Item) documents by default. If you're trying to display other types of documents, make sure you set that in the menu properties.
Try setting DisplayOnlySelectedPath="false" to see if it displays everything as you expect it to under the menu.
I've got an issue where the tertiary level navigation randomly disappears on a publishing SharePoint 2010 site. I can reproduce the disappearance by recycling the app pool or flushing the object cache. It seems like it is a caching issue as the navigation providers do use caching for performance. Once the menu disappears, I can get it back by simply going to the navigation settings for the SPWeb and changing the order of the nodes. This seems to invalidate the cache and the menu appears again.
Below is a snippet of the portalsitemapdatasource and aspmenu elements.
<publishingnavigation:portalsitemapdatasource id="mapThirdLevelNavigation" runat="server"
sitemapprovider="CurrentNavigation" enableviewstate="false" startfromcurrentnode="true"
startingnodeoffset="1" showstartingnode="false" TreatStartingNodeAsCurrent="False" />
<sharepoint:aspmenu id="mnuBottomNavigation" runat="server" datasourceid="mapTopNavigation"
enableviewstate="false" accesskey="<%$Resources:wss,navigation_accesskey%>"
orientation="Horizontal" maximumdynamicdisplaylevels="0" dynamichorizontaloffset="0"
staticpopoutimagetextformatstring="" skiplinktext="" staticsubmenuindent="0"
cssclass="bottom-topNavContainer" />
Google hasn't been very helpful so any assistance provided is very much appreciated.
Edit: Just noticed that I didn't need to change the order of the nodes for the menu items to reappear, just loading the _layouts/AreaNavigationSettings.aspx page for the SPWeb object does the trick. It's looking even more like a cache issue.
Try increasing the value of DynamicChildLimit in web.config.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.navigation.portalsitemapprovider.dynamicchildlimit.aspx
This will be mentioned in a line where Navigation Provider is declared such as
add name="CurrentNavSiteMapProvider" description="CMS provider for Current navigation"
type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider"
NavigationType="Current" EncodeOutput="true" />
DynamicChildLimit, which is an integer property that specifies the maximum "dynamic" children for each Web site (dynamic children include subsites and pages). This value defaults to 50 so if the number of subsites and pages for a particular Web site is greater than 50 objects will be left out unless you adjust this setting. This limit can be increased but keep in mind the usability of a navigation hierarchy that has so many children at each pivot.
I resolved a similar problem: in PortalSiteMapDataSource control I changed the SiteMapProvider attribute from CurrentNavigation to CurrentNavSiteMapProvider.