[SOLVED] Switch x displays with script instead of ctrl-alt fx
Hi, I am looking for a way to switch x displays on a computer without using the keyboard. Is this possible with a bash script of some sort?
EDIT: I found chvt but that only works from a tty, running sh chvt X doesn't work from a terminal emulator.
EDIT2: SOLVED: read this http://superuser.com/questions/69807/wh … ot-under-x
Last edited by RiceKills (2010-10-30 18:27:56)
chvt command maybe what you need.
Similar Messages
-
[SOLVED]Switching Caps Lock with Shift_L
I have a broken left shift key, and it's a bit of a pain to type with. I often use an external keyboard, so this doesn't always bother me, but when I take my laptop with me somewhere, I would like to be able to quickly swap Caps and Left Shift. For a while, I've done that like this:
xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L"
But xmodmap is deprecated, and causing problems with qt5 applications, so I want to ditch it and do the same thing with setxbmap instead. Now, xkb is really nice, it is full of built in options for common remaps, and a quick look around shows my I can use any one of these to change how caps lock works:
grp:caps_switch Caps Lock (while pressed), Alt+Caps Lock does the original capslock action
grp:caps_toggle Caps Lock
grp:shift_caps_toggle Shift+Caps Lock
grp:shift_caps_switch Caps Lock (to first layout), Shift+Caps Lock (to last layout)
grp:alt_caps_toggle Alt+Caps Lock
lv3:caps_switch Caps Lock
lv3:caps_switch_latch Caps Lock chooses 3rd level, acts as onetime lock when pressed together with another 3rd-level-chooser
ctrl:nocaps Caps Lock as Ctrl
ctrl:swapcaps Swap Ctrl and Caps Lock
grp_led:caps Caps Lock
caps Caps Lock key behavior
caps:internal Caps Lock uses internal capitalization. Shift "pauses" Caps Lock
caps:internal_nocancel Caps Lock uses internal capitalization. Shift doesn't affect Caps Lock
caps:shift Caps Lock acts as Shift with locking. Shift "pauses" Caps Lock
caps:shift_nocancel Caps Lock acts as Shift with locking. Shift doesn't affect Caps Lock
caps:capslock Caps Lock toggles normal capitalization of alphabetic characters
caps:numlock Make Caps Lock an additional Num Lock
caps:swapescape Swap ESC and Caps Lock
caps:escape Make Caps Lock an additional ESC
caps:backspace Make Caps Lock an additional Backspace
caps:super Make Caps Lock an additional Super
caps:hyper Make Caps Lock an additional Hyper
caps:shiftlock Caps Lock toggles Shift so all keys are affected
caps:none Caps Lock is disabled
caps:ctrl_modifier Make Caps Lock an additional Control but keep the Caps_Lock keysym
compose:caps Caps Lock
compose:caps-altgr 3rd level of Caps Lock
shift:breaks_caps Shift cancels Caps Lock
shift:both_capslock Both Shift-Keys together toggle Caps Lock
shift:both_capslock_cancel Both Shift-Keys together activate Caps Lock, one Shift-Key deactivates
None of those allow me to use caps lock as a normal shift. I'm trying to figure out how to rebind caps to work as a shift, but I want to have this in a script so that my external keyboard will stick with its default behavior, and I can just type "fixshift" when I unplug it. Basically, just manually switch the two with setxkbmap the way I did with xmodmap. Out of a long while searching, and /only/ finding advice to use one of the default options, and none on making my own, I've decided to come here.
Any help, Arch-friends?
Last edited by Kebertx (2013-10-31 09:10:14)For the record, here's my solution:
This creates a custom key symbol to swap Caps and Shift:
/usr/share/X11/xkb/symbols/custom
partial modifier_keys
xkb_symbols "swapcaps" {
replace key <CAPS> { [ Shift_L ] };
replace key <LFSH> { [ Caps_Lock ] };
This script prints a description of the keymap, adds the symbol to swap the two keys from that other file to the right line, and writes the new description to a temporary file... then compiles it!
/usr/local/bin/fixshift
#!/usr/bin/bash
setxkbmap -print | sed '/xkb_symbols/ { s/"/+custom(swapcaps)"/2 }' > /tmp/fixshift
xkbcomp /tmp/fixshift $DISPLAY > /dev/null 2>&1 &
Then I just set that program to run every time lightdm starts a session:
/etc/lightdm/lightdm.conf
display-setup-script=/usr/local/bin/fixshift
greeter-setup-script=/usr/local/bin/fixshift
session-setup-script=/usr/local/bin/fixshift
And nothing more to it. Life is grand again. -
Need my custom webauth page displayed with HTTP instead of HTTPS
I have a custom webauth page installed that I am using with web passthrough authentication on my WLC2006 in order to put up a acceptable use policy page.
The WLC uses HTTPS to display this which causes a security certificate warning to appear if I go with the WLC's own self-signed certificate. Is there a way I can get the WLC to use plain HTTP to display this page instead so I can eliminate the warning?
I have already tried installing a trusted 3rd party certificate on the WLC, but I have this very strange problem where mucking with the WLC's web authentication certificate in any manner causes all network activity on the WLC to break except for CDP and ARP, essentially leaving the WLC dead. Three weeks of troubleshooting with Cisco TAC has yielded no progress on that front so now I am trying to bypass the need for a security certificate altogether since I really don't need to encrypt my acceptable use policy page.The documentation doesn't provide very clear direction, does it?
To download the WLC's default webauth page, browse to the controller's Security > Web Login Page. Make sure the web authentication type is Internal (Default). Hit the Preview button. Then use your browser's File > Save As... menu item to save the HTML into a file. Edit this to your liking and bundle it and any graphics images up into a TAR archive, then upload via the controller's COMMAND page. -
Opening port in Firewall with Script instead of ServerAdmin?
Hi,
I tried to google this but didn't find good leads. What is the way to open ports in the OS X Server 10.5 Software Firewall by using a shellscript instead of the GUI ServerAdmin tool?
thanks a lot
simonAt the most basic level:
#!/bin/bash
HOST_IP = "123.123.123.123"
/sbin/ipfw -f add 30000 allow tcp from $HOST_IP to any dst-port 20-21
This would add a single rule, assigned to rule number 30000. It opens ports 20 and 21 for the specified IP. After installing this rule via script there are various things that will cause your firewall to be flushed and the rule will be lost. For example, just poking around in ServerAdmin can cause an unintentional flush and reloading of the firewall rules - you'll need a way to run your script again when it happens.
Check the man page and google for info on ipfw.
David
Message was edited by: DavidWil -
Switching displays with broken iMac display
I have no display on the iMac. I want to back up the hard drive before it is sent for repair. So I need to use external display to do so.
Using mini DVI to VGA adapter to connect iMac to Sony Bravia 40", but the TV will not pick up the signal (Probably due to incompatible resolution settings??).
Is there a way to switch the display settings without using monitor display to see what I'm doing?
Maybe I could do it with speakable commands which luckily is enabled on the computer!?
I was able to open system preferences and then display preferences (I think).
I've searched high and low now for an answer, but have come up with nothing.I have no display on the iMac. I want to back up the hard drive before it is sent for repair. So I need to use external display to do so.
Using mini DVI to VGA adapter to connect iMac to Sony Bravia 40", but the TV will not pick up the signal (Probably due to incompatible resolution settings??).
Is there a way to switch the display settings without using monitor display to see what I'm doing?
Maybe I could do it with speakable commands which luckily is enabled on the computer!?
I was able to open system preferences and then display preferences (I think).
I've searched high and low now for an answer, but have come up with nothing. -
One of my pages loads as a script instead of the site but works fine with IE
One of my pages loads fine with IE but does not with Mozilla. Shows a bunch of characters and with no errors.
Something has gone seriously wrong when to code of that page got saved (the "<" characters).<br />
It looks like some mixture of UTF-16 code, but Firefox (and Google Chrome) can't make sense of it and display the text instead.
You will have to save that page as Unicode UTF-8 and upload the correct code to the server. -
Currency field to be displayed with commas and asterisks(formatting)
I have a field REGUH-RWBTR in my sap script code. I need to have the currency displayed with commas. And also if the digits are less, then left pad it with asterisks for remaining spaces.
For eg, If the Digit is 12345678912.23 (max value), it should print as 12345,678,912.23.
And If the digit is 12345.89, it should print as ******12,345.89
Please help me to solve this problem.Its urgent.
Thanks,
Sandeep.Hello,
You can use the WRITE using EDIT MASK.
USING { {NO EDIT MASK}|{EDIT MASK mask} }
Effect
This addition overrides a conversion routine defined through reference to the ABAP Dictionary. The addition NO EDIT MASK only switches off the execution of an assigned conversion routine. The addition EDIT MASK calls either another conversion routine or defines an edit mask. For mask, a data object of the same name is expected.
In order to call an arbitrary conversion routine CONV, mask must contain two equals signs, followed directly by the name of the conversion routine: "==CONV". During output, the content of dobj is passed to the function module CONVERSION_EXIT_CONV_OUTPUT, converted there, and then the result is displayed. If the function module is not found, an exception that can be handled is triggered (as of Release 6.10). The statement DESCRIBE FIELD contains an addition in order to fill mask accordingly.
If the output length is specified explicitly with len, the conversion routine is executed for the specified length; otherwise for the implicit output length. If * or ** is specified for the output length, the appropriate rules are used for the converted result.
If the first two characters in mask are not equals signs, the content is interpreted as an edit mask in which some characters have a particular meaning. The WRITE statement does not then output the content of dobj directly, but the character string in mask as follows:
If the first two characters in mask are "LL" or "RR ", these are not output, They control whether the edit mask is left-justified or right-justified. If the first two characters are other characters, the edit mask is left-justified.
All "_" characters are replaced from the left (in the case of "LL") or from the right (in the case of "RR") with characters for character-type types or numbers for the types p or i from dobj. In the case of fields of type c, closing blanks are ignored. Data objects of type f or x are converted into type c before editing. Superfluous characters "_" in mask are replaced by blanks. Characters from dobj for which there are no characters "_" in mask are not displayed.
If dobj is of type i or p, the first character from the left "V" in mask is replaced with "-" in the case of a negative number and by blank in the case of a positive number.
All the other characters of the edit mask are displayed unchanged.
If no output length is specified, the implicit output length of dobj is used. If len is specified for the output length, the value of len is used. If * is specified for the output length, exactly that length that is required for the list display is set. If, in Unicode systems, characters of the edit mask are replaced by characters that take up more than one column on the list, the output length is increased accordingly and the output is filled with blanks in the list buffer. If ** is specified for the output length, double the length of the edit mask mask is used.
If other formatting options are specified concurrently for an edit mask, these are used first and then the special characters in the edit mask are replaced by the interim result. The date masks date_mask are an exception to this. If these are specified, the edit mask is ignored.
Notes
In Unicode systems, you must remember that a character "_"in the edit mask does not necessarily correspond to a column in the list display since the space required in the display depends on the character to be replaced.
The minus sign for a negative number is not displayed if no edit character "V" is specified. The decimal separator of a packed number with decimal places must be specified at the required position in the edit mask.
Example
Edited output of time duration. In the first output, the function module CONVERSION_EXIT_DURA_OUTPUT is executed. This converts the duration specified in seconds into minutes. In the second output, the edit mask is output according to the above rules. However, the underscore characters "_" are replaced by the characters from time.
DATA: dura TYPE i,
time TYPE t VALUE '080000'.
dura = sy-uzeit - time.
time = dura.
WRITE /(30) dura USING EDIT MASK '==SDURA'.
WRITE /(30) time USING EDIT MASK
'RRThe duration is __:__:__'.
Regards, -
External display with MacBook Pro in Lion
Hello,
Yesterday I bought a Mac OS X Lion, and I found one annoying feature of the system - working on a MacBook Pro (MBP), and very often use an external display, with that do not use display in the MBP. When connecting an external monitor doing video processing,and this activity I was used by Mac OS X Snow Leopard to open the MBP there wasaccess of air to cool the computer. After installing the Lion was the fact that even at very small opening MBP is switched to internal MBP display. This is the functionality of the Lion off somewhere or somehow set? I looked in Preferences, and I have found nothing. Thank you in advance for information on how to solve this problem.I own a mac mini that stays connected to the 52" LCD 120hz in my living room. The image is perfect, and fits just fine. I did a mini-display port to dvi and got a monster cable adapter for dvi to hdmi which too it to my tv. I did have to go into the tv and set the tv to overscan I think on the image to make it fit and you will have to adjust the resolution on the computer. I can say the colors are darker on the tv and this is just due to the nature of the screen size. Newer LED tvs may be better, but mine is only 1 1/2 years old.
For an external display, just go to the educators link, select your college and you get $100 off. My wife is an educator and I am back in college so it's no hassle. Or they just ask for an ID. I own 2 24" ACD and they are nice. I do photography and a screen calibration is a must. Once done you'll be happy. And docking with the laptop is handy. -
Cannot switch to tty with CTRL+ALT+F?
Hi everybody,
I'm sitting in front of a fresh archlinux installation with kdemod installed. I notice that I can't switch to the terminals with CTRL+ALT+F?. I always used this kind of switching without configuring anything, so what could have gone wrong?
Thanks for any suggestions...
EDIT: by accident I wrote the german "STRG" instead of "CTRL"
Last edited by Kei (2007-07-09 16:40:00)i've got the same problem here
I can kill sessions via CTRL+ALT+BKSP and navigate from vt1 to vt2 etc.., but not from X to any other terminals!
Global shortcuts don't seem to work either, might be a related problem!?
Output from xev for CTRL, ALT, F1
KeyRelease event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1772087, (-158,305), root:(878,360),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1774643, (-158,305), root:(878,360),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1774702, (-158,305), root:(878,360),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1776252, (-158,305), root:(878,360),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1776307, (-158,305), root:(878,360),
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1776962, (-158,305), root:(878,360),
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 31, synthetic NO, window 0x2c00001,
root 0x4c, subw 0x0, time 1777014, (-158,305), root:(878,360),
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
and my xorg.conf
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
RgbPath "/usr/share/X11/rgb"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc"
FontPath "/usr/share/fonts/100dpi:unscaled"
FontPath "/usr/share/fonts/75dpi:unscaled"
FontPath "/usr/share/fonts/TTF"
FontPath "/usr/share/fonts/Type1"
EndSection
Section "Module"
Load "extmod"
Load "dri"
Load "dbe"
Load "record"
Load "xtrap"
Load "freetype"
Load "type1"
Load "glx"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc105"
Option "XkbLayout" "uk"
Option "XkbOptions" "grp:ctrl_shift_toggle"
Option "XkbVariant" "nodeadkeys"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
#DisplaySize 330 210 # mm
Identifier "Monitor0"
VendorName "SHP"
ModelName "139f"
EndSection
Section "Device"
Identifier "Card0"
Driver "radeon"
Option "AGPMode" "8"
Option "EnablePageFlip" "1"
Option "ColorTiling" "1"
Option "UseFastTLS" "2"
VendorName "ATI Technologies Inc"
BoardName "Radeon R250 [Mobility FireGL 9000]"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
Section "DRI"
Mode 0666
EndSection
Section "ServerFlags"
Option "DontVTSwitch" "False"
Option "DontZap" "False"
EndSection -
Write Progress through Whole Script (instead of Timer or through per function)
Hello Team,
Is it possible to use the write-progress to begin a the top of a script and run through each function of the script (instead of a timer or per function) and at the end of the script complete?
For example, here I use a timer:
for ($i =1;$i = le 100; $i++)
function sWriteLogInformation
out-file
-FilePath $strLog
-Input Object
-Append: $true
-Confirm:$false
-encoding "Unicode"
Write-Host -Object $strText
Get-Process $ProcessName -ErrorAction SilentlyContinue
If (-not $?)
strText = "Application is not running."
Write-Host $strText
Else
Stop-Process -processname $processName
write-Host "Application Closed"
Write Progress -Activity "Please wait..$strText" -status "$i% Complete" -percentComplete $i;
start-sleep milliseconds 50
But I would rather it go through each of the steps/function in the script and close when finished.
Any input appreciated.
Thanks!Two suggestions:
Move the function outside of the for loop, there's no reason to define the same function 100 times. It may not be a problem with this script, but with a large data set it will affect performance. And it's just plain bad practice.
Move the Write-Progress command to follow the initial for statement so it is displayed immediately instead of after processing the first item.
As jrv suggested, you can have multiple write-progress statements that provide more information for each step, perhaps like this:
function sWriteLogInformation ($strText) {
out-file
-FilePath $strLog
-Input $strText
-Append: $true
-Confirm:$false
-encoding "Unicode"
Write-Host -Object $strText
for ($i =1;$i = le 100; $i++) {
Write Progress -Activity "Please wait.." -status "Checking $ProcessName" -percentComplete $i
If (Get-Process $ProcessName -ErrorAction SilentlyContinue) {
Write Progress -Activity "Please wait.." -status "Stopping $ProcessName" -percentComplete $i
Stop-Process -processname $processName
sWriteLogInformation "$processName stopped at $(get-date)"
} Else {
sWriteLogInformation "$processName not running."
Write Progress -Activity "Please wait.." -status "Inserting artificial delay" -percentComplete $i
start-sleep milliseconds 50
Not sure where $ProcessName or $strLog are being defined. I modified your script to clean it up a bit and remove some unnecessary code.
I hope this post has helped! -
Revision: 19333
Revision: 19333
Author: [email protected]
Date: 2010-12-13 13:31:42 -0800 (Mon, 13 Dec 2010)
Log Message:
Rewrite these two tests with MXUnitManager instead of using tags.
Modified Paths:
blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/remotingService/dataTypes/amf/in heritPropsTest.mxml
blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/remotingService/dataTypes/http/i nheritPropsTest.mxmlHi Stephan,
this solved placing both animation on one page. Make sure all your fonts are called out in the <head> section like for example:
<script>var __adobewebfontsappname__="dreamweaver"</script>
<script src="http://use.edgefonts.net/quicksand:n3,n4:default.js" type="text/javascript"></script>
Dreamweaver does this automatic for you. If you are having a font conflict I recommend under command (if you are using dreamweaver)
Clean up the font Tag and add only the ones that you are using again, sometimes they accumulate.
Good Luck. -
[solved] Dvd Drive detection in script - how?????
As the header says. Is there an easy way to detect if an unmounted disc is in my dvd drive, from within a bash script?
Last edited by orphius1970 (2010-06-28 20:11:29)Brisbin,
The first one is what I need. How would I work that into conky? I want to have a message display when a disc is on
drive or if not. Something like:
Disc
NoDisc
I know I can use the if_mounted option in conky. I really want to know if there is disk in drive, even when not mounted
First one seems to not work
NEW!
I just discovered that when a cd or dvd is inserted. Folder "/dev/dvd/by-label" is created and removed when disk is ejected.
So I have the following script.
#!/bin/bash
directory="/dev/dvd/by-label"
# bash check if directory exists
if [ -d $directory ]; then
echo "Directory Exists"
else
echo "Directory does not exists"
fi
How would I alter this to work inside conky?
SOLVED IT!!
Changed script to:
#!/bin/bash
directory="/dev/dvd/by-label"
# bash check if directory exists
if [ -d $directory ]; then
echo "+ Dvd +"
else
echo "- Dvd -"
fi
+ = disc in drive
- = disc not in drive
Added it to conky with ${exec script}
Last edited by orphius1970 (2010-06-28 20:11:01) -
Display with #/ data in reporting
Hi experts,
One of the field in Quivery Displaying with #/ infant of the value,
the Actual date :INVIJAY
But it displays :#/INVIJAY (wrong display)
I have checked the hole data flow right from source, RSA3-PSA-InfoObject-Infoset.
the hole flow is being displyed in rightway like INVIJAY.
In RSRT also it displayed wrong like #/INVIJAY
1. what is the solution for this issue, what I have to do to get like INVIJAY.
2. when data is not available it displays #, I want empty instead of #
I am in BI 7.0 environment. in object Properties also everything ok.
Regards
VijayVijay,
Your infoobject is compounded with any other infoobject and compounded infoobject is blank.
There are 2 things to do.
First, load the compounded infoobject so that you will get correct value like XX/VIJAY
Secondly, if you do not want to see the value of compounding infoobject 'XX' then insert this compounded infoobject just above the main infoobject in query designer and hide it.
Let me know if this is not clear to you.
Thanks,
Harry -
Using 2005 30" Cinema display with new mac pro
I will order a new MacPro to replace my Mac Pro 1.1 immediately upon release. I also have a 30" Cinema Display version 2005. It's interface with the existing Mac Pro is three cable hookup: DVI, USB and Firewire 400. By connecting the Cinema display using a bunch of adaptors, can I make the display work with the new MacPro until a good 4K display is out there? Alternatively, I'll have to buy a new display from current technology or the few 4k's available today.
Thanks for your help.yes, use a Mini DisplayPort to Dual-Link DVI adapter plugged into the ThunderBolt port. The HDMI port has limited resolutions, not including 1560 by 1600 best for 30" cinema display.
Graphics and Video Support
Intel Iris Pro Graphics
NVIDIA GeForce GT 750M with 2GB of GDDR5 memory and automatic graphics switching
Dual display and video mirroring: Simultaneously supports full native resolution on the built-in display and up to 2560 by 1600 pixels on up to two external displays, both at millions of colors
Thunderbolt digital video output
Native Mini DisplayPort output
DVI output using Mini DisplayPort to DVI Adapter (sold separately)
VGA output using Mini DisplayPort to VGA Adapter (sold separately)
Dual-link DVI output using Mini DisplayPort to Dual-Link DVI Adapter (sold separately)
HDMI video output
Support for 1080p resolution at up to 60Hz
Support for 3840-by-2160 resolution at 30Hz
Support for 4096-by-2160 resolution at 24Hz -
How can I display an icon, instead of text string, as a validation prompt?
My validate method inside my custom validator is like this:
public void validate(FacesContext context, UIComponent component, Object value) {
Pattern datePattern = Pattern.compile("(\\d{2})/(\\d{2})/(\\d{4})");
Matcher dateMatcher = datePattern.matcher((String)value);
if(!dateMatcher.find()){
((UIInput)component).setValid(false);
FacesMessage message = new FacesMessage();
String msg = "[" + value + "] invalid date";
message.setDetail(msg);
context.addMessage(component.getClientId(context), message);
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_FATAL, "xx", "msg");
throw new ValidatorException(facesMsg);
}My JSP has this:
<h:inputText id="test" value="#{projecthandler.test}">
<f:validator validatorId="DateValidator" />
</h:inputText>
<h:message id="testErrorMessage" for="test"/>The <h:message> tag will kick in if the user has invalid data in the <h:inputText> field and clicks submit.
When the page is regenerated, the user will see a text string reflecting what the issue is.
However, instead of this, I would like to display an icon consisting of a red circle with an exclamation point.
The user is supposed to click on the icon if they want more information. By clicking on the icon,
the user will see a message box, with a description of the error.
This is our standard for applications. I'm trying to put together a demo showing how an existing application
would work in JSF, so I won't be able to talk others into using JSF, unless I can get the validation to display an
icon instead of text.
Edited by: Kazan on Mar 18, 2009 9:31 AM
Edited by: Kazan on Mar 18, 2009 9:33 AM
Edited by: Kazan on Mar 18, 2009 9:36 AMOK, I noticed a bug in my validate method. This is updated to fix the bug, and to include the recomendation about background-image:
public void validate(FacesContext context, UIComponent component, Object value) {
System.out.println("DateValidator.test.1");
Pattern datePattern = Pattern.compile("(\\d{2})/(\\d{2})/(\\d{4})");
Matcher dateMatcher = datePattern.matcher((String)value);
System.out.println("DateValidator.test.1");
if(!dateMatcher.find()){
((UIInput)component).setValid(false);
FacesMessage message = new FacesMessage();
String msg = "<span style='background-image: url(/error.gif)'/>";
message.setDetail(msg);
message.setSeverity(FacesMessage.SEVERITY_FATAL);
context.addMessage(component.getClientId(context), message);
throw new ValidatorException(message);
}When I run this, the litteral string of "<span style='background-image: url(/error.gif)'/>" is printed as the message. It does not interpret this as a span tag with an image url.
Can someone tell me what's going on?
Maybe you are looking for
-
I just updated to iOS 8 on my iPad 2 and due to a unforeseen error on iTunes I had to do factory reset. I was using my friend's iMac iTunes to download and update, instead of OTA. Now I'm unable to see my previously purchased apps (some even disconti
-
Is it possible to delete extended properties without knowing the id?
Hello, Can you delete any custom extended properties without knowing their ID? I took over managing a feature that used EWS to send emails to customers.The current code creates a new GUID, and thus new Extended Property, every time an email is sent.
-
Error while settlement of Internal order
Dear All I am getting the following error while executing KO88 "Choose transaction type and base value appropriate for asset values". The settlement and posting period are 12 and the processing type is "Partial Capitalization". Pls advice Rgds Nitika
-
Photoshop CC print quality inferior to CS5, why?
Why is it when I print an identical file in Photoshop CC 2014 and CS5, that the CS5 one matches the monitor, but CC2014 is different, no matter what print setting I try with it? It looks like CC 2014 is trying to guess what I would want for my colors
-
My Macbook Pro i7 dual core had a hard freeze halfway through my DJ set. At that moment, I had 'mixedinkey' opened on another page but it was not processing any files. The Traktor interface just froze for about 1-2 minutes with the usual rainbow ball