You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kranti Parisa <kr...@gmail.com> on 2004/09/29 11:37:01 UTC

Need Help: Hiding the information on a search result screen

Hi friends,

in my case .. we r generating a jsp which contains some tables of information.
Its a search results screen... we r gettting the records based on the
search criteria given by the user..

but the problem is as follows...

There is a button on the screen "Refine Search"

The user can refine search by deselecting product/products, which he
does not want to view. These products are available on search result
screen. After unchecking the checkboxes for products, user when clicks
on <Refine Search> button, all products, which satisfies given search
criteria except unchecked products would appear on the search result
screen. Also row level refine is possible. Checkboxes are provided for
individual attributes as well as to some blocks headers. User can
uncheck the checkboxes for any attributes/blocks he wants to hide and
click on <REFINE SEARCH> to get a refined result set. By checking the
block level check boxes and clicking <REFINE SEARCH> user can get back
the hidden information.


so how to hide the information if the user checks the option

Please help me to solve this...

-- 
-- 
Kranti Kiran Kumar Parisa
Software Engineer [ e-Biz ],
Patni Computer Systems Ltd.,
India
Mobile: +91 98504 45977

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


Re: Need Help: Hiding the information on a search result screen

Posted by Erik Weber <er...@mindspring.com>.
Create a wrapper class or companion class for your product beans. If 
it's a wrapper class, each instance contains a reference to a product. 
If it's a companion class, perhaps you have a couple of maps, with the 
keys in both maps being product ID, and the value in one being the 
product, while the value in the other is the associated companion object 
for that product. Either way you have one wrapper class or companion 
class instance for each product bean.

Now you have a place to store "metadata" about each product -- stuff 
that is associated with that product but that is not part of the product 
itself. The JSP then, before rendering each product, can consult the 
metadata for that particular product. This metadata could be something 
like a table (map or 2D array) of switches, with keys like 
"SHOW_PRODUCT", "SHOW_ATTRIBUTE_1", "SHOW_ATTRIBUTE_2", and the values 
could be Booleans. Use JSTL logic tags to render/not render as you 
iterate and render the search results.

To back up a bit -- when the user posts the (refine search) form, the 
processing Action class should create some type of "user preferences" or 
"user selections" object (based on the values of the checkboxes you 
described). This object should be passed to the manager-layer object 
which is going to put together the search results. This manager-layer 
object can then create the "switches" I described above as it is 
assembling the search results.

1) user posts data
2) processing action constructs user selections object
3) processing action constructs search criteria object
4) processing action invokes manager-layer component with selections, 
criteria objects
5) manager-layer object uses DAOs, etc., to conduct search
6) manager-layer object (or, even better, a combination of a 
manager-layer object and a view-helper object) assembles search results 
into some sensible structure, pairing metadata based on user selections 
object with the product list
7) processing action receives the search results/display metadata from 
the manager-layer object/view-helper object invocation(s)
8) processing action makes this data available to JSP and forwards

Erik




Kranti Parisa wrote:

>Hi friends,
>
>in my case .. we r generating a jsp which contains some tables of information.
>Its a search results screen... we r gettting the records based on the
>search criteria given by the user..
>
>but the problem is as follows...
>
>There is a button on the screen "Refine Search"
>
>The user can refine search by deselecting product/products, which he
>does not want to view. These products are available on search result
>screen. After unchecking the checkboxes for products, user when clicks
>on <Refine Search> button, all products, which satisfies given search
>criteria except unchecked products would appear on the search result
>screen. Also row level refine is possible. Checkboxes are provided for
>individual attributes as well as to some blocks headers. User can
>uncheck the checkboxes for any attributes/blocks he wants to hide and
>click on <REFINE SEARCH> to get a refined result set. By checking the
>block level check boxes and clicking <REFINE SEARCH> user can get back
>the hidden information.
>
>
>so how to hide the information if the user checks the option
>
>Please help me to solve this...
>
>  
>

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