Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AutoComplete YUI please help

 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i looked through the link below but did not understand, how to start off
----
Link
----
http://developer.yahoo.com/ypatterns/pattern.php?pattern=autocomplete


Please help!!!
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

If you want to Autocomplete Example you find Struts 2.0 tag for Autocomplete .

See example of Struts2.0 Showcase.

Thanks,
Nishan Patel.
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u mean the autocompleter tag right?
i tried that did not work....can you tell me how to do it?
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am giving you simple jsp for this Example .


////////////////////////////////////////////////

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'autocompleter.jsp' starting page</title>
<s:head theme="ajax" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<h1>Struts 2 Autocompleter Example!</h1>
<s:label name="stateName" value="Select State Name:" />
<s:autocompleter theme="ajax" list="state" name="StateName"/>
</body>
</html>

////////////////////////////////////////////

stateName - is a list name contains State name.

<s:head theme="ajax" /> please make sure your jsp contain this tag.



Thanks,
Nishan Patel.
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code snippet i used:
/////////////
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<head>

<base href="<%=basePath%>">

<title><s:text name="section.cataloging" /></title>

<meta name="section" content="cataloging" />
<meta name="theme" content="xhtml" />
<meta name="prototypejs" content="true" />
<meta name="scriptaculousjs" content="true" />
<s:head theme="ajax" />
</head>



<body>
<display:column titleKey="title.language" sortable="true" sortProperty="language">
<s:if test="%{#attr.work_queue.isBilled != 'true'}">
<s:autocompleter id="lng_%{#attr.work_queue.itemId}" list="languages"
onchange="updateLanguage('%{#attr.work_queue.itemId}',this.value);"
cssStyle="width:75px;" name="title.language" theme="ajax"
listKey="code" listValue="description" value="%{#attr.work_queue.language}" />
</s:if>
<s:else>
<h:language code="${work_queue.language}" />
</s:else>
</display:column>

</body>

what mistake have i done here?
Am i missing any configurations?
Please let me know.....
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

First of all in display tag you can not use Struts tag.

So, first remove your display tag and again use this code.


Thanks,
Nishan Patel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic