RE: Iterate Problem

2002-04-26 Thread Chris Cool

Hi, Mark:

I am displaying "task" information in an HTML table using the iterate tag.
In the table are a set of input fields that allow my user to modfiy the
values of each task (in your case you may simply want to display the value
as readonly text). By using the "indexed = true" attribute of the "text"
tag, when you submit the html form struts will update each of the action
forms accessible via the getTasks()/setTasks() methods in
"MyTaskActionForm":



 
  

  
  

  
  

  
 


Hope this helps,

Chris



-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 2:00 PM
To: Struts (E-mail)
Subject: Iterate Problem


I sure seem to be having my share of problems with  this
week
 
My form bean (EditCustomerForm) has a property that sets and gets a List of
Customer objects.  These objects themselves contain the usual name, address,
etc. stuff.  I need to iterate through the collection of objects and display
the individual properties (like name, address, etc.) of each object.  The
Struts  TagLib documentation and Developer Guide are not particularly
useful in this regard.  We are adhering strictly to the Struts model and do
not want to use scriplets.
 
If anyone has figured this out, please post a solution.
 
Thanks,
Mark

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Accessing ActionServlet from Action class

2002-03-29 Thread Chris Cool

The Action.getServlet() method provides access to the ActionServlet.

-Original Message-
From: Bhaskar Gopalan [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 9:09 AM
To: Struts Group (E-mail)
Subject: Accessing ActionServlet from Action class


Hi,
is there anyway to access the ActionServlet from inside a formBean or Action
class?

Thnx,
Bhaskar

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: returning the selected value from an

2002-03-26 Thread Chris Cool

Hi, Josef:

The way I handle it is to have three properties in my action form:

1. priority is the value that will be set in action form when the html for
is submitted.
2. priorityIds is the list of possible values that will be submitted for the
"priority".
3. priorityLabels is the list of Strings that appear in the select.

  

  

Hope this helps.

Chris



-Original Message-
From: josef richberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 10:34 AM
To: Struts Users Mailing List
Subject: Re: returning the selected value from an 


That I understand.  What I don't understand is how to
do that.  How can I reference the value chosen in the
select?  The id is tied to the bean.  

--josef
--- Jim Crossley <[EMAIL PROTECTED]> wrote:
> In your formbean, you need to distinguish between
> the value selected
> and the values able to be selected.  You've
> accounted for the latter.
> You need another method to account for the former. 
> The property
> referred to in your bean:define (returning a
> Collection) should not be
> the same property referred to in your html:select
> that returns a
> String.
> 
> -- Jim
> 
> josef richberg <[EMAIL PROTECTED]> writes:
> 
> > I have the following code snippet: 
> >  > property="vname"
> > type="java.util.Collection"/>
> > 
> > then below 
> > 
> >  > property="value"  labelProperty="label"/>
> > 
> > 
> > I have a getter method in my Action form: 
> >  public Collection getVname(){
> > return new DBAccess().getVendorNames();
> >  }
> > 
> > The problem is if I try to set the result of the
> > selection via this method in the action form: 
> >  public void setVname(String value){
> >xx
> >  }
> > 
> > it errors with: No getter method for property
> vname of
> > bean ProdAddForm 
> > How do I retrieve the lone value of the select? 
> > --josef
> > 
> > 
> > __
> > Do You Yahoo!?
> > Yahoo! Movies - coverage of the 74th Academy
> Awards(r)
> > http://movies.yahoo.com/
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards(r)
http://movies.yahoo.com/

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Tiles question: Is it possible to insert a ComponentDefinition into a Tile context dynamically?

2002-03-26 Thread Chris Cool

Hello, Cedric:

Thank you for responding to my question. 

As you stated, I can add/overload an attribute in the current context.
Specifically, I am adding a new item to an existing list. However, each item
in the list is the key to a Tile definition. Most of the definitions are in
the XML file, but I want to add a new Tile definition dynamically so that
the new item in the list is a reference to the new Tile definition. Is this
possible?

Thanks again,

Chris 

-Original Message-
From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 10:29 AM
To: Struts Users Mailing List
Subject: Re: Tiles question: Is it possible to insert a
ComponentDefinition into a Tile context dynamically?



  Hello,

  If you are in a tile controller, you don't have to create a new
ComponentDefinition, you can set the attributes of the current tiles
(because you
are in the controller).
  To add / overload an attribute in the context, do something like :
  String attribute = (String)context.getAttribute("attributeName");
  attribute = "new value";
  context.setAttribute("attributeName", attribute);

  To add a list, create the list, add elements, and add the list to context.
  You can overload a previously defined list. Do not modify content of an
existing list, because it is shared between inherited instances. :

   List list = new java.util.ArrayList();
  list.add( "a value" );
  list.add( "another value");
  context.setAttribute("listAttributeName", list);

  Hope this help,

Cedric

P.S. :
The DefinitionsUtil.setActionDefinition( aDefinition ); is to be used when
you
are inside a Struts action called by Struts mechanism.
  It has not effect when used inside a tile controller
Chris Cool wrote:

> Hi,
>
> I have a tile that reads items from a PutList list and then inserts each
> item into the current page.
>
> type="String">
>
>
>
> When the items in the list are tiles defined in my tileDefinitions.xml
file,
> the tiles are inserted into my JSP correctly. However, I want to
dynamically
> create a tile definition and insert it into the page context.
>
> I am generating the ComponentDefinition in my tile controller and
accessing
> the "itemList" where I add the name of the dynamically generated
definition:
>
>   /* get the item list and insert new tile def into it */
>   ArrayList itemList = (ArrayList)context.getAttribute("itemList");
>   if (itemList != null) {
>
> HashMap map = new HashMap();
> map.put("name", "newtarget");
> map.put("link", "newtarget.do");
>
> ComponentDefinition newItem =
> new ComponentDefinition("new.item",
>   "/mytiles/simpleItem.jsp",
> map);
>
> DefinitionsUtil.setActionDefinition( request, breadCrumbItem );
> itemList.add("new.item");
>   }
>
> In my tile, the "itemList" contains the "new.item" entry, but it does not
> appear to find the ComponentDefinition I created.
>
> Thanks for you help.
>
> Chris
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


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

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




Tiles question: Is it possible to insert a ComponentDefinition into a Tile context dynamically?

2002-03-23 Thread Chris Cool

Hi,

I have a tile that reads items from a PutList list and then inserts each
item into the current page. 

   
   
   

When the items in the list are tiles defined in my tileDefinitions.xml file,
the tiles are inserted into my JSP correctly. However, I want to dynamically
create a tile definition and insert it into the page context. 

I am generating the ComponentDefinition in my tile controller and accessing
the "itemList" where I add the name of the dynamically generated definition:

  /* get the item list and insert new tile def into it */
  ArrayList itemList = (ArrayList)context.getAttribute("itemList");
  if (itemList != null) {

HashMap map = new HashMap();
map.put("name", "newtarget");
map.put("link", "newtarget.do");

ComponentDefinition newItem = 
new ComponentDefinition("new.item",
  "/mytiles/simpleItem.jsp",
map);

DefinitionsUtil.setActionDefinition( request, breadCrumbItem );
itemList.add("new.item");
  }

In my tile, the "itemList" contains the "new.item" entry, but it does not
appear to find the ComponentDefinition I created.

Thanks for you help.

Chris

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Tiles question: Is it possible to insert a ComponentDefinition into a Tile context dynamically?

2002-03-22 Thread Chris Cool

Hi,

I have a tile that reads items from a PutList list and then inserts each
item into the current page. 

   
   
   

When the items in the list are tiles defined in my tileDefinitions.xml file,
the tiles are inserted into my JSP correctly. However, I want to dynamically
create a tile definition and insert it into the page context. 

I am generating the ComponentDefinition in my tile controller and accessing
the "itemList" where I add the name of the dynamically generated definition:

  /* get the item list and insert new tile def into it */
  ArrayList itemList = (ArrayList)context.getAttribute("itemList");
  if (itemList != null) {

HashMap map = new HashMap();
map.put("name", "newtarget");
map.put("link", "newtarget.do");

ComponentDefinition newItem = 
new ComponentDefinition("new.item",
  "/mytiles/simpleItem.jsp",
map);

DefinitionsUtil.setActionDefinition( request, breadCrumbItem );
itemList.add("new.item");
  }

In my tile, the "itemList" contains the "new.item" entry, but it does not
appear to find the ComponentDefinition I created.

Thanks for you help.

Chris

--
To unsubscribe, e-mail:   
For additional commands, e-mail: