Ext.NET 2.0 how to get the value of datefield - get

I want to get from datefield. Ext.NET 2.0 is a little bit difficult to study.
This is a source of simple datefield.
<ext:DateField ID="DateField1" runat="server"
Vtype="daterange" FieldLabel="To" EnableKeyEvents="true" />
and I'd like to set the value on my Textbox.
myTextbox.setValue(App.MainContent_DateField1.getValue());
help!!

Just found the answer to this - using getRawValue() function
myTextbox.setValue(App.MainContent_DateField1.getRawValue());

I tested the basic scenario and it appears to work correctly.
You might need to call .format() to convert your DateField value into a nicely formatted string, but that is not required.
Here's a full sample demonstrating the scenario. Select a Date from the DateField, then click the Button. The DateField value will be copied to the TextField.
Example
<%# Page Language="C#" %>
<%# Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:DateField ID="DateField1" runat="server" />
<ext:TextField ID="TextField1" runat="server" />
<ext:Button
runat="server"
Text="Submit"
OnClientClick="TextField1.setValue(DateField1.getValue().format('d-M-Y'));"
/>
</form>
</body>
</html>

Related

Hide text of search box in sharepoint

I want to hide the text of a searchtextbox, but I don't know how to do it. I'm a Sharepoint noob, so I think it is easy to do it but I don't know how... I put my code below, hope it helps:
<SharePoint:AjaxDelta ID="DeltaSiteLogo" runat="server" BlockElement="True">
<!--search-->
<SharePoint:AjaxDelta ID="DeltaPlaceHolderSearchArea" BlockElement="true" CssClass="ms-mpSearchBox ms-floatRight" runat="server">
<asp:ContentPlaceHolder ID="PlaceHolderSearchArea" runat="server">
<div id="searchInputBox">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />
<script type="text/javascript">
setTimeout(function () {
document.getElementById('SmallSearchInputBox').placeholder = 'Ex: SMS1234';
document.getElementById('SmallSearchInputBox').value = 'Ex: SMS1234';
}, 800);//time to wait for in ms
</script>
</div>
</asp:ContentPlaceHolder>
</SharePoint:AjaxDelta>
<SharePoint:SPLinkButton runat="server" CssClass="ms-siteicon-a" ID="x36d5bee949a7480783b3afc048c15598" NavigateUrl="~sitecollection/Pages/Inicio.aspx">
<SharePoint:SiteLogoImage name="onetidHeadbnnr0" runat="server" CssClass="ms-siteicon-img" ID="x74bbee6762f840edad4fe46f496d8c78" LogoImageUrl="/_layouts/15/images/siteIcon.png"></SharePoint:SiteLogoImage>
</SharePoint:SPLinkButton>
I follow this link, but this solution didn't work for me and It doesn't change the text of the textbox:
Can anyone help me? Thanks a lot!
The control ID will change as page inherit, for example:
Try to use jQuery regex selector, for example:
$('div[id*="SmallSearchInputBox"]')

jquery autocomplete in ASP not working

I have googled for this and I am not an expert on it either. I tried the following code thinking I am doing it right to implement a simple autocomplete textbox. But does not work. Here is the code. If anyone would help out what could be wrong with it, that will be a big help. My textbox simply does not return any autocomplete suggestions when I try it.
Thanks.
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="jquery.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<%--<link href="jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" />--%>
<title></title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"
rel="stylesheet" type="text/css"/>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<script type="text/javascript">
$(function () {
$("#TextBox1").autocomplete
({
source: ["Joe", "John", "Jack", "Ben", "Bell", "Steve", "Scott"] // simple list of strings
});
});
</script>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
There is no reference for jquery ui library in ur code
TRY TO ADD THIS :
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>

Ext:net : Property grid bind it to store

is there anyway to bind propertgrid to the store.
I find a sample here ,is this the only way to bind data to propertgrid?I wanna bind data like as bind the gridview thank you
<script runat="server">
protected void Populate(object sender, DirectEventArgs e)
{
PropertyGridParameter p = new PropertyGridParameter();
p.Name = "dynamic";
p.Value = "property";
p.Editor.Add(new ComboBox());
this.PropertyGrid1.SetSource(new PropertyGridParameterCollection() { p }, true);
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Button runat="server" Text="Populate" OnDirectClick="Populate" />
<ext:PropertyGrid ID="PropertyGrid1" runat="server">
<Source>
<ext:PropertyGridParameter Name="initial" Value="property" />
</Source>
</ext:PropertyGrid>
</form>
</body>
</html>
PropertyGrid internally uses its own store and its unavailable to bind data to in a similar way as you can do with a GridPanel.
I think nothing stops you to use a a common GridPanel if you have such a requirement.

Real time vehicle tracking using google map showing vehicle moving on google map

I am working on real time vehicle tracking project.
I am getting vehicle location after every 6 sec and I store lat and long in static variable each time.
I want to show vehicle moving on Google map after change location using ajax.
I have written code as:
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%# taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%# taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%# taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%# taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%# taglib uri="http://code.google.com/p/gmaps4jsf/" prefix="m"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META HTTP-EQUIV=" " CONTENT="6">
<title>Insert title here</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAtRLgopSfFn_inKV4Mb4dwRQrh986W3YN5ROngdOVRv-81htxfBSHsTcVUm4HRkCt9bSp5mP_3_snrw"
type="text/javascript">
</script>
</head>
<body>
<f:view>
<h:form id="aaaa">
<h:panelGrid columns="2">
<m:map id="mp" width="500px" height="500px" latitude=" #{mp3.lat} "
longitude=" #{mp3.lon}" zoom="15">
<m:mapControl name="GMapTypeControl" />
<m:mapControl name="GLargeMapControl"
position="G_ANCHOR_BOTTOM_RIGHT" />
<m:marker id="m" latitude=" #{mp3.lat} " longitude=" #{mp3.lon}">
<m:htmlInformationWindow htmlText="Start<br> " />
<a4j:support event="onchange" action=" " reRender="m"></a4j:support>
</m:marker>
</m:map>
</h:panelGrid>
<h:commandButton value="Start" action="#{mp3.meth}" />
<h:commandButton value="Path Map" action="pathmp" />
</h:form>
</f:view>
</body>
</html>
My question is how to move vehicle marker on google map using ajax a4j without reloading all page?
technology i have used are
- jsf
- richfaces
- a4j
- javaBean
Thanks

JSF include problem menu related

I am trying to implement menus in JSF which I was able to do it.
menucontents.jsp:
<%# taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%# taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%# taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
<title>MyFaces - the free JSF Implementation</title>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/pages/css/basic.css" />
</head>
<body>
<f:view>
<f:loadBundle basename="com.cpc.resources.menu" var="menu"/>
<t:div id="hNav_outer">
<t:panelNavigation2 id="nav1" layout="list" itemClass="off" activeItemClass="on" openItemClass="on"
renderAll="true">
<t:commandNavigation2 value="#{menu['menu_Home']}" style="padding-left: 0px;">
<t:commandNavigation2>
<f:verbatim>› </f:verbatim>
<t:outputText value="#{menu['menu_Home']}"/>
</t:commandNavigation2>
</t:commandNavigation2>
<t:commandNavigation2 value="#{menu['menu_admin']}" style="padding-left: 150px;">
<t:commandNavigation2>
<f:verbatim>› </f:verbatim>
<t:outputText value="#{menu['menu_admin_change_password']}"/>
</t:commandNavigation2>
<t:commandNavigation2>
<f:verbatim>› </f:verbatim>
<t:outputText value="#{menu['menu_admin_forgot_password']}"/>
</t:commandNavigation2>
</t:commandNavigation2>
</t:panelNavigation2>
</t:div>
</f:view>
</body>
</html>
menu.jsp:
<%# taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%# taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%# taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
<title>MyFaces - the free JSF Implementation</title>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/pages/css/basic.css" />
</head>
<body>
<f:view>
<f:subview id="headerinclude1">
<jsp:include page="menucontents.jsp" />
</f:subview>
</f:view>
</body>
</html>
I have tried various combinations i.e by removing the HTML / BODY / f:view tags but nothing seems to be working I know somewhere I am doing it wrong not able to check it. Any help would be appreciated.
Also, the first part of code when executed as an single file it works very well the only problem is when I include it in another JSP the menus are not getting displayed.
The <f:subview> has to go in the include file, not in the parent file. Replace the <f:view> in menucontents.jsp file by <f:subview> and remove the <f:subview> from the menu.jsp.
Summarized:
menu.jsp
<f:view>
<jsp:include page="menucontents.jsp" />
</f:view>
menucontents.jsp
<f:subview id="menucontents">
<f:loadBundle basename="com.cpc.resources.menu" var="menu"/>
...
</f:subview>
(note that the include file should not have a <f:view>, you also don't need a HTML head/body around it, that would only produce invalid HTML)

Resources