Steve Dyke

Ranch Hand
+ Follow
since Nov 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Steve Dyke

Carey Brown wrote:Steve, I think it would help if you could provide a number of examples, showing the input String and the expected output String. I feel that people are not jumping in to respond because the requirements are a bit vague.



Just a little background:
I write ZPL(Zebra Printer Language) strings to generate labels.
Example: ^FO90,180^A@N,20,20,E:TAHOMA.TTF^FD<partnoL>^FS^FO90,180^A@N,20,20,E:TAHOMA.TTF^FD<partnoC>^FS^FO90,180^A@N,20,20,E:TAHOMA.TTF^FD<partnoR>^FS
This is a string in my template.
Then I loop thru the template replacing the <> words with DB ResultSet field values.
I send this string directly to the IP address of the printer.

In this case my label(template) is three labels arranged in a horizontal row(these are aircraft seat row markers).

Part#:<partnoL>         Part#:<partnoC>         Part# :<partnoR>
SN#:<serialnoL>         SN#:<serialnoC>         SN#:<serialnoR>
<rowL>                         <rowC>                        <rowL>

This particular aircraft does not use a center seat assembly so the center label will not have any data so the replacement does not occur.
I would like to remove any of my taged<> words contained in the resulting string created by the loop with an empty string.

Input String:
Part#:<partnoL>             Part#:<partnoC>         Part# :<partnoR>
Serial#:<serialnoL>        SN#:<serialnoC>         SN#:<serialnoR>
<rowL>                            <rowC>                        <rowL>


Output String:
Part#: 881122        Part#:          Part#: 881123
Serial#: 123            Serial#:       Serial#: 124
L-1                                               R-1
3 weeks ago
Example my string is:
String v1 = "My <Name> is Steve. What is your <Name>?"

I would like to remove any words in v1 that begins with "<" and replace with "".
4 weeks ago
I would like to display a message before the AJAX call starts.
In the following code the message appears after the callback in complete.

I am building a select list in an AJAX callback.
Once the list is returned I apply select2.
There is a class set to the option that sets the background color based on a filed value when the select string is build on the server.
Before the select2 is applied the lists shows the options that should be yellow as expected.
However, once the select2 is applied the background color never changes even though when I inspect the html the class is set to yellowBG.

This is part of my AJAX callback:



The first is the html select list. the second is the html with select2 applied.
The html select displays the second option with yellow background as expected.
The select2 list shows all three option with no yellow background color on the second option.

Bear Bibeault wrote:
I think what you want (and this is from memory so details may vary) is to call the element's focus method. So something along the lines of:



Bear,
You are a genius.

Bear Bibeault wrote:A disabled control cannot accept focus.



Yes, I understand that. But in my code I set disabled to false before I try to set focus.

Tim Holloway wrote:


2. Use the "jquery" method  in place of "$", which is just a shortcut for it anyway, Best used when only a small amount of JavaScript is embedded on a page template (which is also preferred)



Suggested change made no difference.



Again, the focus works as expected until I run this piece of code.

If I run the first code the second code fails to set focus even after I set the disabled property to false.



I would like to have the image line up with the input vertically and the left edge of the image touch the right side of the input.
Would like it to appear as one element.
When I try and apply a margin or padding setting on the image it affects the parent container.
 
I have a container with an element populated with a select list using ajax.
I then convert it to a select2 jquery element.

After my client process runs I want to remove the select2 dropdown list from displaying.
However, none of my efforts will remove it.

My ajax:


My effort to remove the select2 dropdown.

If I type in a value and press the enter key the focus will move to the next input element.
I would like to prevent both events from firing, only keyUp.
If I type in a value and click to another input element I only need the blur to fire.

What I have here both events will fire.

Ron McLeod wrote:
overrideValue.trim().isEmpty()



I will give this a try. Thanks.
5 months ago

Ron McLeod wrote:On the client side, couldn't you just use the JS trim() method?



This does not prevent spaces either:

5 months ago
Sorry, I am using Java 8
5 months ago