struts-community-plugins / struts2-jquery

Struts2 jQuery Plugin
Apache License 2.0
82 stars 49 forks source link

Problem migrating to Struts2 jQuery Plugin 5.0.4-SNAPSHOT #409

Closed hss-ch closed 9 months ago

hss-ch commented 12 months ago

Hi, I find this problem when I try to test Struts2 jQuery Plugin 5.0.4-SNAPSHOT.

The tag sj:select with attribute autocomplete="true" is not working, without using sj:autocompleter tag in the same jsp page. image

lukaszlenart commented 12 months ago

This should be already addressed, see #346 and #347

lukaszlenart commented 12 months ago

Addressed but not released because of #327

hss-ch commented 9 months ago

I just started the showcase locally with the latest Snapshot-Version. The problem is not solved. The tag sj:select with attribute autocomplete="true" is not working, without using sj:autocompleter tag in the same jsp page. image

lukaszlenart commented 9 months ago

Could you post your code changes in Showcase to reproduce the bug?

gregh3269 commented 9 months ago

/struts2-jquery-plugin/src/main/resources/template/js/struts2/jquery.struts2.js

select :

is missing the tooltip

"js/base/tooltip" + self.minSuffix + ".js"

if (o.autocomplete) { if (!self.loadAtOnce) { self.require( [ "js/base/widget" + self.minSuffix + ".js", "js/base/position" + self.minSuffix + ".js", "js/base/menu" + self.minSuffix + ".js", "js/base/button" + self.minSuffix + ".js", "js/base/autocomplete" + self.minSuffix + ".js" , "js/base/tooltip" + self.minSuffix + ".js" ]); } }

hss-ch commented 9 months ago

I used this code to use sj:select tag directly in jsp page. But it is not working.

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

<h2>Autocompleter - Select Box</h2>

<p class="text">
Select Box with JSON Result as autocompleter.
</p>

<strong>Result Div :</strong>
<div id="formResult" class="result ui-widget-content ui-corner-all">Submit form bellow.</div>
<strong>Topics Div :</strong>
<div id="topics" class="result ui-widget-content ui-corner-all"></div>

<s:form id="form2" action="echo" theme="simple" cssClass="yform">
    <fieldset>
        <legend>Select Box with JSON Result as Autocompleter</legend>
        <div class="type-select">
            <label for="echo">Echo: </label>
            <s:url var="jsoncustomers" action="jsoncustomers"/>
            <sj:select
                    id="customersjson"
                    name="echo"
                    href="%{jsoncustomers}"
                    list="customers"
                    listValue="name"
                    listKey="id"
                    autocomplete="true"
                    loadMinimumCount="2"
                    onChangeTopics="autocompleteChange"
                    onFocusTopics="autocompleteFocus"
                    onSelectTopics="autocompleteSelect"
                    />
        </div>
        <div>
            <sj:submit
                    targets="formResult"
                    value="AJAX Submit"
                    indicator="indicator2"
                    button="true"
                    />
            <img id="indicator2" src="images/indicator.gif" alt="Loading..." style="display:none"/>
        </div>
    </fieldset>
</s:form>
gregh3269 commented 9 months ago

I have tested your code and it works now with the fix.

Please can you try again with the latest snapshot.

Also make sure you clear your local storage for your site. In ff I do : edit settings, privacy & security, manage data and then remove by the website url.

hss-ch commented 9 months ago

I just tried the showcase of the latest Snapshot-Version.

The problem is solved.

Thank you.