You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "JEEVANATHAM P. /BPCRP/INFOTECH/VASHI" <je...@3i-infotech.com> on 2006/01/05 10:27:15 UTC

Need Help in Dispaly Tag

Hi all,

 

For data grid I am using display Tag.

I have added radio button as a first column of my table.

My problem is 

how can I get data when the radio is checked (one row only in which row
radio is checked)?

 

Please let me know.

 

Regards,

JEEVANANTHAM PARAMASAMY, 



 

-- 
Greetings!

 


ICICI Infotech is now 3i Infotech.


The e-mail addresses of the company's employees have been changed to <existing name>@3i-infotech.com. You are requested to take note of this new e-mail ID and make use of the same in future

 
"This e-mail message may contain confidential, proprietary or legally privileged information. It should not be used by anyone who is not the original intended recipient. If you have erroneously received this message, please delete it immediately and notify the sender. The recipient acknowledges that 3i Infotech or its subsidiaries and associated companies, (collectively "3i Infotech"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of 3i Infotech. Before opening any attachments please check them for viruses and defects."


Re: Need Help in Dispaly Tag

Posted by Rick Reumann <st...@reumann.net>.
JEEVANATHAM P. /BPCRP/INFOTECH/VASHI wrote the following on 1/5/2006 
4:27 AM:

> For data grid I am using display Tag.
> 
> I have added radio button as a first column of my table.
> 
> My problem is 
> 
> how can I get data when the radio is checked (one row only in which row
> radio is checked)?

Something to think about. I'm not sure if the Display tag still uses the 
Session to store all of it's content. I'm assuming it still does, which 
to me is pretty lame, but regardless, I still prefer two sets of queries

1) First query brings back my list of objects, that may or may not 
contain all the information that I'd be particularly interested in 
editing. So for example maybe I'd have a query return me a list of 
Orders that just had an "orderID" and "orderName." This is what I'd 
display on the page.

2) Then based off the "orderID" I'd actually do the lookup of the full 
"Order" record. Often times this full object contains a BUNCH more stuff 
- often with a bunch of joins to other tables etc that could be an 
expensive db operation, so to me it's silly to bring ALL of that back in 
each object on the first pass just to display some info like "orderID" 
and "orderName."

I know this isn't the preferred .NET or possibly even JSF way of doing 
things, but to me it makes the most sense so I do it:)

So in your case Jeevanatham, I'd often just use the unique key on the 
row and then use that to lookup the actual object from the DB. I guess 
if your objects don't contain much you could just display them all and 
use the index to pull the object out of the Collection stored in Session 
scope. Not my preferred way of doing it, but a lot of people seem to 
like that approach.


-- 
Rick

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


Re: Need Help in Dispaly Tag

Posted by Laurie Harper <la...@holoweb.net>.
JEEVANATHAM P. /BPCRP/INFOTECH/VASHI wrote:
> Hi all,
> 
>  
> 
> For data grid I am using display Tag.
> 
> I have added radio button as a first column of my table.
> 
> My problem is 
> 
> how can I get data when the radio is checked (one row only in which row
> radio is checked)?

Make sure each radio button has a different value (e.g. row ID), then 
bind them all to the same form bean property. Then in your action, if 
you have, for example, property="rowId", you can get the selected row 
with form.getRowId().

L.


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