Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
about linking two autocompleters using topics [never surrender :)]

about linking two autocompleters using topics [never surrender :)]

2007-12-04       - By Jeromy Evans

 Back
Reply:     1     2  

Giovanni Azua wrote:
> hi,
>
> I have been recently asking how to achieve that changing the value of
> autocompleter A, triggers an Ajax reload of autocompleter B and make
> the only item returned as selected on B i.e. displayed in its
> textInputNode.
>
> I followed directions from:
> http://struts.apache.org/2.x/docs/ajax-and-javascript-recipes.html
#AjaxandJavaScriptRecipes-Linktwoautocompleters%252Cusingtopics
>
>
> and the reload works okay but making the only element in the ComboBox
> selected and displayed in autocompleter textInputNode is the remaining
> issue.
>
> Trying to hack some javascript that will do, below is the code to the
> closest I've got.
> I manage that after the reload the autocompleter displays "kaki" big
> deal! but not yet
> to display the only item out of the ComboBox.
>
> Ehh please help :)
>
> regards,
> Giovanni
>
Hi Giovanni,

I don't use dojo's autocompleter myself, but after a quick look at the
javascript source for the widget (ComboBox) I can see there's a public
method setSelectedValue(value) which may help, although it's not clear
to me which component of the ComboBox is updated....The js source is
pretty horrible.

My approach would be to start firebug, load your page and place a
breakpoint in your callback function.  When the callback is fired, use
firebug's DOM inspection to browse for public methods in the widget
instance returned by dojo.widget.byId() and see if there's anything
useful.  Use the watch to call methods directly.

Hope that helps,
Jeromy Evans


> ***************************** mypage.jsp ****************************
>
> <script type="text/javascript">
>  dojo.event.topic.subscribe("/after", function(data, type, request)
>  {
>     //data : text returned from request
>     //request: XMLHttpRequest object
>     //widget: widget that published the topic
>     // alert(widget.optionsListNode.childNodes.length);
>     // alert('happened');
>     if (type == "load")
>     {
>         var widget = dojo.widget.byId("eurosPerListedUnit0");
>         alert(widget.comboBoxValue.size);
>         widget.textInputNode.value = "kaki";
>     }
>     // widget.textInputNode.value = widget.comboBoxValue.value;
>  }); </script>
>
> <s:url var="exchangeRates" action="AjaxGetExchangeRates.action" />
>
> <s:form id="formSimulation" action="%{targetAction}" method="post"
> theme="%{currentTheme}">
>    <sx:autocompleter tooltip="Provide the first Historic Book"
> valueNotifyTopics="/changedHistoricBook0" searchType="substring"
> label="Historic Book 1" cssStyle="width: 250px;" dropdownHeight="180"
> name="historicBook0" list="historicBooks" listKey="id"
> listValue="name" />          ...
>    <sx:autocompleter id="eurosPerListedUnit0" tooltip="Provide the
> Currency Rate 1" formId="formSimulation" href="%{#exchangeRates}"
> listenTopics="/changedHistoricBook0"
>        label="Currency Rate 1" cssStyle="width: 250px;"
> name="eurosPerListedUnit0" autoComplete="false" notifyTopics="/after" />
>    ...
>    <s:submit value="%{buttonLabel}" align="center"/>
> </s:form>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.