Solved

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

Posted on 2014-04-12
16
174 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
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

696 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