Selection of s:optgroup on page load

2009-06-23 Thread Rubbinio

Hi,

i have the select below which uses s:optgroup to group my values. The
soCustomerFiltration is TreeMap, while the
customerFilter is an String[].

All work well in terms of rendering except that once I select something and
press a button to update the page my selection is not persisted. I can see
the getCustomerFilter being called on the action and the values returned are
the correct id's but I can not understand why my values are not selected
anymore. Any help is appreciated. 







Thanks
Radu
-- 
View this message in context: 
http://www.nabble.com/Selection-of-s%3Aoptgroup-on-page-load-tp24175975p24175975.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: ScopedModelDriven issues

2008-09-19 Thread Rubbinio

I had same issue. Make sure you do not do a new ModelClass() anywhere in your
action. Then it will work



Tracy12 wrote:
> 
> Hi,
> 
> Has any one successfull getting ScopedModelDriven with
> session scoped form beans,
> 
> I tried several times and it failed, the values only
> remains for request scope, it get reset each time.
> 
> Is this a bug.
> 
> Plese let us know how to proceed.
> 
> Thanks
> 
> 
>  
> 
> Don't pick lemons.
> See all the new 2007 cars at Yahoo! Autos.
> http://autos.yahoo.com/new_cars.html 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ScopedModelDriven-issues-tp10677278p19579021.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 Page & Ctrl+R

2008-07-08 Thread Rubbinio

What do you mean ?

I have a link the user click on in Frame 1: listDashboardAction.action

That invokes my action, does some stuff and returns "input" which in my
struts.xml is

/setup/dashboard/dashboard_config.jsp

And that gets loaded in frame 2.

Now how can i set the frame source cause i really can not see it ? Frame 2
gets to load different pages based on what the user selects in terms of
options.

Thanks


Lukasz Lenart wrote:
> 
> Hi,
> 
> Put all your frameset's source to actions, not to jsp files.
> 
> 
> Regards
> -- 
> Lukasz
> http://www.lenart.org.pl/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Page---Ctrl%2BR-tp18036792p18348192.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 Page & Ctrl+R

2008-07-08 Thread Rubbinio

That's the thing,

the application is in a frameset and the struts 2 action is in on of the
frames. Now my action result is a JSP and not an action. When I hit refresh
in the Struts2 Filter I get the jsp name. So how can I make it have the
.action because my page is rendered as a result of an action ?



Lukasz Lenart wrote:
> 
> Hi,
> 
> What you have in browser's address bar?
> 
> CTRL+R just make GET request to your application, if you have .action
> in your url, apropreciated action has to be called.
> 
> 
> Regards
> -- 
> Lukasz
> http://www.lenart.org.pl/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Page---Ctrl%2BR-tp18036792p18347268.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 Page & Ctrl+R

2008-07-08 Thread Rubbinio

Tried that and it did not work at all. I got it working in a way but not the
way I want. Basically what I did was set the values in the session and then
on page refresh they are picked up ok. The problem is the data on the page
might change so I would like to have the action invoked when the user does a
page refresh. 
But that does not happen. 

So I got the struts 2 sources and see if the refresh makes a request to the
server, which it does and it gets in the Struts 2 filter dispatcher but it
never makes it to my action. I am guessing that is due to the fact that my
result for the previous action is a jsp.

Now the question is, is there any way to make the framework invoke my action
when the user presses CTRL+R or the browser refresh button ?

My config file looks like this:



... interceptor stack

/setup/dashboard/dashboard_config.jsp
/setup/dashboard/delete_confirm_dashboard.jsp
/setup/dashboard/index.jsp

param name="actionName" - listDashboardAction




Lukasz Lenart wrote:
> 
> You can check Scope Plugin
> http://cwiki.apache.org/S2PLUGINS/scope-plugin.html maybe it will be
> helpful
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Page---Ctrl%2BR-tp18036792p18341136.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2 Page & Ctrl+R

2008-06-20 Thread Rubbinio

Hi all,

we have some Struts 2 pages which load fine but if the user uses Ctrl+R or
Browser Refresh the page reloads but no values are populated.

This worked fine before using Struts 1 and my guess is that it was because
the form was present in session. 

Is there any way to make this work in Struts 2 ?
-- 
View this message in context: 
http://www.nabble.com/Struts-2-Page---Ctrl%2BR-tp18036792p18036792.html
Sent from the Struts - User mailing list archive at Nabble.com.


Re: Struts 2 file upload size validation

2008-05-09 Thread Rubbinio


mgainty wrote:
> 
> 2.0.11 FileUploadIntereptor.java
> 
> ActionContext ac = invocation.getInvocationContext();
> HttpServletRequest request = (HttpServletRequest) 
> ac.get(ServletActionContext.HTTP_REQUEST);
> HashMap map = request.getParameterMap();
> //for further information take a look at
> http://www.docjar.com/docs/api/javax/servlet/ServletRequest.html#getParameterMap
> 
> 

Tried that and it works as long as the file size validation does not fail in
the interceptor. If it fails the parameter map is empty. Any other ideas.

-- 
View this message in context: 
http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17146914.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 file upload size validation

2008-05-08 Thread Rubbinio

Yes if the file size is OK everything is fine. At first we used the default
stack. Then we took the default and modified it by moving the
fileUploadInterceptor below the params interceptor so it would look
something like this:


interceptor-stack name="ourUploadStack"

interceptor-ref name="exception"

interceptor-ref name="alias"

interceptor-ref name="servletConfig"

interceptor-ref name="prepare"

interceptor-ref name="i18n"

interceptor-ref name="chain"

interceptor-ref name="debugging"

interceptor-ref name="profiling"

interceptor-ref name="scopedModelDriven"

interceptor-ref name="modelDriven"

interceptor-ref name="checkbox"

interceptor-ref name="staticParams"

interceptor-ref name="params"

  param name="excludeParams"dojo\..*param

interceptor-ref

interceptor-ref name="conversionError"

interceptor-ref name="fileUpload"

interceptor-ref name="validation"

param name="excludeMethods"input,back,cancel,browseparam

interceptor-ref

    interceptor-ref name="workflow"

param name="excludeMethods"input,back,cancel,browseparam

interceptor-ref

interceptor-stack



Thanks
R



Laurie Harper wrote:
> 
> Rubbinio wrote:
>> Hi,
>> 
>> we are trying to use file upload in Struts 2 and run into the following
>> problem.
>> 
>> We have a form with multiple fields among which one is a file input
>> field.
>> The user must complete the form and then select a file to upload. If the
>> file size is larger than what we specify in the struts.properties the
>> FileUploadInterceptor validates and adds the error. Up to here everything
>> is
>> fine however upon having the error passed to the action we want to return
>> to
>> the same form, display the error and have the rest of fields populated
>> with
>> the values the user has inputed (except the file field).
>> 
>> The problem is that when we get in the action (validate method) none of
>> the
>> request parameters (form values) are populated. Everything is empty.
>> 
>> The question is why is this happening and how can we have the form values
>> populated in the action so that we can display the page correctly ?
> 
> What interceptor stack are you using? Does everything work as expected 
> if the file size does not exceed the size you specify?
> 
> L.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17125070.html
Sent from the Struts - User mailing list archive at Nabble.com.


Struts 2 file upload size validation

2008-05-07 Thread Rubbinio

Hi,

we are trying to use file upload in Struts 2 and run into the following
problem.

We have a form with multiple fields among which one is a file input field.
The user must complete the form and then select a file to upload. If the
file size is larger than what we specify in the struts.properties the
FileUploadInterceptor validates and adds the error. Up to here everything is
fine however upon having the error passed to the action we want to return to
the same form, display the error and have the rest of fields populated with
the values the user has inputed (except the file field).

The problem is that when we get in the action (validate method) none of the
request parameters (form values) are populated. Everything is empty.

The question is why is this happening and how can we have the form values
populated in the action so that we can display the page correctly ?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17112411.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 1 & Struts 2 file upload problem

2008-04-22 Thread Rubbinio

Hi,

we have an old application written in Struts 1 and we started adding new
features in Struts 2. In the old application we had a file upload form which
was working fine.

After adding Struts 2, the form does not work anymore because the file field
is not populated in the form anymore and it is always null.

In the sever console we can see : org.apache.struts2.dispatcher.Dispatcher
getSaveDir which does not show up if Struts 2 is removed.

Is there any way to have both file uploads ( Struts 1 and 2 ) working in
parallel ? And if yes how ? If not how can we disable the Struts 2 file
upload ?

Thanks


-- 
View this message in context: 
http://www.nabble.com/Struts-1---Struts-2-file-upload-problem-tp16824755p16824755.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: s2 : checkbox and checkboxlist : dynamic lists

2008-01-14 Thread Rubbinio

Struts 2.0.11
Nope, no documentation just many attempts until we got it to work.

The class looks like this:

public class OurAction extends ActionSupport implements SessionAware,
ParameterAware, ParameterNameAware {
.
private String[] selectedGroup;
.

public void setSelectedGroup(String[] selectedGroup) {
  this.selectedGroup = selectedGroup;
}

The JSP:


.
   
  .
  
  .

.



The mapping in struts.xml



.
results set here
.


-- 
View this message in context: 
http://www.nabble.com/s2-%3A-checkbox-and-checkboxlist-%3A-dynamic-lists-tp14760993p14812186.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: s2 : checkbox and checkboxlist : dynamic lists

2008-01-11 Thread Rubbinio

Actually you can do something like this



And in the action class you can have:

private String[] selectedGroup;

Which will be populated back with what you have selected. It works fine in
our application. 
-- 
View this message in context: 
http://www.nabble.com/s2-%3A-checkbox-and-checkboxlist-%3A-dynamic-lists-tp14760993p14762264.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to write JSP to populate back a hashmap of custom objects

2008-01-08 Thread Rubbinio

Great,

thank you so much. It works fine. 

We had: 
And should have had: 

What a difference two ' make !


jimkski wrote:
> 
> Hi Rubbino-
> 
> The vita rara blog provided a good example of using the Map method to
> update a list of domain entries.  
> 
> http://www.vitarara.org/cms/struts_2_cookbook/updating_a_list_of_domain_entities
> 
> I followed that example exactly and was able to get a form submit using
> maps working.  
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-write-JSP-to-populate-back-a-hashmap-of-custom-objects-tp14665986p14696848.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to write JSP to populate back a hashmap of custom objects

2008-01-07 Thread Rubbinio

Hi,

we have defined the following custom object:

public class GenericElement{
   private String key;
   private String value;

   public GenericElement(){
   }

   public String getKey() {
  return key;
   }

   public void setKey(String key) {
  this.key = key;
   }

   public String getValue() {
  return value;
   }

   public void setValue(String value) {
  this.value = value;
   } 
}  


And the following action class that uses a HashMap of such objects:

public class CommunicationSettingsAction extends ActionSupport {

   private Map list;
 
  public String save() throws Exception {
 //here should be populated
   }

   public String load() throws Exception{
  this.list = new HashMap();
  GenericElement ge = new GenericElement();
  ge.setKey("key one");
  ge.setValue("one value");
  this.list.put("one", ge);

  ge = new GenericElement();
  ge.setKey("two");
  ge.setValue("two value");
  this.list.put("two", ge);

  return SUCCESS;
   }

   public Map getList() {
  return list;
   }

   public void setList(Map list) {
  this.list = list;
   }
}

Finally, the JSP looks like this:

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ include file="/includes/body_header.jsp" %>

  
  

 

 /images/customer_l.gif 
 
 
  


  
 
 
 
  
  
  
   




Now the action executes fine and we get back a list with one object in it.
So that is OK. However the key is always set to null so when we have
multiple objects on the page (i.e. multiple sets of textboxes ) on submit we
only get back the last object since at every step it is over written because
the key is not set.

What needs to be done to have the key for each object in the hash map be set
back as well.

We have seen cases where this was done with Struts 2 by hard coding the key
but how can one do it dynamically ?

Thanks
-- 
View this message in context: 
http://www.nabble.com/How-to-write-JSP-to-populate-back-a-hashmap-of-custom-objects-tp14665986p14665986.html
Sent from the Struts - User mailing list archive at Nabble.com.


Mixing Struts 1 and Struts 2

2007-12-18 Thread Rubbinio

Hi,

we have a fairly tricky question. We have a Struts 1 application which is
very big. We do not have the time to migrate it all to Struts 2 so we want
to do it step by step. We run into a situation in which we want to have a
Struts 1 Action class forward to a Struts 2 action. Is this possible in any
way ? I tried to search and look for an answer but could not find one. Any
suggestions are appreciated.

Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/Mixing-Struts-1-and-Struts-2-tp14397614p14397614.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]