You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adwait B <ad...@rediffmail.com> on 2003/07/14 08:54:59 UTC

table dispaly

Hi,

I have a table like screen :

Column A      Column B  Column C ...
(Check Box)   (lable)   (lable)

The only editable field is checkbox that is used for deleting 
rows
in the table.One can imagine typical mail
inteface(yahoo/hotmail)
How I can achieve this?I'm confused about displaying as well as
capturing output for delete action.

Can anyone send me sample code for this type of page including
form bean..or any guideline! I think this type of situation is 
common..please help
Urgent help required.
-AB

___________________________________________________
Click below to experience Sooraj R Barjatya's latest offering
'Main Prem Ki Diwani Hoon' starring Hrithik, Abhishek
  & Kareena http://www.mpkdh.com


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


Re: table dispaly

Posted by Firat TIRYAKI <fi...@pleksus.com.tr>.
use checkbox names associated with the data in columnB and C. Maybe you can
use their IDs like below

<input type="checkbox" name="check_ID"> ID is ;

<input type="checkbox" name="check_54">
<input type="checkbox" name="check_85">
.
.
.
.
.

F.

----- Original Message -----
From: "Adwait B" <ad...@rediffmail.com>
To: <st...@jakarta.apache.org>
Sent: Monday, July 14, 2003 9:54 AM
Subject: table dispaly


> Hi,
>
> I have a table like screen :
>
> Column A      Column B  Column C ...
> (Check Box)   (lable)   (lable)
>
> The only editable field is checkbox that is used for deleting
> rows
> in the table.One can imagine typical mail
> inteface(yahoo/hotmail)
> How I can achieve this?I'm confused about displaying as well as
> capturing output for delete action.
>
> Can anyone send me sample code for this type of page including
> form bean..or any guideline! I think this type of situation is
> common..please help
> Urgent help required.
> -AB
>
> ___________________________________________________
> Click below to experience Sooraj R Barjatya's latest offering
> 'Main Prem Ki Diwani Hoon' starring Hrithik, Abhishek
>   & Kareena http://www.mpkdh.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



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


Re: Using ResourceBundle's subclass in Struts

Posted by Duan Qiang <qd...@ilog.com.sg>.
Hi, Craig, James and David,

Thank you very much for your replies. I understand the problem now.

I have noticed the MessageResources in struts, however, for my application,
I have to maintain two versions of the application, one is the web version
and the other is standalone version. One of my software components has its
own way to handle message resources, for example, it recognizes
&messagebunde.key as a message bundle entry.

As I can understand, I should use two sets of message resources in my case,
one set of classes subclassing ResourceBundle to use my software component
and the other set subclassing/using MessageResources in Struts.

Regards,

dq

----- Original Message ----- 
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>;
<dg...@apache.org>
Sent: Tuesday, July 15, 2003 4:04 AM
Subject: Re: Using ResourceBundle's subclass in Struts


>
>
> On Mon, 14 Jul 2003, David Graham wrote:
>
> > Date: Mon, 14 Jul 2003 12:22:55 -0700 (PDT)
> > From: David Graham <gr...@yahoo.com>
> > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
> >      dgraham@apache.org
> > To: Struts Users Mailing List <st...@jakarta.apache.org>
> > Subject: Re: Using ResourceBundle's subclass in Struts
> >
> > --- James Mitchell <jm...@apache.org> wrote:
> > > On Monday 14 July 2003 03:26, Duan Qiang wrote:
> > > > Hi,
> > > >
> > > > I posted a question but seems nobody replied.
> > >
> > > That usually indicated a lack of "interest", not a lack of "concern".
> > >
> > > > Anyone tried to define a
> > > > subclass of ResourceBundle and use it in Struts?
> > >
> > > None that I'm aware of.  There are several reasons for Craig's
decision
> > > not to
> > > use ResourceBundle for application messaging when he originally wrote
> > > Struts.
> > > For more details on that decision, search the archives.
> >
> > The only reason I can remember is that ResourceBundle is frustratingly
not
> > Serializable, making it unsuitable for webapp message passing.
> >
>
> That was definitely a problem.  But MessageResources in Struts also offers
> more facilities than using ResourceBundle directly.  In particular, it
> does the parameter substitution thing for you in a single call.
>
> One of the items early on the 1.2.x time frame is to migrate Struts to use
> the commons-resources package (currently in jakarta-commons-sandbox).  One
> of the benefits gained by doing this will be a much easier way to plug in
> alternative providers for the message text messages (including a way to
> use any ResourceBundle implementation directly), without giving up the
> convenience features of having things together in one method call.
>
> > David
>
> Craig
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: Using ResourceBundle's subclass in Struts

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 14 Jul 2003, David Graham wrote:

> Date: Mon, 14 Jul 2003 12:22:55 -0700 (PDT)
> From: David Graham <gr...@yahoo.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
>      dgraham@apache.org
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Re: Using ResourceBundle's subclass in Struts
>
> --- James Mitchell <jm...@apache.org> wrote:
> > On Monday 14 July 2003 03:26, Duan Qiang wrote:
> > > Hi,
> > >
> > > I posted a question but seems nobody replied.
> >
> > That usually indicated a lack of "interest", not a lack of "concern".
> >
> > > Anyone tried to define a
> > > subclass of ResourceBundle and use it in Struts?
> >
> > None that I'm aware of.  There are several reasons for Craig's decision
> > not to
> > use ResourceBundle for application messaging when he originally wrote
> > Struts.
> > For more details on that decision, search the archives.
>
> The only reason I can remember is that ResourceBundle is frustratingly not
> Serializable, making it unsuitable for webapp message passing.
>

That was definitely a problem.  But MessageResources in Struts also offers
more facilities than using ResourceBundle directly.  In particular, it
does the parameter substitution thing for you in a single call.

One of the items early on the 1.2.x time frame is to migrate Struts to use
the commons-resources package (currently in jakarta-commons-sandbox).  One
of the benefits gained by doing this will be a much easier way to plug in
alternative providers for the message text messages (including a way to
use any ResourceBundle implementation directly), without giving up the
convenience features of having things together in one method call.

> David

Craig

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


Re: Using ResourceBundle's subclass in Struts

Posted by David Graham <gr...@yahoo.com>.
--- James Mitchell <jm...@apache.org> wrote:
> On Monday 14 July 2003 03:26, Duan Qiang wrote:
> > Hi,
> >
> > I posted a question but seems nobody replied. 
> 
> That usually indicated a lack of "interest", not a lack of "concern".
> 
> > Anyone tried to define a
> > subclass of ResourceBundle and use it in Struts?
> 
> None that I'm aware of.  There are several reasons for Craig's decision
> not to 
> use ResourceBundle for application messaging when he originally wrote
> Struts.  
> For more details on that decision, search the archives.

The only reason I can remember is that ResourceBundle is frustratingly not
Serializable, making it unsuitable for webapp message passing.

David

> 
> >
> > For a standalone program, it's straightforward to use sel-defined
> > resourcebundle classes, for example,
> >
> > public class MyResourceBundle extends ResourceBundle
> > {
> >     public Object handleGetObject()
> >     ...
> >     public Enumeration getKeys()
> > }
> >
> > //use the subclass
> > ResourceBundle bundle = ResourceBundle.getBundle("MyResourceBundle");
> >
> > However, when I specify the resource name as "MyResourceBundle",
> Struts can
> > not find the message bundle although my class MyResourceBundle is on
> > classpath.
> >
> > It's possible to replace <bean:message> tag using my own methods,
> however,
> > the action controller I uses is an instance of DispatchAction, which
> will
> > match a method name with the message bundle key, for example,
> "button.next"
> > matches to the function "doNext" and so on.
> >
> > So I can could totally avoid using struts message functionaliity, or
> how I
> > can use my own ResourceBundle?
> 
> Writing your own extension of MessageResource is very simple.  Checkout
> these 
> 4 classes to see how its done:
> org.apache.struts.util.MessageResourcesFactory.java
> org.apache.struts.util.MessageResources.java
> org.apache.struts.util.PropertyMessageResourcesFactory.java
> org.apache.struts.util.PropertyMessageResources.java
> 
> Although, keep in mind that we will be deprecating this api and using 
> "Resources" from Commons (it is currently in the sandbox, but will be 
> released soon I'm sure)
> 
> >
> > THx,
> >
> > Regards,
> >
> > dq
> 
> 
> 
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.struts-atlanta.org
> 678-910-8017
> AIM:jmitchtx
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Re: Using ResourceBundle's subclass in Struts

Posted by James Mitchell <jm...@apache.org>.
On Monday 14 July 2003 03:26, Duan Qiang wrote:
> Hi,
>
> I posted a question but seems nobody replied. 

That usually indicated a lack of "interest", not a lack of "concern".

> Anyone tried to define a
> subclass of ResourceBundle and use it in Struts?

None that I'm aware of.  There are several reasons for Craig's decision not to 
use ResourceBundle for application messaging when he originally wrote Struts.  
For more details on that decision, search the archives.

>
> For a standalone program, it's straightforward to use sel-defined
> resourcebundle classes, for example,
>
> public class MyResourceBundle extends ResourceBundle
> {
>     public Object handleGetObject()
>     ...
>     public Enumeration getKeys()
> }
>
> //use the subclass
> ResourceBundle bundle = ResourceBundle.getBundle("MyResourceBundle");
>
> However, when I specify the resource name as "MyResourceBundle", Struts can
> not find the message bundle although my class MyResourceBundle is on
> classpath.
>
> It's possible to replace <bean:message> tag using my own methods, however,
> the action controller I uses is an instance of DispatchAction, which will
> match a method name with the message bundle key, for example, "button.next"
> matches to the function "doNext" and so on.
>
> So I can could totally avoid using struts message functionaliity, or how I
> can use my own ResourceBundle?

Writing your own extension of MessageResource is very simple.  Checkout these 
4 classes to see how its done:
org.apache.struts.util.MessageResourcesFactory.java
org.apache.struts.util.MessageResources.java
org.apache.struts.util.PropertyMessageResourcesFactory.java
org.apache.struts.util.PropertyMessageResources.java

Although, keep in mind that we will be deprecating this api and using 
"Resources" from Commons (it is currently in the sandbox, but will be 
released soon I'm sure)

>
> THx,
>
> Regards,
>
> dq



-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
678-910-8017
AIM:jmitchtx



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


Using ResourceBundle's subclass in Struts

Posted by Duan Qiang <qd...@ilog.com.sg>.
Hi, 

I posted a question but seems nobody replied. Anyone tried to define a subclass of ResourceBundle and use it in Struts?

For a standalone program, it's straightforward to use sel-defined resourcebundle classes, for example,

public class MyResourceBundle extends ResourceBundle
{
    public Object handleGetObject()
    ...
    public Enumeration getKeys()
}

//use the subclass
ResourceBundle bundle = ResourceBundle.getBundle("MyResourceBundle");

However, when I specify the resource name as "MyResourceBundle", Struts can not find the message bundle although my class MyResourceBundle is on classpath.

It's possible to replace <bean:message> tag using my own methods, however, the action controller I uses is an instance of DispatchAction, which will match a method name with the message bundle key, for example, "button.next" matches to the function "doNext" and so on. 

So I can could totally avoid using struts message functionaliity, or how I can use my own ResourceBundle?

THx,

Regards,

dq

Re: table dispaly

Posted by Nagendra Kumar O V S <na...@ikigo.com>.
hi,
well, i can't give a sample code at this point of time.. i can give a
overview of ur requirement..
1. create a javabean(with id of the row,col1,col2 col3.....) . with all
setter and getter methods... - ( JBean)
2. populate each row with each JBean. 
3. store this each bean in an collection object and set this to the request
object or action form or ...
4. now in ur jsp page u have iterate thro' this collection object and
populate ur table with the values
5. make the id of the row to be the value of the checkbox
6. so when the use checks the box to be deleted , u can capture that and try
to delete them

hope this helps u

--nagi

-------Original Message-------

From: Struts Users Mailing List
Date: Monday, July 14, 2003 12:26:07 PM
To: struts-user@jakarta.apache.org
Subject: table dispaly

Hi,

I have a table like screen :

Column A Column B Column C ...
(Check Box) (lable) (lable)

The only editable field is checkbox that is used for deleting 
rows
in the table.One can imagine typical mail
inteface(yahoo/hotmail)
How I can achieve this?I'm confused about displaying as well as
capturing output for delete action.

Can anyone send me sample code for this type of page including
form bean..or any guideline! I think this type of situation is 
common..please help
Urgent help required.
-AB

___________________________________________________
Click below to experience Sooraj R Barjatya's latest offering
'Main Prem Ki Diwani Hoon' starring Hrithik, Abhishek
& Kareena http://www.mpkdh.com


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


.