Selecting a single row in component art grid not working - componentart

I have Question about component art grid.
Have anyone struggled with the selecting of a single row where your attribite is AllowMultipleSelect="false" but you are still able to select Multiple rows.
I just can't seem to get around this because I only want the selected row highlighted with what ever color the selectedRowCssClass color is.
Here is my front end code:
<%# Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<base target="_self" />
<title>iView Trend Data</title>
<link href="Assets/OldCss/gridStyle.css" rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<asp:HiddenField ID="ParamA" runat="server" />
<asp:HiddenField ID="ParamB" runat="server" />
<table style="width:100%; Height:100%;" >
<tr>
<td>
<ComponentArt:CallBack id="CallBack1" CacheContent="false" width="100%" Height="100%" runat="server">
<Content>
<ComponentArt:Grid ID="Grid1"
CssClass="Grid"
runat="server"
RunningMode="Client"
ShowFooter="false"
ImagesBaseUrl="~/Assets/Image/Grid/"
Sort="DateTime"
ScrollBar="Auto"
ScrollTopBottomImagesEnabled="true"
ScrollTopBottomImageHeight="2"
ScrollTopBottomImageWidth="16"
ScrollImagesFolderUrl="~/Assets/Image/Grid/"
ScrollButtonWidth="16"
ScrollButtonHeight="17"
ScrollBarCssClass="ScrollBar"
ScrollGripCssClass="ScrollGrip"
ScrollBarWidth="16"
ScrollPopupClientTemplateId="ScrollPopupTemplate"
Width="760"
Height="618"
AllowTextSelection="false"
AllowHorizontalScrolling="True"
AllowMultipleSelect="false"
PageSize="30"
ShowHeader="true"
ShowSearchBox="true"
SearchOnKeyPress="true"
Visible="true"
AllowVerticalScrolling="False"
GroupingNotificationText="">
<Levels>
<ComponentArt:GridLevel
DataKeyField="DateTime"
ShowTableHeading="False"
ShowSelectorCells="False"
HeadingCellCssClass="HeadingCell"
HeadingCellHoverCssClass="HeadingCellHover"
HeadingCellActiveCssClass="HeadingCellActive"
HeadingTextCssClass="HeadingCellText"
DataCellCssClass="DataCell"
RowCssClass="DataRow"
SelectedRowCssClass="SelectedRow"
SortAscendingImageUrl="asc.gif"
SortDescendingImageUrl="desc.gif"
ColumnReorderIndicatorImageUrl="reorder.gif"
SortedDataCellCssClass="SortedDataCell"
SortImageWidth="14"
SortImageHeight="14"
AllowGrouping="false"
AlternatingRowCssClass="AlternatingRow">
<Columns>
<ComponentArt:GridColumn DataField="DateTime" Width="100" FormatString="yyyy-MM-dd HH:mm" Visible="false"/>
</Columns>
</ComponentArt:GridLevel>
</Levels>
<clienttemplates>
<ComponentArt:ClientTemplate Id="ScrollPopupTemplate">
<table cellspacing="0" cellpadding="2"
border="0" class="ScrollPopup">
<tr>
<td style="width:50px;">
<div style="font-size:10px;font-family:MS Sans Serif; text-overflow:ellipsis; overflow:visible;">
<nobr>## DataItem.GetMember("DateTime").Text ##</nobr>
</div>
</td>
</tr>
</table>
</ComponentArt:ClientTemplate>
</clienttemplates>
</ComponentArt:Grid>
</Content>
<LoadingPanelClientTemplate>
<table width="100%" align="center" style="position:relative;top:250px">
<tr>
<td style="color:#cee820" align="right">Loading..</td>
<td align="left"> <img src="./images/ajax-loader.gif" width="48" height="48" border="0"/></td>
</tr>
</table>
</LoadingPanelClientTemplate>
</ComponentArt:CallBack>
</td>
</tr>
</table>
</form>
</body>
</html>

I had a similar problem, which turned out to be because values of the DataKeyField had spaces in them.

Related

PowerShell WebClient.DownloadFile() stops after a few seconds of download

This program should download two files into a directory, yet when I run the program, the first 20KB download but then it stops.
This is my code :
$javaURL = "https://download.oracle.com/otn-pub/java/jdk/14.0.1+7/664493ef4a6946b186ff29eb326336a2/jdk-14.0.1_windows-x64_bin.exe"
$eclipseURL = "https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2020-03/R/eclipse-inst-win64.exe&mirror_id=1099"
$outpathJava = "C:\myPath\file1.exe"
$outpathEclipse = "C:\myPath\file.exe"
$webClient = New-Object System.Net.WebClient
$webClient.DownloadFile($javaURL, $outpathJava)
$webClient.DownloadFile($eclipseURL, $outpathEclipse)
If you use your browser to navigate to the links you just shared, you will see those links are not the executables.
For Java, if you open as text file file1.exe you will see something like:
<html>
<head>
<title>Unauthorized Request</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link rel="stylesheet" type="text/css" href="/errors/us/assets/hp-styles.css" />
<link rel="stylesheet" type="text/css" href="/errors/us/assets/master-master.css" />
<body style="margin: 0px" bgcolor=#ffffff>
<div id="banner">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" valign="middle" nowrap><img src="/errors/us/assets/oralogo-small.gif" width="154" height="19" hspace="10" vspace="25" border="0" ></td>
<td align="right" valign="top" width="70%" nowrap class="padMid"><div id="bannerMid"> </div></td>
<td width="30%" align="left" valign="bottom" nowrap></td>
</tr>
<tr>
<td align="right" valign="bottom" nowrap class="padMid"></td>
<td width="30%" align="left" valign="bottom" nowrap></td>
</tr>
</table>
</div>
<!-- Header END //-->
<table BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
...
Similar thing for the eclipse link.
I suggest you maybe to use Chocolatey to install soft.
Eclipse
Java
Install Chocolatey: https://chocolatey.org/install
then in as powershell (as admin):
choco install eclipse

How to get rid of warnings such as "attrs cannot be resolved as a member of cc"?

How can I get rid of warnings for tags having "cc.attrs.onCompleteJS", "cc.attrs.updateAjax" and "cc.attrs.imageValue"? Each warning has same explanation as "attrs cannot be resolved as a member of cc". I use JSF 2.x as a framework and Eclipse as an editor.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<composite:interface>
<composite:attribute name="imageValue"></composite:attribute>
<composite:attribute name="updateAjax"></composite:attribute>
<composite:attribute name="onCompleteJS"></composite:attribute>
</composite:interface>
<composite:implementation>
<h:outputStylesheet library="css" name="regionTreeComponent.css"></h:outputStylesheet>
<table style="width: 100%" cellspacing="0" cellpadding="5">
<tr>
<td style="width: 100%">
<p:autoComplete forceSelection="true" id="sTxtRegionName" value="#{regionTreeBean.sRegionName}"
completeMethod="#{regionTreeBean.completeRegionName}" styleClass="sTxtRegionName" />
</td>
<td>
<p:commandButton styleClass="rSearchButton" id="iconOnly" icon="ui-icon-search" actionListener="#{regionTreeBean.searchSelectNode}"
oncomplete="#{cc.attrs.onCompleteJS}" update=":mainForm:treeComponent:regionTree #{cc.attrs.updateAjax}"/>
</td>
</tr>
</table>
<hr style="width: 100%;"></hr>
<div style="text-align: center;">
<h:graphicImage styleClass="headerImage" library="images" name="#{cc.attrs.imageValue}"></h:graphicImage>
<p:outputLabel styleClass="headerLabel" value="#{msgs['treeComponent.regions']}"></p:outputLabel>
</div>
<p:tree value="#{regionTreeBean.rootNode}" var="node"
animate="true" selection="#{regionTreeBean.selectedNode}"
selectionMode="single" styleClass="tree" id="regionTree">
<p:ajax event="select" listener="#{regionTreeBean.onNodeSelect}" update="#{cc.attrs.updateAjax}" oncomplete="#{cc.attrs.onCompleteJS}" />
<p:treeNode styleClass="slTreeNode" icon="region">
<h:outputText value="#{node.REGION_NAME}"/>
</p:treeNode>
</p:tree>
</composite:implementation>
</html>

two tinymce editor issue in firefox

i am using two same tinymce editor in same page. the first editor is editable and the second editor is not editable in firefox.all other browser both editor is editable.Is any solution available for this?
this is my code
> <textarea id="recipeDesc" class="mceEditor required" cols="80"
> rows="24" title=" Enter a Description " helper="formTinyMce"
> name="recipeDesc" style="display: none;"></textarea> <span
> id="recipeDesc_container" class="mceEditor o2k7SimpleSkin"> <table
> class="mceLayout" cellspacing="0" cellpadding="0" style="width: 500px;
> height: 450px;"> <tbody> <tr> <td> <div class="mceIframeContainer">
> <iframe id="recipeDesc_ifr" frameborder="0" src="javascript:"""
> style="width: 100%; height: 430px;"> <html> </iframe> </div> </td>
> </tr> <tr class="last"> </tbody> </table> </span> <br> <label
> for="recipeProcess">Recipe Process : </label> <textarea
> id="recipeProcess" class="mceEditor required" cols="80" rows="24"
> title=" Enter a process " helper="formTinyMce" name="recipeProcess"
> style="display: none;"></textarea> <span id="recipeProcess_container"
> class="mceEditor o2k7SimpleSkin"> <table class="mceLayout"
> cellspacing="0" cellpadding="0" style="width: 500px; height: 450px;">
> <tbody> <tr> <td> <div class="mceIframeContainer"> <iframe
> id="recipeProcess_ifr" frameborder="0" src="javascript:"""
> style="width: 100%; height: 430px;"> <html> <head
> xmlns="http://www.w3.org/1999/xhtml"> <body id="tinymce"
> class="mceContentBody " spellcheck="false" dir="ltr"> <false> </body>
> </html> </iframe> </div> </td> </tr> <tr class="last"> </tbody>
> </table> </span>
I believe this is a bug with Firefox which is resolved if you install the latest nightly build: http://nightly.mozilla.org/. Usual warnings apply when using a nightly - it might not be stable!

overlapping of panels (ascx) in IE7

I have the problem of panel overlapping in IE7 whereas the same code works in IE8.
Has anyone faced this kind of problem?
In the code below, i have a link button, on clicking this, the products frame would be displayed. But this overlaps with the "client products" :
<%# Control Language="C#" AutoEventWireup="true" CodeFile="ClientSummary.ascx.cs" Inherits="ClientSummary" %>
<%# Register Src="~/Controls/ClientSession/CounselorMenuFrame.ascx" TagName="CounselorMenuFrame" TagPrefix="UCC" %>
<%# Register Src="~/Controls/ClientSession/ProductsFrame.ascx" TagName="ProductsFrame" TagPrefix="UCC" %>
<%# Register Src="~/Controls/ClientSession/ProductDetailFrame.ascx" TagName="ProductDetailFrame" TagPrefix="UCC" %>
<%# Register Src="~/Controls/ClientSession/ClientDetailFrame.ascx" TagName="ClientDetailFrame" TagPrefix="UCC" %>
<asp:Panel ID="pnlClntSummary" runat="server" EnableViewState="true" >
<asp:Panel ID="pnlClientDetailFrame" runat="server" Style="width: 950px;" >
<UCC:ClientDetailFrame id="clientDetailFrame" runat="server" />
</asp:Panel>
<asp:Panel ID="pnlProductDetailFrame" runat="server" Style="width: 950px;" >
<UCC:ProductDetailFrame id="productDetailFrame" runat="server"/>
</asp:Panel>
<div id="slider" style="width:950px;">
asp:Panel ID="pnlProductsFrame" runat="server" Style="width: 950px;" >
<table style="width:900px;" >
<tr><td></td><td>
<asp:LinkButton Text="Client Information" ID="clientDetail" Font-Underline="true"
Font-Bold="true" Font-Names="Calibri" Font-Size="Medium" runat="server"
onclick="clientDetail_Click"/>
</td>
</tr>
<tr>
<td valign="top" style="float:left" align="left">
<div style="float:left;vertical-align:top;">
<div id="content" class="contentMenu">
<UCC:ProductsFrame id="productsFrame" runat="server" />
</div>
</div>
</td>
<td valign="top" style="width:900px;" align="left">
<div id="header1" style="float:left;position:relative;width:45px;">
<table border="0">
<tr>
<td valign="top" style="width:30px;"
onclick="verticalprocessClick(document.getElementById('header1'))">
<div style="padding: 2px; cursor: pointer; vertical-align: top;">
<div style="float: left; vertical-align: bottom;">
<table>
<tr onclick="ImageChangePFrame(imgPF)">
<td class="VerticalLine">
</td>
<td>
<img id="imgPF" src="../Images/icon_expand.png" alt="(Show Details...)"
onload="ProductFrameHide(this)"/>
<div id="divClientProducts" runat="server"
style="float:left;font-family:Calibri;top:1%;left:25%;position:relative;font-size:13px;
color:Gray;text-align:center;">
C<br />
L<br />
I<br />
E<br />
N<br />
T<br />
<br />
P<br />
R<br />
O<br />
D<br />
U<br />
C<br />
T<br />
S<br />
</div>
</td>
<td class="VerticalLine">
</td>
</tr>
</table>
</div>
</div>
</td>
<td>
</td>
</tr>
</table>
</div>
<div id="divTransactionDesktop" style="float:left;width:600px; height:100px;" >
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:PlaceHolder ID="MainFrameHolder" runat="server"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
<asp:HiddenField ID="hdnRowValue" runat ="server" Value="0" />
</div>
</td>
</tr>
</table>
</asp:Panel>
</div>
<asp:HiddenField ID="hdnLastFocus" runat="server" />
<asp:HiddenField ID="hdnKeyMapping" runat="server" />
</asp:Panel>
I found a solution for overlapping of panels in IE7. It was the height attribute which made a difference. Removing the height attribute or mentioning the exact value in pixels, solves this problem.

Struts 2 select tag filled by list property

I am new to struts 2. I am facing problem in filling Select tag with list property. The values are supplied from action class.Please provide me sample sode for this scenario.
My action class
public class TripDetailsAdd extends ActionSupport {
#Override
public String execute() throws Exception {
return SUCCESS;
}
public String populate() {
VehicleDAO vehicleDAO = new VehicleDAO();
this.lstVehicles.addAll(vehicleDAO.getAllVehicles());
return "populate";
}
private String vehicleId;
private Collection lstVehicles = new ArrayList<VehiclesVO>();
}
Jsp page content:
<%# taglib prefix="s" uri="/struts-tags"%>
<%# taglib prefix="sform" uri="/struts-dojo-tags"%>
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%#page import="com.vms.business.dao.VehicleDAO"%>
<%#page import="java.util.Collection"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Trip Details</title>
</head>
<body>
<s:form action="tripDetailsAdd" method="POST" >
<s:hidden name="expenseTypeId"></s:hidden>
<table width="100%" height="96%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><!-- Menu Starts --> <jsp:include
page="/pages/menu.jsp"></jsp:include> <!-- Menu End -->
<table width="95%" align="center">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="highlight">Trip Details Add</td>
<td><s:actionerror /><s:actionmessage /></td>
</tr>
<tr>
<td class="header3shadow" colspan="2"><img height="2"
border="0" width="100%"></img></td>
</tr>
</table>
<table>
<tr>
<td> </td>
</tr>
</table>
<div
style="overflow: auto; height: expression((document.body.clientHeight -80) +px ');">
<table width="60%" cellspacing="0" cellpadding="0" border='0'>
<tr>
<td class="FieldTitle" valign="top">
<table width="100%" cellspacing="4" cellpadding="0" border='0'>
<s:select headerKey="0" headerValue="Select One" required="*" label="Vehicle No."
labelSeparator=":" list="lstVehicles" listKey="vehicleId" listValue="regNo"></s:select>
</td>
</tr>
<tr>
<td>
<table width="100%" cellspacing="4" cellpadding="0" border='0'>
<s:textfield labelposition="left" requiredposition="right"
name="totalIncome" label="Total Income" cssStyle="FieldTitle"
labelSeparator=":"></s:textfield>
</table>
</td>
</tr>
</table>
<table cellpadding="0" width="60%" cellspacing="0" border="0">
<tr>
<td align="right"><s:submit label="Add" value="Add"></s:submit></td>
</tr>
</table>
</div>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</s:form>
</body>
</html>
Mapping
<action name="*TripDetailsAdd" method="{1}"
class="com.vms.trip.presentation.TripDetailsAdd">
<result name="success" type="redirect">showTripDetailsList
</result>
<result name="populate">/pages/tripdetails/TripDetailsAdd.jsp
</result>
<result name="error">/pages/tripdetails/TripDetailsAdd.jsp
</result>
<result name="input">/pages/tripdetails/TripDetailsAdd.jsp
</result>
</action>
In this if i add Validation file or If any error occurs in page drop down is not loading.Please help me..
Struts2 select tag
<s:select label="Pets"
name="petIds"
list="petDao.pets"
listKey="id"
listValue="name"
value="%{petDao.pets.{id}}"
/>
In the above. value = default selection, list = collection (of Map) coming from your action class, listKey = Key for map, listValue = value for map.
Edit (after looking at provided code):
your problem is that you do not have any getter in action class that corresponds with lstVehicles (which is mentioned in list property of your select tag)
Add this to your action class:
public List getLstVehicles ()
{
return this.lstVehicles;
}