Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

618 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