How to sort sequence number

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to sort sequence number

Edward King-2
I want to display table list,so I use displaytag,my code is follows:
<display:table name="datalist" requestURI="/demo.do" id="pl" pagesize="10">
      <display:column property="id" title="ID" sortable="true" headerClass="sortable" />
     <display:column property="name" sortable="true" headerClass="sortable" />
     <display:column property="score" sortable="true" headerClass="sortable" />
</display:table>
 
When it run,it show follow result:
 
id   name  score
1   Jack     80
2   Kate     90
3   Mary     75
 
Then I click score column to sort,it shows:
 
id   name  score
3   Mary     75
1   Jack     80
2   Kate     90
 
Above result is not what I wanted,I hope id column keep unchange,like follows:
id   name  score
1   Mary     75
2   Jack     80
3   Kate     90
 
How to realize above function?  Thanks
 
 
 
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
Reply | Threaded
Open this post in threaded view
|

Re: How to sort sequence number

David Boyd-12
First question is what are you trying to achieve here?

I assume your data is in an collection.  Unless you go and rebuild the collection, resetting the id numbers, when you do a sort then what you ask for does not seem to be achievable.   

On 2/21/2012 02:29, Edward King wrote:
I want to display table list,so I use displaytag,my code is follows:
<display:table name="datalist" requestURI="/demo.do" id="pl" pagesize="10">
      <display:column property="id" title="ID" sortable="true" headerClass="sortable" />
     <display:column property="name" sortable="true" headerClass="sortable" />
     <display:column property="score" sortable="true" headerClass="sortable" />
</display:table>
 
When it run,it show follow result:
 
id   name  score
1   Jack     80
2   Kate     90
3   Mary     75
 
Then I click score column to sort,it shows:
 
id   name  score
3   Mary     75
1   Jack     80
2   Kate     90
 
Above result is not what I wanted,I hope id column keep unchange,like follows:
id   name  score
1   Mary     75
2   Jack     80
3   Kate     90
 
How to realize above function?  Thanks
 
 
 
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d


_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
Reply | Threaded
Open this post in threaded view
|

Re: How to sort sequence number

Dileo, John - Kansas City, MO
In reply to this post by Edward King-2

In this case, it seems that you don’t really want to display the IDs of the items in the collection, but rather just the row number in the table. For this, you can use the <tableId>_rowNum implicit object (pl_rowNum in your example). Look at the example on page 26 of the project documentation PDF.

 

John J. DiLeo, D.Sc.

USDA TAAF Development Lead

Echota Technologies Corp.

Office: (816) 823-5395

Mobile: (816) 803-2678

This message (and any attachments) may contain sensitive (Privacy Act Protected) data as defined in FSA IRM-371. It is your responsibility to adhere to FSA policies and notices in the internal use and protection of sensitive data. If you authorize the release of this information to other government entities for official business purposes you must ensure the recipient is notified that the data is sensitive and that the recipient must be responsible for securing and protecting the data.

 

From: Edward King [mailto:[hidden email]]
Sent: Tuesday, February 21, 2012 1:30 AM
To: [hidden email]
Subject: [displaytag-user] How to sort sequence number

 

I want to display table list,so I use displaytag,my code is follows:

<display:table name="datalist" requestURI="/demo.do" id="pl" pagesize="10">
      <display:column property="id" title="ID" sortable="true" headerClass="sortable" />
     <display:column property="name" sortable="true" headerClass="sortable" />

     <display:column property="score" sortable="true" headerClass="sortable" />

</display:table>

 

When it run,it show follow result:

 

id   name  score

1   Jack     80

2   Kate     90

3   Mary     75

 

Then I click score column to sort,it shows:

 

id   name  score

3   Mary     75

1   Jack     80

2   Kate     90

 

Above result is not what I wanted,I hope id column keep unchange,like follows:

id   name  score

1   Mary     75

2   Jack     80

3   Kate     90

 

How to realize above function?  Thanks

 

 

 

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
Reply | Threaded
Open this post in threaded view
|

Re: How to sort sequence number

Edward King-2
Thanks John, I modify id column as you said,like follows:
 
<display:table name="datalist" requestURI="/demo.do" id="pl" pagesize="10">

     <display:column property="id" title="ID"  headerClass="sortable" ><%=pageContext.getAttribute("pl_rowNum")%></display:column>

     <display:column property="name" sortable="true" headerClass="sortable" />

     <display:column property="score" sortable="true" headerClass="sortable" />

</display:table>

 

when I run above code first,it shows following result:

id   name  score

1   Jack     80

2   Kate     90

3   Mary     75

 

But when I click score column,it shows following result:

id   name  score

3   Mary     75

1   Jack     80

2   Kate     90

 

I hope my sort result is following:

id   name  score

1   Mary     75

2   Jack     80

3   Kate     90

 

Why id value changed? How to keep pl_rowNum value from 1-3 whether sort or not? An example code is better.

Thanks in advance

 

Best regards,

Edward

----- Original Message -----
Sent: Tuesday, February 21, 2012 11:33 PM
Subject: Re: [displaytag-user] How to sort sequence number

In this case, it seems that you don’t really want to display the IDs of the items in the collection, but rather just the row number in the table. For this, you can use the <tableId>_rowNum implicit object (pl_rowNum in your example). Look at the example on page 26 of the project documentation PDF.

 

John J. DiLeo, D.Sc.

USDA TAAF Development Lead

Echota Technologies Corp.

Office: (816) 823-5395

Mobile: (816) 803-2678

This message (and any attachments) may contain sensitive (Privacy Act Protected) data as defined in FSA IRM-371. It is your responsibility to adhere to FSA policies and notices in the internal use and protection of sensitive data. If you authorize the release of this information to other government entities for official business purposes you must ensure the recipient is notified that the data is sensitive and that the recipient must be responsible for securing and protecting the data.

 

From: Edward King [mailto:[hidden email]]
Sent: Tuesday, February 21, 2012 1:30 AM
To: [hidden email]
Subject: [displaytag-user] How to sort sequence number

 

I want to display table list,so I use displaytag,my code is follows:

<display:table name="datalist" requestURI="/demo.do" id="pl" pagesize="10">
      <display:column property="id" title="ID" sortable="true" headerClass="sortable" />
     <display:column property="name" sortable="true" headerClass="sortable" />

     <display:column property="score" sortable="true" headerClass="sortable" />

</display:table>

 

When it run,it show follow result:

 

id   name  score

1   Jack     80

2   Kate     90

3   Mary     75

 

Then I click score column to sort,it shows:

 

id   name  score

3   Mary     75

1   Jack     80

2   Kate     90

 

Above result is not what I wanted,I hope id column keep unchange,like follows:

id   name  score

1   Mary     75

2   Jack     80

3   Kate     90

 

How to realize above function?  Thanks

 

 

 

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d


_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user