Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to show a task ID (and possibly a substring of it)
JonathanNawrocki
I am trying to display a task ID in a zoom view of a task.
(We are trying to have each task be referenced by a unique number.)
I can display the ${task.id} variable.
However, it shows up with !V3!WSMP!C!T$4048! .
I only want to show the 4048 assuming it is unique in the system.
What is the syntax to create a substring for this getting just the 4048 out of this?
My code is before trying a substring is:
Or, it there another way to get a unique number to show up for each task?
Find more posts tagged with
Comments
dbguy
It is unique within each library. If you have multiple libraries, the same number part (our internal DB SID) can be used in both.
If this is OK, you can:
Integer sid = (Integer) task.getPropertyValue("BASE:
ID");
JonathanNawrocki
Thank you.
We are not worried about duplicate IDs across libraries as we only use one.
I think this will work for us.
I would like to try to use the code you provided, but I am still new to JSP.
Can you provide exact syntax and location of where and how to use this variable?
i.e. Can this be used in a $ { varname } ?
I am editing the source on the Viewset > Task > Zoom page and trying to add a
< w : captionField name = " Task Base ID " value = " ..... " > tag.
dbguy
Sorry, but I am less than new to JSP. I am a CMS server side developer, I don't do JSP at all.
sabeer
Hi,
You can use this inside your taskZoom page which i mentioned below:
Task id: < c: out value="${data.task.id}"/>
i Hope it will help u..
JonathanNawrocki
Thank you for your suggestions. I appreciate all of them.
However, I still am not able to achieve the results I am looking for.
ie. - data.task.id will return something like: !V3!WSMP!C!T$4048!
I am trying to only return the "4048" portion of "!V3!WSMP!C!T$4048!".
I could not get the < c
ut tag to work for me.
I was able to get this to work:
< w : captionField name = "Task ID" value = "$ { data.task.id } " style = " width:50% " / >
However, it returns the above "!V3!WSMP!C!T$4048!".
Does anyone know how to return just the number in JSP? I have tried task.sid, task.base.sid etc, but to no avail.
Another possible work arount is to perform a regex or substring on the "!V3!WSMP!C!T$4048!" to just give the 4048 as I am only trying to read this number. My difficulty is that I do not know the syntax to use in this JSP page.
Any help will be greatly appreciated.
sabeer
Hi,
You can try like below Attached Example :
(use the code inside < jsp :scriptlet> < /jsp :scriptlet>)
Cheers
Sabeer