You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dariusz Wojtas <dw...@gmail.com> on 2006/12/15 23:40:25 UTC

[S2] autocompleter, predefining initial value

Hi,

I am using Struts 2.0.2, trunk.

I have an action (/listy/kodyPocztowe) that returns postal codes [id, name]
and another action that server a form (form points to the same action back).

How to define the initial value in the autocompleter field?
Even if I submit the form and it reloads with the same action, the
autocompleter does not display previously selected option.

I tried to use a javascript  (shown below) to debug it (print field names).
When an alert shows, in place of autocompleter I can see plain
textfield with resubmitted values (as expected), after alert messages
do finish it is replaced by the autocompleter widget - empty value,
nothing selected. the widget is loaded with options, but none is
selected.

Any hint how to solve this mistery?
What am I missing?


<script type="text/javascript">
  function filterKodPocztowy(field) {
    alert(field.name);
	return field.name == "kodPocztowy";
  }
</script>

<s:form id="calcForm" ...>
   [...]
   <s:url id="kodPocztowyURL" value="/listy/kodyPocztowe.action" />
   <s:autocompleter name="kodPocztowy"
	theme="ajax"
	href="%{kodPocztowyURL}"
	forceValidOption="true"
	formId="calcForm"
	formFilter="filterKodPocztowy"
	/>
   [...]

   <s:submit .../>
</s:form


Dariusz Wojtas

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
The initial value can be set with "value" if you are setting the options 
with "list". If the values are loaded dynamically, then the initial 
value cannot be set, this is something that could be done, but I wasn't 
sure that it was a good idea, cause maybe the value was not one of the 
possible options loaded later. The problem with the values not being 
reloaded, definitely a bug. I logged all this on this ticket:

https://issues.apache.org/struts/browse/WW-1562

please add there anything else that you find

regards
musachy

Dariusz Wojtas wrote:
> Hi,
>
> I am using Struts 2.0.2, trunk.
>
> I have an action (/listy/kodyPocztowe) that returns postal codes [id, 
> name]
> and another action that server a form (form points to the same action 
> back).
>
> How to define the initial value in the autocompleter field?
> Even if I submit the form and it reloads with the same action, the
> autocompleter does not display previously selected option.
>
> I tried to use a javascript  (shown below) to debug it (print field 
> names).
> When an alert shows, in place of autocompleter I can see plain
> textfield with resubmitted values (as expected), after alert messages
> do finish it is replaced by the autocompleter widget - empty value,
> nothing selected. the widget is loaded with options, but none is
> selected.
>
> Any hint how to solve this mistery?
> What am I missing?
>
>
> <script type="text/javascript">
>  function filterKodPocztowy(field) {
>    alert(field.name);
>     return field.name == "kodPocztowy";
>  }
> </script>
>
> <s:form id="calcForm" ...>
>   [...]
>   <s:url id="kodPocztowyURL" value="/listy/kodyPocztowe.action" />
>   <s:autocompleter name="kodPocztowy"
>     theme="ajax"
>     href="%{kodPocztowyURL}"
>     forceValidOption="true"
>     formId="calcForm"
>     formFilter="filterKodPocztowy"
>     />
>   [...]
>
>   <s:submit .../>
> </s:form
>
>
> Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
I forgot to mention the postfix was "_selected" before, from the Dojo 
widget, I changed it to "Key" to make it less cryptic, and it won't 
change anymore.

musachy

Musachy Barroso wrote:
> Hi Dariusz
>
> I need to update the documentation with this info, the thing is that 
> for each autocompleter, struts will create 2 fields, one for the text 
> entered, with the name "${name}" and another for the key, with the 
> name "${name}Key", we need both to "remember" the values if there is a 
> validation error or you return INPUT from your page, so if you have:
>
> ["ACURA","351"]
>
> and
>
> <s:autocompleter name="car"....>
>
> when you click submit, it will submit:
>
>  car=ACURA&carKey=351
>
> you need to add the property "car" and "carKey" in your action. About 
> the opera problem, I haven't test it on opera, but I will check it out.
>
> regards
> musachy
>
> Dariusz Wojtas wrote:
>> Hello,
>>
>> I am very happy with the changes being made.
>> They really seem to help - on Firefox 2 :)
>> I can see much better propagation of events in cascaded
>> autocompleters, predefining seems to work on the simple test case that
>> I made.
>>
>> But there are still problems, some of them seem to be very new.
>> I have made a fresh build today (trunk of S2, revision 490697) and the
>> problems that I can now see [on Windows XP SP2] are:
>>
>> a) problems on MsExplorer (latest 6.xx) - problems with propagating 
>> events
>>    even if I try to type characters in the 1st autocompleter in the
>> chain I get javascript error.
>>    I cannot say much about the error [poor console in ie] but it
>> makes it unusable.
>>    If I try to click on the dropdown first - usually it opens as it 
>> should.
>>    But events are still not propagated.
>>
>> b) problems on Opera  (9.0.2) - propagating events does not seem to 
>> work.
>>
>> There is also one big problem that is browser independent.
>> I have a property in my action:
>>   private Integer carMakerId;
>> with getter and setter.
>> And I have autocompleter attached to it that.
>> The list it is loaded with is like this (part of real output) - 
>> [name, id]:
>>
>>   [ ["ACURA","351"], ["ALFA ROMEO","353"], ["AUDI","354"],....]
>>
>> After I select AUDI and submit the form I get URL like this
>>  /myApp/myAction.action?carMakerId=AUDI&carMakerIdKey=354
>> And that creates a long stacktrace because the carMakerId property is
>> of type Integer, which makes the action fail completely - stacktrace.
>> I created a separate JIRA ticket for the exception problem:  WW-1577
>> [improve property handling].
>>
>> But the question here is - How should I handle such properties in my 
>> actions?
>> Create property
>>  private Integer carMakerIdKey;
>> instead? Will it be understood when preloading the value?
>> What if the property postfix changes? [I think it did recently].
>> Any hints on that?
>>
>> Thanks a lot,
>> I am really trying not to complain, I really see improvements but
>> there is still a lot to be done ;(
>>
>> Best regards
>> Dariusz Wojtas
>>
>>
>> On 12/27/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>>> I attached a patch to WW-1562 to fix some of the things you requested.
>>>
>>> regards
>>> musachy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] XSLT result params

Posted by "David H. DeWolf" <dd...@apache.org>.
I noticed the same thing:

https://issues.apache.org/struts/browse/WW-1550

For the short term, I've added a work around that works for my use case 
which allows you select only a single property from the action which 
will be exposed.


David


Ian Roughley wrote:
> I just noticed that the parameters for the XSLT result type in the 
> javadocs are not those in the showcase example, or there may be some 
> that are missing.  Has anyone worked on these lately?
> 
> /Ian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[S2] XSLT result params

Posted by Ian Roughley <ia...@fdar.com>.
I just noticed that the parameters for the XSLT result type in the 
javadocs are not those in the showcase example, or there may be some 
that are missing.  Has anyone worked on these lately?

/Ian

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
That was quick! The change is on head already.

musachy

Musachy Barroso wrote:
> Sorry for the false news :). The issue was closed but it seems like it 
> hasn't been committed yet. 
> https://issues.apache.org/struts/browse/WW-1583
>
> regards
> musachy
>
> Dariusz Wojtas wrote:
>> Hi Musachy,
>>
>> I have just built new S2 (after tag 2.0.2), made sure that the old JAR
>> files are replaced and restarted it. If something is fixed - great,
>> but it still misbehaves under IE and Opera.
>> There is also some issue common to all browsers (including FF):
>>
>> *) If I have 3 stacked autocompleters, every autocompleter has a value
>> and I submit the form to go to the same action (reload with selected
>> values), then only the top autocompleter is displayed with the correct
>> value. The other 2 autocompleters are empty - but the code in
>> generated HTML suggests that the correct values were passed to dojo:
>>   <input dojoType="struts:ComboBox" ... initialValue="A4" 
>> initialKey="3541" ...
>>
>> The dependent autocompleters are just blank.
>> And the funny thing is that the browser asks the server for valus to
>> be shown in autocompleter2 and autocompleter3 and gets the correct
>> values - on page load. Even more funny is that it shows autocompleter1
>> with the predefined value, and I may expand both autocompleter2 and
>> autocompleter3 (nothing selected in autocompleter2).
>>
>>
>> *) Problem under Opera 9.0.2.
>> I know a little more about problems under Opera.
>> It is enough to have single autocompleter to reproduce it.
>> Some value is selected, the dropdown is hidden.
>> I click the downArrow with mouse, the dropdown with options nicely
>> opens and I may change selection. If I mark with mouse/keyboard at
>> least 1 character in the selected value (as if you were preparing for
>> copy/paste) then clicking the downArrow has no effect. If I deselect
>> the character - it works again.
>> The problem is that after making a selection with mouse - the value is
>> automatically marked/selected and the downArrow will not work.
>> Possibly the solution would be to make sure that no character is
>> marked after choosing an option. Or changing the condition under which
>> the dropdown checks what options to display.
>>
>> Similar problem under Opera when typing something in the autocompleter.
>> If the dropdown is already shown/opened - it will work.
>> But if you start typing when it is hidden, it will not work because
>> some characters are automatically marked/selected. Pressing backspace
>> makes it work.
>> It is all reproductible with the sample I have sent you.
>>
>> *) IE 6
>> Still problems on my machine. Even with simple autocompletes.
>> I can see an error in the status bar. No details. Just:
>>  Line:  4872   [It must be sth in the javascript, the HTML code is
>> much shorter]
>>  Char:  1
>>  Error:  [object error]
>>  Code: 0
>>
>>
>> Thanks for your help.
>> And a Happy New Year!
>>
>> Dariusz Wojtas
>>
>>
>>
>> On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>>> Both problems should now be fixed on IE 6.
>>>
>>> regards
>>> musachy
>>>
>>> Musachy Barroso wrote:
>>> > I will fix it so it ignores that null value. UTF-8 works.
>>> >
>>> > regards
>>> > musachy
>>> >
>>> > Dariusz Wojtas wrote:
>>> >> I am not really sure if it worked before, both autcompleter and my
>>> >> code do evolve ;)
>>> >> I was always using JSP with UTF-8 encoding to generate my options.
>>> >> Is UTF-8 a problem here?
>>> >>
>>> >> You mean
>>> >>    [ ["A", "B"] , ]
>>> >> is problematical for IE, but
>>> >>    [ ["A", "B"] ]
>>> >> will work? Should I change something in the json list generation or
>>> >> the autocompleter will recognize such case?
>>> >>
>>> >> Dariusz Wojtas
>>> >>
>>> >> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>>> >>> This is what I found so far, there are 2 problems, one is that when
>>> >>> there is a json array like:
>>> >>>
>>> >>> [ ["A", "B"] , ]
>>> >>>
>>> >>> IE puts a null object in the array. That one is easy to fix. The 
>>> other
>>> >>> problem is that using freemaker, like in showcase to render the 
>>> json
>>> >>> array, the charset of the response is set to Cp1252, which 
>>> causes the
>>> >>> error on IE. If I use a jsp to render the json array, the 
>>> encoding is
>>> >>> ISO-8859-1 which works fine. Was this working for you before?
>>> >>>
>>> >>> regards
>>> >>> musachy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
Sorry for the false news :). The issue was closed but it seems like it 
hasn't been committed yet. https://issues.apache.org/struts/browse/WW-1583

regards
musachy

Dariusz Wojtas wrote:
> Hi Musachy,
>
> I have just built new S2 (after tag 2.0.2), made sure that the old JAR
> files are replaced and restarted it. If something is fixed - great,
> but it still misbehaves under IE and Opera.
> There is also some issue common to all browsers (including FF):
>
> *) If I have 3 stacked autocompleters, every autocompleter has a value
> and I submit the form to go to the same action (reload with selected
> values), then only the top autocompleter is displayed with the correct
> value. The other 2 autocompleters are empty - but the code in
> generated HTML suggests that the correct values were passed to dojo:
>   <input dojoType="struts:ComboBox" ... initialValue="A4" 
> initialKey="3541" ...
>
> The dependent autocompleters are just blank.
> And the funny thing is that the browser asks the server for valus to
> be shown in autocompleter2 and autocompleter3 and gets the correct
> values - on page load. Even more funny is that it shows autocompleter1
> with the predefined value, and I may expand both autocompleter2 and
> autocompleter3 (nothing selected in autocompleter2).
>
>
> *) Problem under Opera 9.0.2.
> I know a little more about problems under Opera.
> It is enough to have single autocompleter to reproduce it.
> Some value is selected, the dropdown is hidden.
> I click the downArrow with mouse, the dropdown with options nicely
> opens and I may change selection. If I mark with mouse/keyboard at
> least 1 character in the selected value (as if you were preparing for
> copy/paste) then clicking the downArrow has no effect. If I deselect
> the character - it works again.
> The problem is that after making a selection with mouse - the value is
> automatically marked/selected and the downArrow will not work.
> Possibly the solution would be to make sure that no character is
> marked after choosing an option. Or changing the condition under which
> the dropdown checks what options to display.
>
> Similar problem under Opera when typing something in the autocompleter.
> If the dropdown is already shown/opened - it will work.
> But if you start typing when it is hidden, it will not work because
> some characters are automatically marked/selected. Pressing backspace
> makes it work.
> It is all reproductible with the sample I have sent you.
>
> *) IE 6
> Still problems on my machine. Even with simple autocompletes.
> I can see an error in the status bar. No details. Just:
>  Line:  4872   [It must be sth in the javascript, the HTML code is
> much shorter]
>  Char:  1
>  Error:  [object error]
>  Code: 0
>
>
> Thanks for your help.
> And a Happy New Year!
>
> Dariusz Wojtas
>
>
>
> On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Both problems should now be fixed on IE 6.
>>
>> regards
>> musachy
>>
>> Musachy Barroso wrote:
>> > I will fix it so it ignores that null value. UTF-8 works.
>> >
>> > regards
>> > musachy
>> >
>> > Dariusz Wojtas wrote:
>> >> I am not really sure if it worked before, both autcompleter and my
>> >> code do evolve ;)
>> >> I was always using JSP with UTF-8 encoding to generate my options.
>> >> Is UTF-8 a problem here?
>> >>
>> >> You mean
>> >>    [ ["A", "B"] , ]
>> >> is problematical for IE, but
>> >>    [ ["A", "B"] ]
>> >> will work? Should I change something in the json list generation or
>> >> the autocompleter will recognize such case?
>> >>
>> >> Dariusz Wojtas
>> >>
>> >> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> >>> This is what I found so far, there are 2 problems, one is that when
>> >>> there is a json array like:
>> >>>
>> >>> [ ["A", "B"] , ]
>> >>>
>> >>> IE puts a null object in the array. That one is easy to fix. The 
>> other
>> >>> problem is that using freemaker, like in showcase to render the json
>> >>> array, the charset of the response is set to Cp1252, which causes 
>> the
>> >>> error on IE. If I use a jsp to render the json array, the 
>> encoding is
>> >>> ISO-8859-1 which works fine. Was this working for you before?
>> >>>
>> >>> regards
>> >>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
I logged WW-1589 (https://issues.apache.org/struts/browse/WW-1589) with 
a patch for the resubmit problem.

regards
musachy

Dariusz Wojtas wrote:
> Hey!
> Your fix works as you said.
> Under both IE and Opera.
>
> There are still the issues described in my previous mail (resubmit of
> stacked autocompleters on all browsers, dropdown problem on Opera),
> but the things that you just fixed - do work as expected.
> I just had to refresh/clear cache in IE and it started to work.
>
> Best regards
> Dariusz Wojtas
>
>
> On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> With the "Object error" and the encoding problem out of the way I will
>> start looking at other problems next year :)
>>
>> regards
>> musachy
>>
>> Dariusz Wojtas wrote:
>> > Hi Musachy,
>> >
>> > I have just built new S2 (after tag 2.0.2), made sure that the old JAR
>> > files are replaced and restarted it. If something is fixed - great,
>> > but it still misbehaves under IE and Opera.
>> > There is also some issue common to all browsers (including FF):
>> >
>> > *) If I have 3 stacked autocompleters, every autocompleter has a value
>> > and I submit the form to go to the same action (reload with selected
>> > values), then only the top autocompleter is displayed with the correct
>> > value. The other 2 autocompleters are empty - but the code in
>> > generated HTML suggests that the correct values were passed to dojo:
>> >   <input dojoType="struts:ComboBox" ... initialValue="A4"
>> > initialKey="3541" ...
>> >
>> > The dependent autocompleters are just blank.
>> > And the funny thing is that the browser asks the server for valus to
>> > be shown in autocompleter2 and autocompleter3 and gets the correct
>> > values - on page load. Even more funny is that it shows autocompleter1
>> > with the predefined value, and I may expand both autocompleter2 and
>> > autocompleter3 (nothing selected in autocompleter2).
>> >
>> >
>> > *) Problem under Opera 9.0.2.
>> > I know a little more about problems under Opera.
>> > It is enough to have single autocompleter to reproduce it.
>> > Some value is selected, the dropdown is hidden.
>> > I click the downArrow with mouse, the dropdown with options nicely
>> > opens and I may change selection. If I mark with mouse/keyboard at
>> > least 1 character in the selected value (as if you were preparing for
>> > copy/paste) then clicking the downArrow has no effect. If I deselect
>> > the character - it works again.
>> > The problem is that after making a selection with mouse - the value is
>> > automatically marked/selected and the downArrow will not work.
>> > Possibly the solution would be to make sure that no character is
>> > marked after choosing an option. Or changing the condition under which
>> > the dropdown checks what options to display.
>> >
>> > Similar problem under Opera when typing something in the 
>> autocompleter.
>> > If the dropdown is already shown/opened - it will work.
>> > But if you start typing when it is hidden, it will not work because
>> > some characters are automatically marked/selected. Pressing backspace
>> > makes it work.
>> > It is all reproductible with the sample I have sent you.
>> >
>> > *) IE 6
>> > Still problems on my machine. Even with simple autocompletes.
>> > I can see an error in the status bar. No details. Just:
>> >  Line:  4872   [It must be sth in the javascript, the HTML code is
>> > much shorter]
>> >  Char:  1
>> >  Error:  [object error]
>> >  Code: 0
>> >
>> >
>> > Thanks for your help.
>> > And a Happy New Year!
>> >
>> > Dariusz Wojtas
>> >
>> >
>> >
>> > On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> >> Both problems should now be fixed on IE 6.
>> >>
>> >> regards
>> >> musachy
>> >>
>> >> Musachy Barroso wrote:
>> >> > I will fix it so it ignores that null value. UTF-8 works.
>> >> >
>> >> > regards
>> >> > musachy
>> >> >
>> >> > Dariusz Wojtas wrote:
>> >> >> I am not really sure if it worked before, both autcompleter and my
>> >> >> code do evolve ;)
>> >> >> I was always using JSP with UTF-8 encoding to generate my options.
>> >> >> Is UTF-8 a problem here?
>> >> >>
>> >> >> You mean
>> >> >>    [ ["A", "B"] , ]
>> >> >> is problematical for IE, but
>> >> >>    [ ["A", "B"] ]
>> >> >> will work? Should I change something in the json list 
>> generation or
>> >> >> the autocompleter will recognize such case?
>> >> >>
>> >> >> Dariusz Wojtas
>> >> >>
>> >> >> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> >> >>> This is what I found so far, there are 2 problems, one is that 
>> when
>> >> >>> there is a json array like:
>> >> >>>
>> >> >>> [ ["A", "B"] , ]
>> >> >>>
>> >> >>> IE puts a null object in the array. That one is easy to fix. The
>> >> other
>> >> >>> problem is that using freemaker, like in showcase to render 
>> the json
>> >> >>> array, the charset of the response is set to Cp1252, which causes
>> >> the
>> >> >>> error on IE. If I use a jsp to render the json array, the
>> >> encoding is
>> >> >>> ISO-8859-1 which works fine. Was this working for you before?
>> >> >>>
>> >> >>> regards
>> >> >>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hey!
Your fix works as you said.
Under both IE and Opera.

There are still the issues described in my previous mail (resubmit of
stacked autocompleters on all browsers, dropdown problem on Opera),
but the things that you just fixed - do work as expected.
I just had to refresh/clear cache in IE and it started to work.

Best regards
 Dariusz Wojtas


On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> With the "Object error" and the encoding problem out of the way I will
> start looking at other problems next year :)
>
> regards
> musachy
>
> Dariusz Wojtas wrote:
> > Hi Musachy,
> >
> > I have just built new S2 (after tag 2.0.2), made sure that the old JAR
> > files are replaced and restarted it. If something is fixed - great,
> > but it still misbehaves under IE and Opera.
> > There is also some issue common to all browsers (including FF):
> >
> > *) If I have 3 stacked autocompleters, every autocompleter has a value
> > and I submit the form to go to the same action (reload with selected
> > values), then only the top autocompleter is displayed with the correct
> > value. The other 2 autocompleters are empty - but the code in
> > generated HTML suggests that the correct values were passed to dojo:
> >   <input dojoType="struts:ComboBox" ... initialValue="A4"
> > initialKey="3541" ...
> >
> > The dependent autocompleters are just blank.
> > And the funny thing is that the browser asks the server for valus to
> > be shown in autocompleter2 and autocompleter3 and gets the correct
> > values - on page load. Even more funny is that it shows autocompleter1
> > with the predefined value, and I may expand both autocompleter2 and
> > autocompleter3 (nothing selected in autocompleter2).
> >
> >
> > *) Problem under Opera 9.0.2.
> > I know a little more about problems under Opera.
> > It is enough to have single autocompleter to reproduce it.
> > Some value is selected, the dropdown is hidden.
> > I click the downArrow with mouse, the dropdown with options nicely
> > opens and I may change selection. If I mark with mouse/keyboard at
> > least 1 character in the selected value (as if you were preparing for
> > copy/paste) then clicking the downArrow has no effect. If I deselect
> > the character - it works again.
> > The problem is that after making a selection with mouse - the value is
> > automatically marked/selected and the downArrow will not work.
> > Possibly the solution would be to make sure that no character is
> > marked after choosing an option. Or changing the condition under which
> > the dropdown checks what options to display.
> >
> > Similar problem under Opera when typing something in the autocompleter.
> > If the dropdown is already shown/opened - it will work.
> > But if you start typing when it is hidden, it will not work because
> > some characters are automatically marked/selected. Pressing backspace
> > makes it work.
> > It is all reproductible with the sample I have sent you.
> >
> > *) IE 6
> > Still problems on my machine. Even with simple autocompletes.
> > I can see an error in the status bar. No details. Just:
> >  Line:  4872   [It must be sth in the javascript, the HTML code is
> > much shorter]
> >  Char:  1
> >  Error:  [object error]
> >  Code: 0
> >
> >
> > Thanks for your help.
> > And a Happy New Year!
> >
> > Dariusz Wojtas
> >
> >
> >
> > On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> >> Both problems should now be fixed on IE 6.
> >>
> >> regards
> >> musachy
> >>
> >> Musachy Barroso wrote:
> >> > I will fix it so it ignores that null value. UTF-8 works.
> >> >
> >> > regards
> >> > musachy
> >> >
> >> > Dariusz Wojtas wrote:
> >> >> I am not really sure if it worked before, both autcompleter and my
> >> >> code do evolve ;)
> >> >> I was always using JSP with UTF-8 encoding to generate my options.
> >> >> Is UTF-8 a problem here?
> >> >>
> >> >> You mean
> >> >>    [ ["A", "B"] , ]
> >> >> is problematical for IE, but
> >> >>    [ ["A", "B"] ]
> >> >> will work? Should I change something in the json list generation or
> >> >> the autocompleter will recognize such case?
> >> >>
> >> >> Dariusz Wojtas
> >> >>
> >> >> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> >> >>> This is what I found so far, there are 2 problems, one is that when
> >> >>> there is a json array like:
> >> >>>
> >> >>> [ ["A", "B"] , ]
> >> >>>
> >> >>> IE puts a null object in the array. That one is easy to fix. The
> >> other
> >> >>> problem is that using freemaker, like in showcase to render the json
> >> >>> array, the charset of the response is set to Cp1252, which causes
> >> the
> >> >>> error on IE. If I use a jsp to render the json array, the
> >> encoding is
> >> >>> ISO-8859-1 which works fine. Was this working for you before?
> >> >>>
> >> >>> regards
> >> >>> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
With the "Object error" and the encoding problem out of the way I will 
start looking at other problems next year :)

regards
musachy

Dariusz Wojtas wrote:
> Hi Musachy,
>
> I have just built new S2 (after tag 2.0.2), made sure that the old JAR
> files are replaced and restarted it. If something is fixed - great,
> but it still misbehaves under IE and Opera.
> There is also some issue common to all browsers (including FF):
>
> *) If I have 3 stacked autocompleters, every autocompleter has a value
> and I submit the form to go to the same action (reload with selected
> values), then only the top autocompleter is displayed with the correct
> value. The other 2 autocompleters are empty - but the code in
> generated HTML suggests that the correct values were passed to dojo:
>   <input dojoType="struts:ComboBox" ... initialValue="A4" 
> initialKey="3541" ...
>
> The dependent autocompleters are just blank.
> And the funny thing is that the browser asks the server for valus to
> be shown in autocompleter2 and autocompleter3 and gets the correct
> values - on page load. Even more funny is that it shows autocompleter1
> with the predefined value, and I may expand both autocompleter2 and
> autocompleter3 (nothing selected in autocompleter2).
>
>
> *) Problem under Opera 9.0.2.
> I know a little more about problems under Opera.
> It is enough to have single autocompleter to reproduce it.
> Some value is selected, the dropdown is hidden.
> I click the downArrow with mouse, the dropdown with options nicely
> opens and I may change selection. If I mark with mouse/keyboard at
> least 1 character in the selected value (as if you were preparing for
> copy/paste) then clicking the downArrow has no effect. If I deselect
> the character - it works again.
> The problem is that after making a selection with mouse - the value is
> automatically marked/selected and the downArrow will not work.
> Possibly the solution would be to make sure that no character is
> marked after choosing an option. Or changing the condition under which
> the dropdown checks what options to display.
>
> Similar problem under Opera when typing something in the autocompleter.
> If the dropdown is already shown/opened - it will work.
> But if you start typing when it is hidden, it will not work because
> some characters are automatically marked/selected. Pressing backspace
> makes it work.
> It is all reproductible with the sample I have sent you.
>
> *) IE 6
> Still problems on my machine. Even with simple autocompletes.
> I can see an error in the status bar. No details. Just:
>  Line:  4872   [It must be sth in the javascript, the HTML code is
> much shorter]
>  Char:  1
>  Error:  [object error]
>  Code: 0
>
>
> Thanks for your help.
> And a Happy New Year!
>
> Dariusz Wojtas
>
>
>
> On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Both problems should now be fixed on IE 6.
>>
>> regards
>> musachy
>>
>> Musachy Barroso wrote:
>> > I will fix it so it ignores that null value. UTF-8 works.
>> >
>> > regards
>> > musachy
>> >
>> > Dariusz Wojtas wrote:
>> >> I am not really sure if it worked before, both autcompleter and my
>> >> code do evolve ;)
>> >> I was always using JSP with UTF-8 encoding to generate my options.
>> >> Is UTF-8 a problem here?
>> >>
>> >> You mean
>> >>    [ ["A", "B"] , ]
>> >> is problematical for IE, but
>> >>    [ ["A", "B"] ]
>> >> will work? Should I change something in the json list generation or
>> >> the autocompleter will recognize such case?
>> >>
>> >> Dariusz Wojtas
>> >>
>> >> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> >>> This is what I found so far, there are 2 problems, one is that when
>> >>> there is a json array like:
>> >>>
>> >>> [ ["A", "B"] , ]
>> >>>
>> >>> IE puts a null object in the array. That one is easy to fix. The 
>> other
>> >>> problem is that using freemaker, like in showcase to render the json
>> >>> array, the charset of the response is set to Cp1252, which causes 
>> the
>> >>> error on IE. If I use a jsp to render the json array, the 
>> encoding is
>> >>> ISO-8859-1 which works fine. Was this working for you before?
>> >>>
>> >>> regards
>> >>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

I have just built new S2 (after tag 2.0.2), made sure that the old JAR
files are replaced and restarted it. If something is fixed - great,
but it still misbehaves under IE and Opera.
There is also some issue common to all browsers (including FF):

*) If I have 3 stacked autocompleters, every autocompleter has a value
and I submit the form to go to the same action (reload with selected
values), then only the top autocompleter is displayed with the correct
value. The other 2 autocompleters are empty - but the code in
generated HTML suggests that the correct values were passed to dojo:
   <input dojoType="struts:ComboBox" ... initialValue="A4" initialKey="3541" ...

The dependent autocompleters are just blank.
And the funny thing is that the browser asks the server for valus to
be shown in autocompleter2 and autocompleter3 and gets the correct
values - on page load. Even more funny is that it shows autocompleter1
with the predefined value, and I may expand both autocompleter2 and
autocompleter3 (nothing selected in autocompleter2).


*) Problem under Opera 9.0.2.
 I know a little more about problems under Opera.
 It is enough to have single autocompleter to reproduce it.
 Some value is selected, the dropdown is hidden.
 I click the downArrow with mouse, the dropdown with options nicely
opens and I may change selection. If I mark with mouse/keyboard at
least 1 character in the selected value (as if you were preparing for
copy/paste) then clicking the downArrow has no effect. If I deselect
the character - it works again.
The problem is that after making a selection with mouse - the value is
automatically marked/selected and the downArrow will not work.
Possibly the solution would be to make sure that no character is
marked after choosing an option. Or changing the condition under which
the dropdown checks what options to display.

Similar problem under Opera when typing something in the autocompleter.
If the dropdown is already shown/opened - it will work.
But if you start typing when it is hidden, it will not work because
some characters are automatically marked/selected. Pressing backspace
makes it work.
It is all reproductible with the sample I have sent you.

*) IE 6
Still problems on my machine. Even with simple autocompletes.
I can see an error in the status bar. No details. Just:
  Line:  4872   [It must be sth in the javascript, the HTML code is
much shorter]
  Char:  1
  Error:  [object error]
  Code: 0


Thanks for your help.
And a Happy New Year!

 Dariusz Wojtas



On 12/31/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> Both problems should now be fixed on IE 6.
>
> regards
> musachy
>
> Musachy Barroso wrote:
> > I will fix it so it ignores that null value. UTF-8 works.
> >
> > regards
> > musachy
> >
> > Dariusz Wojtas wrote:
> >> I am not really sure if it worked before, both autcompleter and my
> >> code do evolve ;)
> >> I was always using JSP with UTF-8 encoding to generate my options.
> >> Is UTF-8 a problem here?
> >>
> >> You mean
> >>    [ ["A", "B"] , ]
> >> is problematical for IE, but
> >>    [ ["A", "B"] ]
> >> will work? Should I change something in the json list generation or
> >> the autocompleter will recognize such case?
> >>
> >> Dariusz Wojtas
> >>
> >> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> >>> This is what I found so far, there are 2 problems, one is that when
> >>> there is a json array like:
> >>>
> >>> [ ["A", "B"] , ]
> >>>
> >>> IE puts a null object in the array. That one is easy to fix. The other
> >>> problem is that using freemaker, like in showcase to render the json
> >>> array, the charset of the response is set to Cp1252, which causes the
> >>> error on IE. If I use a jsp to render the json array, the encoding is
> >>> ISO-8859-1 which works fine. Was this working for you before?
> >>>
> >>> regards
> >>> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
Both problems should now be fixed on IE 6.

regards
musachy

Musachy Barroso wrote:
> I will fix it so it ignores that null value. UTF-8 works.
>
> regards
> musachy
>
> Dariusz Wojtas wrote:
>> I am not really sure if it worked before, both autcompleter and my
>> code do evolve ;)
>> I was always using JSP with UTF-8 encoding to generate my options.
>> Is UTF-8 a problem here?
>>
>> You mean
>>    [ ["A", "B"] , ]
>> is problematical for IE, but
>>    [ ["A", "B"] ]
>> will work? Should I change something in the json list generation or
>> the autocompleter will recognize such case?
>>
>> Dariusz Wojtas
>>
>> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>>> This is what I found so far, there are 2 problems, one is that when
>>> there is a json array like:
>>>
>>> [ ["A", "B"] , ]
>>>
>>> IE puts a null object in the array. That one is easy to fix. The other
>>> problem is that using freemaker, like in showcase to render the json
>>> array, the charset of the response is set to Cp1252, which causes the
>>> error on IE. If I use a jsp to render the json array, the encoding is
>>> ISO-8859-1 which works fine. Was this working for you before?
>>>
>>> regards
>>> musachy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
I will fix it so it ignores that null value. UTF-8 works.

regards
musachy

Dariusz Wojtas wrote:
> I am not really sure if it worked before, both autcompleter and my
> code do evolve ;)
> I was always using JSP with UTF-8 encoding to generate my options.
> Is UTF-8 a problem here?
>
> You mean
>    [ ["A", "B"] , ]
> is problematical for IE, but
>    [ ["A", "B"] ]
> will work? Should I change something in the json list generation or
> the autocompleter will recognize such case?
>
> Dariusz Wojtas
>
> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> This is what I found so far, there are 2 problems, one is that when
>> there is a json array like:
>>
>> [ ["A", "B"] , ]
>>
>> IE puts a null object in the array. That one is easy to fix. The other
>> problem is that using freemaker, like in showcase to render the json
>> array, the charset of the response is set to Cp1252, which causes the
>> error on IE. If I use a jsp to render the json array, the encoding is
>> ISO-8859-1 which works fine. Was this working for you before?
>>
>> regards
>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
I am not really sure if it worked before, both autcompleter and my
code do evolve ;)
I was always using JSP with UTF-8 encoding to generate my options.
Is UTF-8 a problem here?

You mean
    [ ["A", "B"] , ]
is problematical for IE, but
    [ ["A", "B"] ]
will work? Should I change something in the json list generation or
the autocompleter will recognize such case?

Dariusz Wojtas

On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> This is what I found so far, there are 2 problems, one is that when
> there is a json array like:
>
> [ ["A", "B"] , ]
>
> IE puts a null object in the array. That one is easy to fix. The other
> problem is that using freemaker, like in showcase to render the json
> array, the charset of the response is set to Cp1252, which causes the
> error on IE. If I use a jsp to render the json array, the encoding is
> ISO-8859-1 which works fine. Was this working for you before?
>
> regards
> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
This is what I found so far, there are 2 problems, one is that when 
there is a json array like:

[ ["A", "B"] , ]

IE puts a null object in the array. That one is easy to fix. The other 
problem is that using freemaker, like in showcase to render the json 
array, the charset of the response is set to Cp1252, which causes the 
error on IE. If I use a jsp to render the json array, the encoding is 
ISO-8859-1 which works fine. Was this working for you before?

regards
musachy


Dariusz Wojtas wrote:
> showcase, just built ans started on tomcat 5.5.17
>
> 1) Firefox
> Everything seems to work.
> About the preloaded aurocompletes at the bottom:
> Yes, the value is preloaded but entering and leaving the
> "Autocompleter 1" makes it clear on blur. But filtering of
> "Autocompleter 2" works as expected, even when I change the value in
> "Autocompleter 1" later.
>
> 2) IE 6
> The examples at the top work, down to Disabled.
> The linked autocompleters have problem.
> a) Fresh page just after loading.
>    Nothing is touched, I press the down icon on "Autocomplete2" to see 
> options
>    but nothing opens. And I see no javascript error message.
> b) Fresh page. I give focus with mouse to Autocompleter 1, then 
> Autocompleter 2.
>    Autocompleter 1 looses value.
>    No options in autocompleter 2
> c) I try to change values in Autocompleter 1, but nothing loads into
> autocompleter 2
> With IE I could see no error messages. It just did not work.
>
> 3) Opera 9.0.2
> The top examples do work (single autocompleters) - all seem to work 
> for me.
> Linked autocompletes:
> a) focus into Autocompleter 1, then Autocompleter 2 - auto 1 looses value
> b) changing auto1 does not load anything into auto2 (empty all the time)
>
> When I open the error console in Opera - I see some warnings and errors.
>
> Best regards
> Dariusz Wojtas
>
> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Is showcase working for you? On IE I'm getting a "Error: System error:
>> -1072896658". Some people have had the same problem due to encoding
>> issues. The error message is really explicit :)
>>
>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
showcase, just built ans started on tomcat 5.5.17

1) Firefox
Everything seems to work.
About the preloaded aurocompletes at the bottom:
Yes, the value is preloaded but entering and leaving the
"Autocompleter 1" makes it clear on blur. But filtering of
"Autocompleter 2" works as expected, even when I change the value in
"Autocompleter 1" later.

2) IE 6
The examples at the top work, down to Disabled.
The linked autocompleters have problem.
a) Fresh page just after loading.
    Nothing is touched, I press the down icon on "Autocomplete2" to see options
    but nothing opens. And I see no javascript error message.
b) Fresh page. I give focus with mouse to Autocompleter 1, then Autocompleter 2.
    Autocompleter 1 looses value.
    No options in autocompleter 2
c) I try to change values in Autocompleter 1, but nothing loads into
autocompleter 2
With IE I could see no error messages. It just did not work.

3) Opera 9.0.2
The top examples do work (single autocompleters) - all seem to work for me.
Linked autocompletes:
a) focus into Autocompleter 1, then Autocompleter 2 - auto 1 looses value
b) changing auto1 does not load anything into auto2 (empty all the time)

When I open the error console in Opera - I see some warnings and errors.

Best regards
 Dariusz Wojtas

On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> Is showcase working for you? On IE I'm getting a "Error: System error:
> -1072896658". Some people have had the same problem due to encoding
> issues. The error message is really explicit :)
>
> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
Is showcase working for you? On IE I'm getting a "Error: System error: 
-1072896658". Some people have had the same problem due to encoding 
issues. The error message is really explicit :)

musachy

Dariusz Wojtas wrote:
> On 12/28/06, Martin Gainty <mg...@hotmail.com> wrote:
>> can we see the
>> autoCompleter code
>> any relevant JS (setBeforeLoading,setAfterLoading)
>
> ok, the last question made me check the code again.
> I found an error in my code - an artefact from the yesterdays
> autocompleter usage.
>     formId="kalkulatorForm"
>     formFilter="filterModelPojazdow"
> with some of the autocompletes.
>
> They all look identical and differ only in the field names
>
>  function filterModelPojazdow(field) {
>     return (field.name == "carMakerKey") || (field.name == 
> "carModelFilter");
>  }
>
> but still contained old field names and did not let the params to be
> attached to the URL loading the combo. With the above function
> (updated names) it works better.
>
> That means that when preloading carMaker with some value - IT
> CORRECTLY CAUSES DEPENDENT AUTOCOMPLETER TO LOAD ITS FILTERED OPTIONS.
> Both Firefox and IE.
>
> Current problems:
> a) Firefox and IE
> If carMaker is preloaded, I select carModel and carType then if I give
> focus to carMaker and then leave the field: all 3 fields are cleared.
> carMaker is cleared and it propagates the change to other fields.
>
> b) IE
> I preload carMaker (AUDI).
> I enter the carMaker field and try to type something, for example
> delete the last leter (now we have AUD) and it causes javascript error
> in IE.
> Works under Firefox. I can see a dropdown with matching value, and
> later matching values.
>
> c) some general problem with dojo - static resources are loaded once
> per each component instance. If I have 3 autocompletes then
>    /struts/dojo/src/widget/templates/images/combo_box_arrow.png
> is requested 3 times.
> That was true a month ago, that is true now. The same applies for
> datetimepicker and possibly other ajax components. The same behaviour
> under Firefox and IE.
>
> Sorry for the false report before.
> Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
On 12/28/06, Martin Gainty <mg...@hotmail.com> wrote:
> can we see the
> autoCompleter code
> any relevant JS (setBeforeLoading,setAfterLoading)

ok, the last question made me check the code again.
I found an error in my code - an artefact from the yesterdays
autocompleter usage.
	formId="kalkulatorForm"
	formFilter="filterModelPojazdow"
with some of the autocompletes.

They all look identical and differ only in the field names

  function filterModelPojazdow(field) {
	return (field.name == "carMakerKey") || (field.name == "carModelFilter");
  }

but still contained old field names and did not let the params to be
attached to the URL loading the combo. With the above function
(updated names) it works better.

That means that when preloading carMaker with some value - IT
CORRECTLY CAUSES DEPENDENT AUTOCOMPLETER TO LOAD ITS FILTERED OPTIONS.
Both Firefox and IE.

Current problems:
a) Firefox and IE
If carMaker is preloaded, I select carModel and carType then if I give
focus to carMaker and then leave the field: all 3 fields are cleared.
carMaker is cleared and it propagates the change to other fields.

b) IE
I preload carMaker (AUDI).
I enter the carMaker field and try to type something, for example
delete the last leter (now we have AUD) and it causes javascript error
in IE.
Works under Firefox. I can see a dropdown with matching value, and
later matching values.

c) some general problem with dojo - static resources are loaded once
per each component instance. If I have 3 autocompletes then
    /struts/dojo/src/widget/templates/images/combo_box_arrow.png
is requested 3 times.
That was true a month ago, that is true now. The same applies for
datetimepicker and possibly other ajax components. The same behaviour
under Firefox and IE.

Sorry for the false report before.
Dariusz Wojtas

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Martin Gainty <mg...@hotmail.com>.
can we see the
autoCompleter code
any relevant JS (setBeforeLoading,setAfterLoading)

Thx,

--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Dariusz Wojtas" <dw...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, December 28, 2006 10:26 AM
Subject: Re: [S2] autocompleter, predefining initial value


> Hi,
> 
> These are excerpts from my JSP page:
> 
> <s:url id="markaPojazdowURL" value="/listy/markiPojazdow.action" />
> <s:autocompleter name="carMaker"
> theme="ajax"
> href="%{markaPojazdowURL}"
> cssStyle="width: 240px;"
> dropdownHeight="200"
> forceValidOption="true"
> notifyTopics="/markaPojazdowTopic"
> />
> 
> 
>    And the direct dependent autocompleter:
> 
> <s:url id="modelPojazdowURL" value="/listy/modelePojazdow.action" />
> <s:autocompleter name="carModel"
> theme="ajax"
> href="%{modelPojazdowURL}"
> cssStyle="width: 240px;"
> dropdownHeight="200"
> forceValidOption="true"
> listenTopics="/markaPojazdowTopic"
> notifyTopics="/modelPojazdowTopic"
> />
> 
> Values "AUDI" and 354 are axactly the same as one of the pairs
> returned by the JSON list.
> The 'disappear' behaviour happens on Firefox 2.
> 
> I have 3 autocompleters in chain
>   carMaker  - preloaded (AUDI, 352)
>   carModel  - empty
>   carType  - empty
> 
> I click on carMaker (no request is sent to the server), then I click
> somewhere else (but not in any autocompleter) and here is what i can
> observe:
> * carMaker field is cleared
> * server gets request for options of the autocompleter carType
> * server gets request for options of the autocompleter carModel
> * server gets request for options of the autocompleter carType
> 
> This happens on Firefox.
> 
> On IE the carMaker field is not cleared on blur. Also no error in the
> status bar.
> But changes in carMaker do not generate requests to the server to load carModel.
> 
> 
> Dariusz Wojtas
> 
> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Dariusz Wojtas wrote:
>> >
>> > But If I open such page [the same values preloaded] and just click
>> > somewhere in that autocompleter [no changes] and leave the field - the
>> > value is lost.
>> > Some event is generated that causes fresh reload of the field.
>> > Submitted form shows both properties empty.
>> >
>>
>> Are you using "forceValidOption"="true" on that one?
>>
>> > One little other issue is that if carMaker is preselected on load,
>> > then the dependent autocompleter (carModel) is not preloaded with
>> > options. I have to change carMaker to make carModel loaded with
>> > options.
>> >
>>
>> humm...does it happen on FF and IE? Is it different from the example on
>> showcase?
>>
>> > Best regards
>> > Dariusz Wojtas
>> >
>> > On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> >> Hi Dariusz
>> >>
>> >> I need to update the documentation with this info, the thing is that for
>> >> each autocompleter, struts will create 2 fields, one for the text
>> >> entered, with the name "${name}" and another for the key, with the name
>> >> "${name}Key", we need both to "remember" the values if there is a
>> >> validation error or you return INPUT from your page, so if you have:
>> >>
>> >> ["ACURA","351"]
>> >>
>> >> and
>> >>
>> >> <s:autocompleter name="car"....>
>> >>
>> >> when you click submit, it will submit:
>> >>
>> >>   car=ACURA&carKey=351
>> >>
>> >> you need to add the property "car" and "carKey" in your action. About
>> >> the opera problem, I haven't test it on opera, but I will check it out.
>> >>
>> >> regards
>> >> musachy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi,

These are excerpts from my JSP page:

	<s:url id="markaPojazdowURL" value="/listy/markiPojazdow.action" />
	<s:autocompleter name="carMaker"
		theme="ajax"
		href="%{markaPojazdowURL}"
		cssStyle="width: 240px;"
		dropdownHeight="200"
		forceValidOption="true"
		notifyTopics="/markaPojazdowTopic"
		/>


    And the direct dependent autocompleter:

	<s:url id="modelPojazdowURL" value="/listy/modelePojazdow.action" />
	<s:autocompleter name="carModel"
		theme="ajax"
		href="%{modelPojazdowURL}"
		cssStyle="width: 240px;"
		dropdownHeight="200"
		forceValidOption="true"
		listenTopics="/markaPojazdowTopic"
		notifyTopics="/modelPojazdowTopic"
		/>

Values "AUDI" and 354 are axactly the same as one of the pairs
returned by the JSON list.
The 'disappear' behaviour happens on Firefox 2.

I have 3 autocompleters in chain
   carMaker  - preloaded (AUDI, 352)
   carModel  - empty
   carType  - empty

I click on carMaker (no request is sent to the server), then I click
somewhere else (but not in any autocompleter) and here is what i can
observe:
* carMaker field is cleared
* server gets request for options of the autocompleter carType
* server gets request for options of the autocompleter carModel
* server gets request for options of the autocompleter carType

This happens on Firefox.

On IE the carMaker field is not cleared on blur. Also no error in the
status bar.
But changes in carMaker do not generate requests to the server to load carModel.


Dariusz Wojtas

On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> Dariusz Wojtas wrote:
> >
> > But If I open such page [the same values preloaded] and just click
> > somewhere in that autocompleter [no changes] and leave the field - the
> > value is lost.
> > Some event is generated that causes fresh reload of the field.
> > Submitted form shows both properties empty.
> >
>
> Are you using "forceValidOption"="true" on that one?
>
> > One little other issue is that if carMaker is preselected on load,
> > then the dependent autocompleter (carModel) is not preloaded with
> > options. I have to change carMaker to make carModel loaded with
> > options.
> >
>
> humm...does it happen on FF and IE? Is it different from the example on
> showcase?
>
> > Best regards
> > Dariusz Wojtas
> >
> > On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> >> Hi Dariusz
> >>
> >> I need to update the documentation with this info, the thing is that for
> >> each autocompleter, struts will create 2 fields, one for the text
> >> entered, with the name "${name}" and another for the key, with the name
> >> "${name}Key", we need both to "remember" the values if there is a
> >> validation error or you return INPUT from your page, so if you have:
> >>
> >> ["ACURA","351"]
> >>
> >> and
> >>
> >> <s:autocompleter name="car"....>
> >>
> >> when you click submit, it will submit:
> >>
> >>   car=ACURA&carKey=351
> >>
> >> you need to add the property "car" and "carKey" in your action. About
> >> the opera problem, I haven't test it on opera, but I will check it out.
> >>
> >> regards
> >> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
Dariusz Wojtas wrote:
>
> But If I open such page [the same values preloaded] and just click
> somewhere in that autocompleter [no changes] and leave the field - the
> value is lost.
> Some event is generated that causes fresh reload of the field.
> Submitted form shows both properties empty.
>

Are you using "forceValidOption"="true" on that one?

> One little other issue is that if carMaker is preselected on load,
> then the dependent autocompleter (carModel) is not preloaded with
> options. I have to change carMaker to make carModel loaded with
> options.
>

humm...does it happen on FF and IE? Is it different from the example on 
showcase?

> Best regards
> Dariusz Wojtas
>
> On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Hi Dariusz
>>
>> I need to update the documentation with this info, the thing is that for
>> each autocompleter, struts will create 2 fields, one for the text
>> entered, with the name "${name}" and another for the key, with the name
>> "${name}Key", we need both to "remember" the values if there is a
>> validation error or you return INPUT from your page, so if you have:
>>
>> ["ACURA","351"]
>>
>> and
>>
>> <s:autocompleter name="car"....>
>>
>> when you click submit, it will submit:
>>
>>   car=ACURA&carKey=351
>>
>> you need to add the property "car" and "carKey" in your action. About
>> the opera problem, I haven't test it on opera, but I will check it out.
>>
>> regards
>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

I tried as you advised.
Works, no more exceptions and the values are set as expected.

But there is still some little problem with preloading.
Now I have properties
   private String carMaker = "AUDI";
   private Integer carMakerKey = 354;
with hardcoded initial value, just for test.
I open my page and the value is preloaded as expected. AUDI is shown.
I submit the form - params are filled as expected. AUDI and 354.

But If I open such page [the same values preloaded] and just click
somewhere in that autocompleter [no changes] and leave the field - the
value is lost.
Some event is generated that causes fresh reload of the field.
Submitted form shows both properties empty.

One little other issue is that if carMaker is preselected on load,
then the dependent autocompleter (carModel) is not preloaded with
options. I have to change carMaker to make carModel loaded with
options.

Best regards
 Dariusz Wojtas

On 12/28/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> Hi Dariusz
>
> I need to update the documentation with this info, the thing is that for
> each autocompleter, struts will create 2 fields, one for the text
> entered, with the name "${name}" and another for the key, with the name
> "${name}Key", we need both to "remember" the values if there is a
> validation error or you return INPUT from your page, so if you have:
>
> ["ACURA","351"]
>
> and
>
> <s:autocompleter name="car"....>
>
> when you click submit, it will submit:
>
>   car=ACURA&carKey=351
>
> you need to add the property "car" and "carKey" in your action. About
> the opera problem, I haven't test it on opera, but I will check it out.
>
> regards
> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
Hi Dariusz

I need to update the documentation with this info, the thing is that for 
each autocompleter, struts will create 2 fields, one for the text 
entered, with the name "${name}" and another for the key, with the name 
"${name}Key", we need both to "remember" the values if there is a 
validation error or you return INPUT from your page, so if you have:

["ACURA","351"]

and

<s:autocompleter name="car"....>

when you click submit, it will submit:
 
  car=ACURA&carKey=351

you need to add the property "car" and "carKey" in your action. About 
the opera problem, I haven't test it on opera, but I will check it out.

regards
musachy

Dariusz Wojtas wrote:
> Hello,
>
> I am very happy with the changes being made.
> They really seem to help - on Firefox 2 :)
> I can see much better propagation of events in cascaded
> autocompleters, predefining seems to work on the simple test case that
> I made.
>
> But there are still problems, some of them seem to be very new.
> I have made a fresh build today (trunk of S2, revision 490697) and the
> problems that I can now see [on Windows XP SP2] are:
>
> a) problems on MsExplorer (latest 6.xx) - problems with propagating 
> events
>    even if I try to type characters in the 1st autocompleter in the
> chain I get javascript error.
>    I cannot say much about the error [poor console in ie] but it
> makes it unusable.
>    If I try to click on the dropdown first - usually it opens as it 
> should.
>    But events are still not propagated.
>
> b) problems on Opera  (9.0.2) - propagating events does not seem to work.
>
> There is also one big problem that is browser independent.
> I have a property in my action:
>   private Integer carMakerId;
> with getter and setter.
> And I have autocompleter attached to it that.
> The list it is loaded with is like this (part of real output) - [name, 
> id]:
>
>   [ ["ACURA","351"], ["ALFA ROMEO","353"], ["AUDI","354"],....]
>
> After I select AUDI and submit the form I get URL like this
>  /myApp/myAction.action?carMakerId=AUDI&carMakerIdKey=354
> And that creates a long stacktrace because the carMakerId property is
> of type Integer, which makes the action fail completely - stacktrace.
> I created a separate JIRA ticket for the exception problem:  WW-1577
> [improve property handling].
>
> But the question here is - How should I handle such properties in my 
> actions?
> Create property
>  private Integer carMakerIdKey;
> instead? Will it be understood when preloading the value?
> What if the property postfix changes? [I think it did recently].
> Any hints on that?
>
> Thanks a lot,
> I am really trying not to complain, I really see improvements but
> there is still a lot to be done ;(
>
> Best regards
> Dariusz Wojtas
>
>
> On 12/27/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> I attached a patch to WW-1562 to fix some of the things you requested.
>>
>> regards
>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hello,

I am very happy with the changes being made.
They really seem to help - on Firefox 2 :)
I can see much better propagation of events in cascaded
autocompleters, predefining seems to work on the simple test case that
I made.

But there are still problems, some of them seem to be very new.
I have made a fresh build today (trunk of S2, revision 490697) and the
problems that I can now see [on Windows XP SP2] are:

a) problems on MsExplorer (latest 6.xx) - problems with propagating events
    even if I try to type characters in the 1st autocompleter in the
chain I get javascript error.
    I cannot say much about the error [poor console in ie] but it
makes it unusable.
    If I try to click on the dropdown first - usually it opens as it should.
    But events are still not propagated.

b) problems on Opera  (9.0.2) - propagating events does not seem to work.

There is also one big problem that is browser independent.
I have a property in my action:
   private Integer carMakerId;
with getter and setter.
And I have autocompleter attached to it that.
The list it is loaded with is like this (part of real output) - [name, id]:

   [ ["ACURA","351"], ["ALFA ROMEO","353"], ["AUDI","354"],....]

After I select AUDI and submit the form I get URL like this
  /myApp/myAction.action?carMakerId=AUDI&carMakerIdKey=354
And that creates a long stacktrace because the carMakerId property is
of type Integer, which makes the action fail completely - stacktrace.
I created a separate JIRA ticket for the exception problem:  WW-1577
[improve property handling].

But the question here is - How should I handle such properties in my actions?
Create property
  private Integer carMakerIdKey;
instead? Will it be understood when preloading the value?
What if the property postfix changes? [I think it did recently].
Any hints on that?

Thanks a lot,
I am really trying not to complain, I really see improvements but
there is still a lot to be done ;(

Best regards
 Dariusz Wojtas


On 12/27/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> I attached a patch to WW-1562 to fix some of the things you requested.
>
> regards
> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
I attached a patch to WW-1562 to fix some of the things you requested.

regards
musachy

Dariusz Wojtas wrote:
> I would leave the current behaviour as the default.
> When there is small amount of data (up to hundreds of entries) it may
> give the end user feeling of a faster response. If there is more data
> then the developer should make use the the new feature.
>
> The info about reloading is a great news :)
> Thanks a lot.
>
> Dariusz Wojtas
>
> On 12/17/06, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Making the autocompleter reload its content while typing was easier than
>> expected :). Do you think it would be better to have that behavior , or
>> the current one, by default?
>>
>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Dariusz Wojtas <dw...@gmail.com>.
I would leave the current behaviour as the default.
When there is small amount of data (up to hundreds of entries) it may
give the end user feeling of a faster response. If there is more data
then the developer should make use the the new feature.

The info about reloading is a great news :)
Thanks a lot.

Dariusz Wojtas

On 12/17/06, Musachy Barroso <mb...@wfscorp.com> wrote:
> Making the autocompleter reload its content while typing was easier than
> expected :). Do you think it would be better to have that behavior , or
> the current one, by default?
>
> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] autocompleter, predefining initial value

Posted by Musachy Barroso <mb...@wfscorp.com>.
Making the autocompleter reload its content while typing was easier than 
expected :). Do you think it would be better to have that behavior , or 
the current one, by default?

musachy

Dariusz Wojtas wrote:
> Hi,
>
> I am using Struts 2.0.2, trunk.
>
> I have an action (/listy/kodyPocztowe) that returns postal codes [id, 
> name]
> and another action that server a form (form points to the same action 
> back).
>
> How to define the initial value in the autocompleter field?
> Even if I submit the form and it reloads with the same action, the
> autocompleter does not display previously selected option.
>
> I tried to use a javascript  (shown below) to debug it (print field 
> names).
> When an alert shows, in place of autocompleter I can see plain
> textfield with resubmitted values (as expected), after alert messages
> do finish it is replaced by the autocompleter widget - empty value,
> nothing selected. the widget is loaded with options, but none is
> selected.
>
> Any hint how to solve this mistery?
> What am I missing?
>
>
> <script type="text/javascript">
>  function filterKodPocztowy(field) {
>    alert(field.name);
>     return field.name == "kodPocztowy";
>  }
> </script>
>
> <s:form id="calcForm" ...>
>   [...]
>   <s:url id="kodPocztowyURL" value="/listy/kodyPocztowe.action" />
>   <s:autocompleter name="kodPocztowy"
>     theme="ajax"
>     href="%{kodPocztowyURL}"
>     forceValidOption="true"
>     formId="calcForm"
>     formFilter="filterKodPocztowy"
>     />
>   [...]
>
>   <s:submit .../>
> </s:form
>
>
> Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org