• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Highlight corresponding row after Return button press

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help me!!!

I want to highlight a row in the table, after i return from the page that it lead to.
How do i do it?
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some one please help me!!!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"RK RK", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Failure to comply will result in the removal of your account.

bear
JavaRanch Sheriff
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope its fine now
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help!!!
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please make sure you put a little more description for the question. Make the guesswork less for the people who read the questions.

Please provide more information about the scenario, to increase your chances of getting it resolved.
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a table with links in it on page1.
when i click on a link in a row it leads me to a new page2.
I have a return button there, onclicking it leads to the parent page1.
I need to highlight the respective row in the table after clicking return button.
How do i do this.
I think i need to capture the url history using http, but i am not sure how to do it...please help
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please can someone help!!!1
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't a Struts question.

Use CSS to highlight the row in question.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As sushant pointed out, you are really light on the details of your situation.
In really general terms, I would presume that you have some sort of id which identifies the record you are selecting on page1 and displaying on page2. I would add a parameter to the URL on the return button to indicate which record to highlight.
You will have to change however you are displaying records on page1 to check for a highlight parameter and, if it exists, highlight that one row by means of a CSS class or inline style declaration.
If you take a look at the iterator tag documentation, you will see an example which highlights odd numbered rows. Perhaps that will point you in the right direction.
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is the code snippet:

I have 2 jsps:

---------Table.jsp------------
<s:url id="orgURL" action="Vieworg" namespace="/orgs" includeParams="none" escapeAmp="true">
<s aram name="org.id" value="#attr.row.id" />
</s:url>

<display:column sortable="true" sortProperty="id" titleKey="org.orgNumber">
<a name="org.id" ></a>
<s:a href="%{orgURL}">${row.id}</s:a>
</display:column>
<display:column sortable="false" titleKey="org.description">


----------- Return.jsp-----------

<table id='Return'>
<tr><td valign="top" align="right">
<s:url anchor = "org.id" includeParams="true" action="ListOrg" namespace="/org" id="ReturnURL" >
<s aram name="org.id" value="#attr.org.id" />
<s aram name="p" value="#attr.p" />
</s:url>
<s:a href="%{ReturnURL}" >Return URL Org</s:a>
</td>
</tr>
</table>

---------------
1.in table.jsp i have the table being displayed with rows having links in them(paged display of the rows)
2.wen klik on the link it leads to Return.jsp
3.now wen i klik the return button in Return.jsp it has to lead me to Table.jsp and it has to find the correct page where the record is and highlight the correct row.

Hope this would give a clear picture:

Please help!!!
[ November 14, 2008: Message edited by: Rachel Kumar ]
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yea, you should have mentioned display tag earlier. I've never used it. Perhaps this example will give you some ideas?
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok anyways thanks for your effort.

Is there anyone who could please help with this, who knows display tag?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you considered the DisplayTag documentation or the DisplayTag mailing lists?
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am very new to the display tag so i am not sure of the options lease can you let me know how to go about this?

Is there any options that i can use in the s:url or s:a tag of the return.jsp so that it could lead me to the correct page.

Please help!!!
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i am very new to the display tag so i am not sure of the options lease can you let me know how to go about this?

Is there any options that i can use in the s:url or s:a tag of the return.jsp so that it could lead me to the correct page.


For DisplayTag questions please ask on a DisplayTag-related list or forum; I provided the URLs for both the DisplayTag project and mailing lists.
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel it does not matter how the table is displayed i mean using the display tag.

Its is just that we need to capture that which row was kliked and on which page and then when returned back, need to be directed to the correct page and highlight the corresponding row.

I tried using the s:url / s:a tags , is there any other option that i can capture that exact page number and the row that was kliked?

I have this idea but i am not sure how to implement it.

Please can i get help to implement this logic?
I need some help!!!
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't you just generate a link with the row ID (or whatever you're using) in it?!

 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you dont mind please can you take a look at the jsp code snippet that i have posted previously, so that i can get a better idea?

Please!!!
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't really understand what issue you're having. You asked how to highlight a row, I said look at the DisplayTag docs or ask on a DisplayTag list. You asked how to generate a URL with variables in it, I showed you--just substitute whatever variables you need.

Your method may also work--you'd have to look at the generated HTML to see if it is working or not. Is it?

As the <s:a...> docs state it's really designed for use with the Ajax theme, although I suppose it could work.

Dave
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont still know how well to explain to you.

ok let me give another try...

i have a jsp called table.jsp, that displays a table with more than 500 rows in it in a paged manner(pagelinks) so there are more than 10 pages.

the second cell of each row has links in it.
When i klik on the link it leads me to another page2 that is handled by the return.jsp.

In the return.jsp i have a return button that leads me just back to the tables page(table.jsp).

Now my issue here is that if i have kliked some row on the 10th page of the tables then how do i capture the row number that was kliked and that exact page number, so that i am returned back and highlight the correct row on the correct page.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You put the page number and row number into the URL, either how you're already doing it, or how I showed you.
 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
still i am not able to solve this:

the issue is that:
i need to capture the history as to which row and on which page number it was clicked, for this i need to cache the query string. my query string looks like this ?org.id=433&d-16544-p=4

where org.id is the org.id nnumber that i click on the row of the table and p=4 is the page number.
How do i capture this and it should be remembered when i return and highlighted accordingly.

Please give me some kind of sample atleast, using struts/javascript/jsp/html...so that i can implement it...

i hope the problem is well described in my previous posts..
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Struts 2 URL parameters are mapped to action properties. If you have action properties with publicly accessible setters the URL parameters will be type-converted and set on the action by the framework.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic