Solved

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

Posted on 2014-04-12
16
172 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
16 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
Industry Leaders: 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 500 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

740 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