You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ray Clough <ra...@allthisisthat.com> on 2007/05/25 11:46:48 UTC

S2 & AJAX questions

I have a dual select box problem - Select control-A needs to trigger an event
which update Select control-B.  Using the s:div tag, I can get the desired
result by having a separate page which contains just a duplicate of Select
Control-B, and is updated by the Action-update method.  Now I understand
that this is probably the only way that the DOJO tags in S2 can handle this
problem, because the s:div tag just refreshes its contents, it can't force
the select tag to update, as it is executed on the server.  Is this the
correct understanding and solution?  This would mean an extra jsp page for
each ajax tag which needs more than a simple string.  A pretty
unsatisfactory solution.

I was looking at the solution in JavaWebParts for the DoubleDynamicSelect
problem, and it is better in some ways, worse in others.  The part which is
appealing is the possibility of an action outputting the code for the
dynamic select control, instead of using a Servlet, as the JWP solution did. 
In Struts-1, if an action execute() method returned null, the container
considered that the result had been rendered, and did nothing further.  Is
there a corollary behavior in S2.  This would allow me to have a method in
the action class write the select tag html to the result output stream, and
that would probably suffice.  If there is no such behavior in S2, does
anyone have any better ideas?

My guess is that the Dynamic-Dual-Select problem is pretty common.  Is there
any thought to creating an Ajax-aware select tag in the Dojo library, or
does anyone know a better solution.

Thanks,
- Ray Clough


-- 
View this message in context: http://www.nabble.com/S2---AJAX-questions-tf3815167.html#a10799998
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: S2: datetimepicker and multiple date formats

Posted by Musachy Barroso <mu...@gmail.com>.
Nope. I'm not so sure that's a good idea as you wouldn't have any way to
parse that date on the server (without knowing the right format).

Warning! bad advise ahead: You can always do something crazy like:

dojo.widget.byId("dp").setValue = function(dateObj) {
};

and then do your thing there, or extend StrusDatePicker widget, which I
would strongly advise not to :)

musachy

On 6/12/07, Scott Nesbitt <sc...@yahoo.com> wrote:
>
>
> I have this code:
>
> <s:datetimepicker id="selectedDate"
>                   name="selectedDate"
>                   displayWeeks="5"
>                   displayFormat= "MM-dd-yyyy"
>
>
>
> value="%{userDetailsBean.selectDateString}"/>
>
> It works fine if the user uses the drop-down or types
> in a date in just the right format.  However, we would
> like the following to work better:
>
> user input   actual value                 desired
> value
> ----------   ------------
> -------------
> 06-12-07     NaN-NaN-0NaN                 06-12-2007
> 06/13/2007   06-12-2007  (refused change) 06-13-2007
> 06 13 2007   06-12-2007  (refused change) 06-13-2007
> etc.
>
> Basically, I would like to allow multiple date formats
> in order to make life easier for my users.
>
> Can I intercept the user input somehow before it goes
> to the validation and fix it up?
>
> Thanks,
>
> Scott
>
>
>
>
>
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: S2: datetimepicker and multiple date formats

Posted by Nicolás Pace <ni...@gmail.com>.
On 6/12/07, Scott Nesbitt <sc...@yahoo.com> wrote:
>
> I have this code:
>
> <s:datetimepicker id="selectedDate"
>                   name="selectedDate"
>                   displayWeeks="5"
>                   displayFormat= "MM-dd-yyyy"
>
>
>
> value="%{userDetailsBean.selectDateString}"/>
>
> It works fine if the user uses the drop-down or types
> in a date in just the right format.  However, we would
> like the following to work better:
>
> user input   actual value                 desired
> value
> ----------   ------------
> -------------
> 06-12-07     NaN-NaN-0NaN                 06-12-2007
> 06/13/2007   06-12-2007  (refused change) 06-13-2007
> 06 13 2007   06-12-2007  (refused change) 06-13-2007
> etc.
>
> Basically, I would like to allow multiple date formats
> in order to make life easier for my users.
>
> Can I intercept the user input somehow before it goes
> to the validation and fix it up?
>

Scott,
Struts 2 automatically uses de correct locale information based in the
host's information.
You don't have to worry about it, unless you wan't to force it.
The best thing to do is to hope that users will configure correctly
their desktops so Struts can use that information correctly.
I hope this could help you
Bye

nicolás Pace
> Thanks,
>
> Scott
>
>
>
>
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
>
> ---------------------------------------------------------------------
> 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: How to update two separate divs using one action call?

Posted by Dave Newton <ne...@yahoo.com>.
--- Scott Nesbitt <sc...@yahoo.com> wrote:
> No, switching the order does not help.

Anything with debug turned on? Can we see your
topic-subscription snippets?

d.

> --- Musachy Barroso <mu...@gmail.com> wrote:
> 
> > If you switch the order do they work? Not that it
> is
> > mandatory but adding a
> > semicolon at the end looks better :). You could
> also
> > make them listen to a
> > common topic an publish that one to make them
> > refresh, in any case it should
> > work they way you have it.
> > 
> > musachy
> > 
> > On 6/12/07, Scott Nesbitt <sc...@yahoo.com>
> > wrote:
> > >
> > >
> > > I have some code like this that is not working:
> > >
> > > dojo.event.topic.subscribe("/refreshTopic",
> > > function(data, type, e)
> > > {
> > >    if ('load' == type)
> > >    {
> > >
> > >
> dojo.event.topic.publish("/refreshCableHeadends")
> > >       dojo.event.topic.publish("/refreshTDGrid")
> > >
> > >       return;
> > >    }
> > > }
> > >
> > > Only the first div (from refreshCableHeadends)
> is
> > > being refreshed, other one is being ignored.
> > >
> > > Any ideas or suggestions?  I tried chaining them
> > > together, that did not work either.
> > >
> > > Thanks,
> > >
> > > Scott
> > >
> > >
> > >
> > >
> > >
> > >
> >
>
____________________________________________________________________________________
> > > Take the Internet to Go: Yahoo!Go puts the
> > Internet in your pocket: mail,
> > > news, photos & more.
> > > http://mobile.yahoo.com/go?refer=1GNXIC
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> > >
> > 
> > 
> > -- 
> > "Hey you! Would you help me to carry the stone?"
> > Pink Floyd
> > 
> 
> 
> 
>      
>
___________________________________________________________________________________
> You snooze, you lose. Get messages ASAP with
> AutoCheck
> in the all-new Yahoo! Mail Beta.
>
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

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


Re: S2: How to update two separate divs using one action call?

Posted by Scott Nesbitt <sc...@yahoo.com>.
No, switching the order does not help.

I found a work-around for this, but it involves
another trip to the server so is not ideal.  Oh well,
thanks anyway.

Scott

--- Musachy Barroso <mu...@gmail.com> wrote:

> If you switch the order do they work? Not that it is
> mandatory but adding a
> semicolon at the end looks better :). You could also
> make them listen to a
> common topic an publish that one to make them
> refresh, in any case it should
> work they way you have it.
> 
> musachy
> 
> On 6/12/07, Scott Nesbitt <sc...@yahoo.com>
> wrote:
> >
> >
> > I have some code like this that is not working:
> >
> > dojo.event.topic.subscribe("/refreshTopic",
> > function(data, type, e)
> > {
> >    if ('load' == type)
> >    {
> >
> > dojo.event.topic.publish("/refreshCableHeadends")
> >       dojo.event.topic.publish("/refreshTDGrid")
> >
> >       return;
> >    }
> > }
> >
> > Only the first div (from refreshCableHeadends) is
> > being refreshed, other one is being ignored.
> >
> > Any ideas or suggestions?  I tried chaining them
> > together, that did not work either.
> >
> > Thanks,
> >
> > Scott
> >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Take the Internet to Go: Yahoo!Go puts the
> Internet in your pocket: mail,
> > news, photos & more.
> > http://mobile.yahoo.com/go?refer=1GNXIC
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?"
> Pink Floyd
> 



      ___________________________________________________________________________________
You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html

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


S2: datetimepicker and multiple date formats

Posted by Scott Nesbitt <sc...@yahoo.com>.
I have this code:

<s:datetimepicker id="selectedDate" 
                  name="selectedDate" 
                  displayWeeks="5" 
                  displayFormat= "MM-dd-yyyy"         
                                                      
                      
                 
value="%{userDetailsBean.selectDateString}"/>

It works fine if the user uses the drop-down or types
in a date in just the right format.  However, we would
like the following to work better:

user input   actual value                 desired
value
----------   ------------                
-------------
06-12-07     NaN-NaN-0NaN                 06-12-2007
06/13/2007   06-12-2007  (refused change) 06-13-2007
06 13 2007   06-12-2007  (refused change) 06-13-2007
etc.

Basically, I would like to allow multiple date formats
in order to make life easier for my users.  

Can I intercept the user input somehow before it goes
to the validation and fix it up?

Thanks,

Scott



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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


Re: S2: How to update two separate divs using one action call?

Posted by Musachy Barroso <mu...@gmail.com>.
If you switch the order do they work? Not that it is mandatory but adding a
semicolon at the end looks better :). You could also make them listen to a
common topic an publish that one to make them refresh, in any case it should
work they way you have it.

musachy

On 6/12/07, Scott Nesbitt <sc...@yahoo.com> wrote:
>
>
> I have some code like this that is not working:
>
> dojo.event.topic.subscribe("/refreshTopic",
> function(data, type, e)
> {
>    if ('load' == type)
>    {
>
> dojo.event.topic.publish("/refreshCableHeadends")
>       dojo.event.topic.publish("/refreshTDGrid")
>
>       return;
>    }
> }
>
> Only the first div (from refreshCableHeadends) is
> being refreshed, other one is being ignored.
>
> Any ideas or suggestions?  I tried chaining them
> together, that did not work either.
>
> Thanks,
>
> Scott
>
>
>
>
>
> ____________________________________________________________________________________
> Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail,
> news, photos & more.
> http://mobile.yahoo.com/go?refer=1GNXIC
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: S2: Want to set autocompleter value

Posted by Scott Nesbitt <sc...@yahoo.com>.
Say, now we are talking!  This page says exactly how
to do that:

http://www.nabble.com/R%C3%A9f.-:-Re:-Initial-Value-of-a-ComboBox-t2641746.html

I tried it and it works great.

Thanks for the pointer, Musachy.

Scott

--- Musachy Barroso <mu...@gmail.com> wrote:

> By the way the property "dataProvider.data" in the
> widget is a hash of the
> key and the values, so you could find the right
> value, and then set it in
> the 2 inputs for the comobox (the visible and the
> hidden ones). I logged a
> ticket for it:
> 
> https://issues.apache.org/struts/browse/WW-1945
> 
> musachy
> 
> 
> 
> On 5/25/07, Musachy Barroso <mu...@gmail.com>
> wrote:
> >
> > 2.1 is going to ship with 0.4.2 or 0.4.3, as for
> 0.9 we don't have any
> > estimated time.
> >
> > musachy
> >
> > On 5/25/07, Scott Nesbitt <
> scottnesbitt@yahoo.com> wrote:
> > >
> > >
> > > That does not seem to do anything for me.
> > >
> > > After reading this:
> > >
> > > http://trac.dojotoolkit.org/ticket/1451
> > >
> > > It looks like setSelectedValue() is going away. 
> I
> > > tried this:
> > >
> > >    var t = dojo.widget.byId ('states');
> > >    t.setValue('AZ');
> > >
> > > And it sets the state to AZ instead of Arizona,
> > > perhaps because the reverse lookup alluded to in
> the
> > > link above is not there yet.
> > >
> > > Not sure what to do at this point.  Are we in
> limbo
> > > waiting  on Godot, er, Dojo 0.9?
> > >
> > > Scott
> > >
> > > --- Musachy Barroso <mu...@gmail.com> wrote:
> > >
> > > > try:
> > > >
> > > >
> > >
>
dojo.widget.byId("autocompleter_id").setSelectedValue("value");
> > > >
> > > > I can't try it myself now, but that's the only
> > > > method that seems to set a
> > > > value in the autocompleter widget.
> > > >
> > > > musachy
> > > >
> > > > On 5/25/07, Scott Nesbitt <
> scottnesbitt@yahoo.com>
> > > > wrote:
> > > > >
> > > > >
> > > > > I have an autocompleter like this:
> > > > >
> > > > > <s:autocompleter name="states"
> > > > >                  id="states"
> > > > >                  theme="simple"
> > > > >                  autoComplete="false"
> > > > >                  showDownArrow="false"
> > > > >                  searchType="startstring"
> > > > >                  forceValidOption="true"
> > > > >         list="#{'AL':'ALABAMA',
> 'AZ':'ARIZONA',
> > > > >                 'AR':'ARKANSAS',
> > > > 'CA':'CALIFORNIA'}"/>
> > > > >
> > > > > In some JavaScript I would like to set the
> state
> > > > to,
> > > > > say, Arizona.  This is not working:
> > > > >
> > > > > var t = dojo.widget.byId('states');
> > > > > t.value = 'AZ';
> > > > >
> > > > > Any ideas?  I also tried statesKey, no luck.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Scott
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
>
____________________________________________________________________________________Be
> > > > > a better Heartthrob. Get better relationship
> > > > answers from someone who knows.
> > > > > Yahoo! Answers - Check it out.
> > > > >
> > > >
> > >
>
http://answers.yahoo.com/dir/?link=list&sid=396545433
> > > > >
> > > > >
> > > >
> > >
>
---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail:
> > > > user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > "Hey you! Would you help me to carry the
> stone?"
> > > > Pink Floyd
> > > >
> > >
> > >
> > >
> > >
> > >
>
____________________________________________________________________________________Luggage?
> > > GPS? Comic books?
> > > Check out fitting gifts for grads at Yahoo!
> Search
> > >
>
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
> > >
> > >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?"
> Pink Floyd
> >
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?"
> Pink Floyd
> 



       
____________________________________________________________________________________Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 

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


S2: How to update two separate divs using one action call?

Posted by Scott Nesbitt <sc...@yahoo.com>.
I have some code like this that is not working:

dojo.event.topic.subscribe("/refreshTopic",
function(data, type, e) 
{ 
   if ('load' == type) 
   { 
     
dojo.event.topic.publish("/refreshCableHeadends")    
      dojo.event.topic.publish("/refreshTDGrid")      

      return; 
   } 
}

Only the first div (from refreshCableHeadends) is
being refreshed, other one is being ignored.

Any ideas or suggestions?  I tried chaining them
together, that did not work either.

Thanks,

Scott



       
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

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


Re: S2: Want to set autocompleter value

Posted by Musachy Barroso <mu...@gmail.com>.
By the way the property "dataProvider.data" in the widget is a hash of the
key and the values, so you could find the right value, and then set it in
the 2 inputs for the comobox (the visible and the hidden ones). I logged a
ticket for it:

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

musachy



On 5/25/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> 2.1 is going to ship with 0.4.2 or 0.4.3, as for 0.9 we don't have any
> estimated time.
>
> musachy
>
> On 5/25/07, Scott Nesbitt < scottnesbitt@yahoo.com> wrote:
> >
> >
> > That does not seem to do anything for me.
> >
> > After reading this:
> >
> > http://trac.dojotoolkit.org/ticket/1451
> >
> > It looks like setSelectedValue() is going away.  I
> > tried this:
> >
> >    var t = dojo.widget.byId ('states');
> >    t.setValue('AZ');
> >
> > And it sets the state to AZ instead of Arizona,
> > perhaps because the reverse lookup alluded to in the
> > link above is not there yet.
> >
> > Not sure what to do at this point.  Are we in limbo
> > waiting  on Godot, er, Dojo 0.9?
> >
> > Scott
> >
> > --- Musachy Barroso <mu...@gmail.com> wrote:
> >
> > > try:
> > >
> > >
> > dojo.widget.byId("autocompleter_id").setSelectedValue("value");
> > >
> > > I can't try it myself now, but that's the only
> > > method that seems to set a
> > > value in the autocompleter widget.
> > >
> > > musachy
> > >
> > > On 5/25/07, Scott Nesbitt < scottnesbitt@yahoo.com>
> > > wrote:
> > > >
> > > >
> > > > I have an autocompleter like this:
> > > >
> > > > <s:autocompleter name="states"
> > > >                  id="states"
> > > >                  theme="simple"
> > > >                  autoComplete="false"
> > > >                  showDownArrow="false"
> > > >                  searchType="startstring"
> > > >                  forceValidOption="true"
> > > >         list="#{'AL':'ALABAMA', 'AZ':'ARIZONA',
> > > >                 'AR':'ARKANSAS',
> > > 'CA':'CALIFORNIA'}"/>
> > > >
> > > > In some JavaScript I would like to set the state
> > > to,
> > > > say, Arizona.  This is not working:
> > > >
> > > > var t = dojo.widget.byId('states');
> > > > t.value = 'AZ';
> > > >
> > > > Any ideas?  I also tried statesKey, no luck.
> > > >
> > > > Thanks,
> > > >
> > > > Scott
> > > >
> > > >
> > > >
> > > >
> > >
> >
> > ____________________________________________________________________________________Be
> > > > a better Heartthrob. Get better relationship
> > > answers from someone who knows.
> > > > Yahoo! Answers - Check it out.
> > > >
> > >
> > http://answers.yahoo.com/dir/?link=list&sid=396545433
> > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > "Hey you! Would you help me to carry the stone?"
> > > Pink Floyd
> > >
> >
> >
> >
> >
> > ____________________________________________________________________________________Luggage?
> > GPS? Comic books?
> > Check out fitting gifts for grads at Yahoo! Search
> > http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: S2: Want to set autocompleter value

Posted by Musachy Barroso <mu...@gmail.com>.
2.1 is going to ship with 0.4.2 or 0.4.3, as for 0.9 we don't have any
estimated time.

musachy

On 5/25/07, Scott Nesbitt <sc...@yahoo.com> wrote:
>
>
> That does not seem to do anything for me.
>
> After reading this:
>
> http://trac.dojotoolkit.org/ticket/1451
>
> It looks like setSelectedValue() is going away.  I
> tried this:
>
>    var t = dojo.widget.byId('states');
>    t.setValue('AZ');
>
> And it sets the state to AZ instead of Arizona,
> perhaps because the reverse lookup alluded to in the
> link above is not there yet.
>
> Not sure what to do at this point.  Are we in limbo
> waiting  on Godot, er, Dojo 0.9?
>
> Scott
>
> --- Musachy Barroso <mu...@gmail.com> wrote:
>
> > try:
> >
> >
> dojo.widget.byId("autocompleter_id").setSelectedValue("value");
> >
> > I can't try it myself now, but that's the only
> > method that seems to set a
> > value in the autocompleter widget.
> >
> > musachy
> >
> > On 5/25/07, Scott Nesbitt <sc...@yahoo.com>
> > wrote:
> > >
> > >
> > > I have an autocompleter like this:
> > >
> > > <s:autocompleter name="states"
> > >                  id="states"
> > >                  theme="simple"
> > >                  autoComplete="false"
> > >                  showDownArrow="false"
> > >                  searchType="startstring"
> > >                  forceValidOption="true"
> > >         list="#{'AL':'ALABAMA', 'AZ':'ARIZONA',
> > >                 'AR':'ARKANSAS',
> > 'CA':'CALIFORNIA'}"/>
> > >
> > > In some JavaScript I would like to set the state
> > to,
> > > say, Arizona.  This is not working:
> > >
> > > var t = dojo.widget.byId('states');
> > > t.value = 'AZ';
> > >
> > > Any ideas?  I also tried statesKey, no luck.
> > >
> > > Thanks,
> > >
> > > Scott
> > >
> > >
> > >
> > >
> >
>
> ____________________________________________________________________________________Be
> > > a better Heartthrob. Get better relationship
> > answers from someone who knows.
> > > Yahoo! Answers - Check it out.
> > >
> >
> http://answers.yahoo.com/dir/?link=list&sid=396545433
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?"
> > Pink Floyd
> >
>
>
>
>
> ____________________________________________________________________________________Luggage?
> GPS? Comic books?
> Check out fitting gifts for grads at Yahoo! Search
> http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: S2: Want to set autocompleter value

Posted by Scott Nesbitt <sc...@yahoo.com>.
That does not seem to do anything for me.

After reading this:

http://trac.dojotoolkit.org/ticket/1451

It looks like setSelectedValue() is going away.  I
tried this:

   var t = dojo.widget.byId('states');
   t.setValue('AZ');

And it sets the state to AZ instead of Arizona,
perhaps because the reverse lookup alluded to in the
link above is not there yet.

Not sure what to do at this point.  Are we in limbo
waiting  on Godot, er, Dojo 0.9?

Scott

--- Musachy Barroso <mu...@gmail.com> wrote:

> try:
> 
>
dojo.widget.byId("autocompleter_id").setSelectedValue("value");
> 
> I can't try it myself now, but that's the only
> method that seems to set a
> value in the autocompleter widget.
> 
> musachy
> 
> On 5/25/07, Scott Nesbitt <sc...@yahoo.com>
> wrote:
> >
> >
> > I have an autocompleter like this:
> >
> > <s:autocompleter name="states"
> >                  id="states"
> >                  theme="simple"
> >                  autoComplete="false"
> >                  showDownArrow="false"
> >                  searchType="startstring"
> >                  forceValidOption="true"
> >         list="#{'AL':'ALABAMA', 'AZ':'ARIZONA',
> >                 'AR':'ARKANSAS',
> 'CA':'CALIFORNIA'}"/>
> >
> > In some JavaScript I would like to set the state
> to,
> > say, Arizona.  This is not working:
> >
> > var t = dojo.widget.byId('states');
> > t.value = 'AZ';
> >
> > Any ideas?  I also tried statesKey, no luck.
> >
> > Thanks,
> >
> > Scott
> >
> >
> >
> >
>
____________________________________________________________________________________Be
> > a better Heartthrob. Get better relationship
> answers from someone who knows.
> > Yahoo! Answers - Check it out.
> >
>
http://answers.yahoo.com/dir/?link=list&sid=396545433
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?"
> Pink Floyd
> 



       
____________________________________________________________________________________Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

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


Re: S2: Want to set autocompleter value

Posted by Musachy Barroso <mu...@gmail.com>.
try:

dojo.widget.byId("autocompleter_id").setSelectedValue("value");

I can't try it myself now, but that's the only method that seems to set a
value in the autocompleter widget.

musachy

On 5/25/07, Scott Nesbitt <sc...@yahoo.com> wrote:
>
>
> I have an autocompleter like this:
>
> <s:autocompleter name="states"
>                  id="states"
>                  theme="simple"
>                  autoComplete="false"
>                  showDownArrow="false"
>                  searchType="startstring"
>                  forceValidOption="true"
>         list="#{'AL':'ALABAMA', 'AZ':'ARIZONA',
>                 'AR':'ARKANSAS', 'CA':'CALIFORNIA'}"/>
>
> In some JavaScript I would like to set the state to,
> say, Arizona.  This is not working:
>
> var t = dojo.widget.byId('states');
> t.value = 'AZ';
>
> Any ideas?  I also tried statesKey, no luck.
>
> Thanks,
>
> Scott
>
>
>
> ____________________________________________________________________________________Be
> a better Heartthrob. Get better relationship answers from someone who knows.
> Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545433
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: S2 & AJAX question

Posted by Ray Clough <ra...@allthisisthat.com>.
I don't think autocompleter will cut it for us, as we have to make the
choices available in 2 drop-downs.  I have an example, which I would be
happy to post, but I don't know the how/where of that.  I also have a very
nifty menu using JSCookMenu populated from an xml file.  This is (IMHO :~))
) a much better menu than the Struts Menu options, which did not look nice
enough for us.  I had tried the JSF JSCookMenu available in Tomahawk, but
there is a bug (probably in Struts) which keeps it from working properly.
- rc



Musachy Barroso wrote:
> 
> Can you use the autocompleter tag? You can link 2 of them easily.
> 
> musachy
> 
> On 5/25/07, Ray Clough <ra...@allthisisthat.com> wrote:
>>
>>
>> We've gotten it to work by having the action method write to the output
>> stream and return null.  This is by far the best solution I've seen yet,
>> but
>> it is a little unsatisfying from an architectual point of view.  It would
>> be
>> more satisfying to have a Topic-based solution, but I can't see how to do
>> that, or if it could possibly work.  The basic problem (with my limited
>> understanding of Ajax) is that the contents of the div are an s:select
>> tag,
>> which is executed on the server when the page is first rendered, and I
>> don't
>> see how the client-side listener can refresh the dynamic contents of that
>> select tag (no longer an s:select tag on the client side).  In order to
>> do
>> that, it seems that the s:select tag itself would have to be
>> ajax-enabled.
>> Is this correct?  Any insight, Anyone?
>>
>> - rc
>>
>>
>>
>> Musachy Barroso wrote:
>> >
>> > You could do it in S2, just like you said you would do it in S1,
>> writing
>> > to
>> > the output stream, without requiring a page for it (not that I'm
>> advising
>> > to
>> > do so ;) ).
>> >
>> > musachy
>> >
>> > On 5/25/07, Dave Newton <ne...@yahoo.com> wrote:
>> >>
>> >> --- Ray Clough <ra...@allthisisthat.com> wrote:
>> >> > [Ajaxy stuff]
>> >>
>> >> You may want to explore Dojo's listenTopics and
>> >> notifyTopics; you can define quite a bit of behavior
>> >> based on a DIV load etc.
>> >>
>> >> It's discussed in an S2 context at:
>> >>
>> >> http://struts.apache.org/2.x/docs/ajax-tags.html
>> >>
>> >> (That page needs reorganizing :/
>> >>
>> >> d.
>> >>
>> >>
>> >>
>> >>
>> >>
>> ____________________________________________________________________________________Ready
>> >> for the edge of your seat?
>> >> Check out tonight's top picks on Yahoo! TV.
>> >> http://tv.yahoo.com/
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/S2---AJAX-questions-tf3815167.html#a10808229
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> 

-- 
View this message in context: http://www.nabble.com/S2---AJAX-questions-tf3815167.html#a10809508
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: S2 & AJAX question

Posted by Musachy Barroso <mu...@gmail.com>.
Can you use the autocompleter tag? You can link 2 of them easily.

musachy

On 5/25/07, Ray Clough <ra...@allthisisthat.com> wrote:
>
>
> We've gotten it to work by having the action method write to the output
> stream and return null.  This is by far the best solution I've seen yet,
> but
> it is a little unsatisfying from an architectual point of view.  It would
> be
> more satisfying to have a Topic-based solution, but I can't see how to do
> that, or if it could possibly work.  The basic problem (with my limited
> understanding of Ajax) is that the contents of the div are an s:select
> tag,
> which is executed on the server when the page is first rendered, and I
> don't
> see how the client-side listener can refresh the dynamic contents of that
> select tag (no longer an s:select tag on the client side).  In order to do
> that, it seems that the s:select tag itself would have to be ajax-enabled.
> Is this correct?  Any insight, Anyone?
>
> - rc
>
>
>
> Musachy Barroso wrote:
> >
> > You could do it in S2, just like you said you would do it in S1, writing
> > to
> > the output stream, without requiring a page for it (not that I'm
> advising
> > to
> > do so ;) ).
> >
> > musachy
> >
> > On 5/25/07, Dave Newton <ne...@yahoo.com> wrote:
> >>
> >> --- Ray Clough <ra...@allthisisthat.com> wrote:
> >> > [Ajaxy stuff]
> >>
> >> You may want to explore Dojo's listenTopics and
> >> notifyTopics; you can define quite a bit of behavior
> >> based on a DIV load etc.
> >>
> >> It's discussed in an S2 context at:
> >>
> >> http://struts.apache.org/2.x/docs/ajax-tags.html
> >>
> >> (That page needs reorganizing :/
> >>
> >> d.
> >>
> >>
> >>
> >>
> >>
> ____________________________________________________________________________________Ready
> >> for the edge of your seat?
> >> Check out tonight's top picks on Yahoo! TV.
> >> http://tv.yahoo.com/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/S2---AJAX-questions-tf3815167.html#a10808229
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: S2 & AJAX question

Posted by Ray Clough <ra...@allthisisthat.com>.
We've gotten it to work by having the action method write to the output
stream and return null.  This is by far the best solution I've seen yet, but
it is a little unsatisfying from an architectual point of view.  It would be
more satisfying to have a Topic-based solution, but I can't see how to do
that, or if it could possibly work.  The basic problem (with my limited
understanding of Ajax) is that the contents of the div are an s:select tag,
which is executed on the server when the page is first rendered, and I don't
see how the client-side listener can refresh the dynamic contents of that
select tag (no longer an s:select tag on the client side).  In order to do
that, it seems that the s:select tag itself would have to be ajax-enabled. 
Is this correct?  Any insight, Anyone?

- rc



Musachy Barroso wrote:
> 
> You could do it in S2, just like you said you would do it in S1, writing
> to
> the output stream, without requiring a page for it (not that I'm advising
> to
> do so ;) ).
> 
> musachy
> 
> On 5/25/07, Dave Newton <ne...@yahoo.com> wrote:
>>
>> --- Ray Clough <ra...@allthisisthat.com> wrote:
>> > [Ajaxy stuff]
>>
>> You may want to explore Dojo's listenTopics and
>> notifyTopics; you can define quite a bit of behavior
>> based on a DIV load etc.
>>
>> It's discussed in an S2 context at:
>>
>> http://struts.apache.org/2.x/docs/ajax-tags.html
>>
>> (That page needs reorganizing :/
>>
>> d.
>>
>>
>>
>>
>> ____________________________________________________________________________________Ready
>> for the edge of your seat?
>> Check out tonight's top picks on Yahoo! TV.
>> http://tv.yahoo.com/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> 

-- 
View this message in context: http://www.nabble.com/S2---AJAX-questions-tf3815167.html#a10808229
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: S2 & AJAX question

Posted by Musachy Barroso <mu...@gmail.com>.
You could do it in S2, just like you said you would do it in S1, writing to
the output stream, without requiring a page for it (not that I'm advising to
do so ;) ).

musachy

On 5/25/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Ray Clough <ra...@allthisisthat.com> wrote:
> > [Ajaxy stuff]
>
> You may want to explore Dojo's listenTopics and
> notifyTopics; you can define quite a bit of behavior
> based on a DIV load etc.
>
> It's discussed in an S2 context at:
>
> http://struts.apache.org/2.x/docs/ajax-tags.html
>
> (That page needs reorganizing :/
>
> d.
>
>
>
>
> ____________________________________________________________________________________Ready
> for the edge of your seat?
> Check out tonight's top picks on Yahoo! TV.
> http://tv.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

S2: Want to set autocompleter value

Posted by Scott Nesbitt <sc...@yahoo.com>.
I have an autocompleter like this:

<s:autocompleter name="states"
                 id="states" 
                 theme="simple"
                 autoComplete="false"
                 showDownArrow="false"
                 searchType="startstring"
                 forceValidOption="true"
        list="#{'AL':'ALABAMA', 'AZ':'ARIZONA', 
                'AR':'ARKANSAS', 'CA':'CALIFORNIA'}"/>

In some JavaScript I would like to set the state to,
say, Arizona.  This is not working:

var t = dojo.widget.byId('states');
t.value = 'AZ';

Any ideas?  I also tried statesKey, no luck.

Thanks,

Scott


       
____________________________________________________________________________________Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

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


Re: S2 & AJAX questions

Posted by Dave Newton <ne...@yahoo.com>.
--- Ray Clough <ra...@allthisisthat.com> wrote:
> [Ajaxy stuff]

You may want to explore Dojo's listenTopics and
notifyTopics; you can define quite a bit of behavior
based on a DIV load etc.

It's discussed in an S2 context at:

http://struts.apache.org/2.x/docs/ajax-tags.html

(That page needs reorganizing :/

d.



       
____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

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