?
Solved

How can I configure my results table to view all the characters in a shortened field?

Posted on 2014-04-12
16
Medium Priority
?
177 Views
Last Modified: 2014-08-05
I have a field called Part Description which contains long descriptions, therefore I shortened the field with this code:
#Left(partdescription,20)#

How can I have the whole description pop up or other method using ColdFusion or other technologies?
0
Comment
Question by:DJPr0
  • 7
  • 7
15 Comments
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39996594
You can try like this

<cfoutput>
<cfif partdescription GT 20>
#Left(partdescription,20)#..&nbsp; <a href="javascript:void(0);" onclick="Window.Open('page.cfm?id=#id#&description=#partdescription#');
<cfelse>
#partdescription#&nbsp; <a href="javascript:void(0);" onclick="Window.Open('page.cfm?id=#id#&description=#partdescription#');
</cfif>
</cfoutput>

Open in new window


and your page.cfm will be like this:

<cfif isdefined('url.id') and isdefined('url.description')>
<cfdump var="#url#">
</cfif>

Open in new window


You can omit description in the url and run the query within the popup to get the description from the database again, choice is all yours. let me know if something else you need to know

Thanks
0
 

Author Comment

by:DJPr0
ID: 39996823
Not sure what I'm doing wrong.

Error received:
 You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.
 

812 :         
813 :        <cfif partdescription GT 20>
814 :       <td class="rdata"> #Left(partdescription,20)#..&nbsp; <a href="javascript:void(0);" onclick="Window.Open('page.cfm?id=#key.id#&description=#partdescription#');</td>
815 :        <cfelse>
816 :        <td class="rdata"> #partdescription#&nbsp; <a href="javascript:void(0);" onclick="Window.Open('page.cfm?id=#key.id#&description=#partdescription#');</td>
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39996967
Is this inside the cfoutput with the query attribute and try putting the partdescription like queryname.partdescription,

where is the closing </cfif> tag.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 40043605
Have you tried it. Let me know If you are facing any issue
0
 

Author Comment

by:DJPr0
ID: 40050137
Sorry for the delay, will get back to you soon.
0
 

Author Comment

by:DJPr0
ID: 40119433
New error received:
File not found: /msr/onclick="Window.Open("page.cfm

Code:
<td class="rdata">#Left(partdescription,20)#..&nbsp; <a href= onclick="Window.Open("page.cfm?id=#keyid#&description=#partdescription#");>Descrip</a></td>

When I utilize the Java void statement:
"javascript:void(0);"
The click does not perform any action.
Code:
<td class="rdata">#Left(partdescription,20)#..&nbsp; <a href="javascript:void(0);" onclick="Window.Open("page.cfm?id=#keyid#&description=#partdescription#");>Descrip</a></td>
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 40119528
Error is Clear that it is unable to find the page.cfm file.

Can you please check the firebug what error you receive when you click the link

regards
0
 

Author Comment

by:DJPr0
ID: 40119822
I don't see any error in firebug.

It looks like my link code is incorrect, the page.cfm is in the msr directory.

Please take another look at my link code:
<td class="rdata">#Left(partdescription,20)#..&nbsp; <a href= onclick="Window.Open("page.cfm?id=#keyid#&description=#partdescription#");>Descrip</a></td>
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 40120078
This is the corrected code:
<a href="javascript:void(0);" onclick="window.open('page.cfm?id=#keyid#&description=#partdescription#');">Descrip</a>

Open in new window


1. Provide Javascript:void(0);
2. Window.Open will always be windo.open in small caps as javascript is case sensitive
3. You were missing the closing double quotes inside the function.

as you said the page.cfm is in msr directory, then you can do this too

<a href="javascript:void(0);" onclick="window.open('msr/page.cfm?id=#keyid#&description=#partdescription#');">Descrip</a>

Open in new window

0
 

Author Comment

by:DJPr0
ID: 40134033
This is working partially - very few records in my list results will work, the other records do not do anything when clicked.

These data descriptions will work:
HOLDER, MOPS, TOOL HOLDER SPRING CLIP
HANGER, FOR HONEYCOMB BHD, SINGLE
DRAIN, BATTERY INSTALLATION CONTINUOUS LAVATORY WASTE ASSEMBLY, 17 GAUGE

These data descriptions will not work:
HOOK, SNAP, PRIVACY CURTAIN, W/NYLON WHEELS, 3-1/4" LONG
WASHER, FLAT, 3/16" 0.197" ID X 1/2" OD X 1/16" THICK      

I think the problem is the quote character "

Is the problem due to we are using <cfdump var="#url#"> in the page.cfm?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40227576
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
0
 

Author Comment

by:DJPr0
ID: 40227360
How about getting more eyes on this question?
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 40227577
You can try using the urlencodedformat with the partdescription or jsstringformat function to the link:

Let me try it one way and i will update on this.

I am objecting to this question as it is half solved and half left:
0
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 2000 total points
ID: 40227607
here is my try:

<cfset descrip = 'WASHER, FLAT, 3/16" 0.197" ID X 1/2" OD X 1/16" THICK'>
	<cfset des = 'HOOK, SNAP, PRIVACY CURTAIN, W/NYLON WHEELS, 3-1/4" LONG'>
	<cfoutput>
	<a href="javascript:void(0);" onclick="window.open('12.cfm?id=1&description=#urlEncodedFormat(des)#');">Descrip</a>	
	</cfoutput>

Open in new window


results

see attached
Untitled.gif
0
 

Author Closing Comment

by:DJPr0
ID: 40241191
Adding #urlEncodedFormat(partdescription)#' fixed the issue. Thanks for sticking with the question myselfrandhawa!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question