On selectonemenu change uncheck checkbox - JSF/RichFaces

I have to uncheck a selectBooleanCheckbox lower down in the form IF it
is checked.

So I added the showOnWebAjx id to the reRender shown below.

<h:selectOneMenu id="estatus" value="#{itemHome.instance.estatus}"
    required="true">
    <f:selectItems id="estatuses"
        value="#{mconsoleContext.ecometryItemStatusCodes}" />
    <a:support event="onchange"
        reRender="showOnWebAjx, ecycleWeeksAjx, orderSizeFoodPoAjx,
upcAjx, kitAjx, preOrderAjx, priorityProcessingAjx"
 
actionListener="#{itemHome.resetPreOrderAndPriorityProcessingFlag}"
        ajaxSingle="true" />
</h:selectOneMenu>


I don't know how to uncheck the box but with the below code I can tell
when it is C1 or H1 (2 of the values where we want to uncheck the box,
the rest of the time we do nothing)

<s:decorate id="showOnWebFlagDecoration"
    template="/layout/edit.xhtml">
    <ui:define name="label">#{messages.showOnWebFlag}</ui:define>

<a:outputPanel id="showOnWebAjx">

<c:if test="#{'C1' eq itemHome.instance.estatus || 'H1' eq
itemHome.instance.estatus}">UNCHECK showOnWebFlag!!</c:if>

    <h:selectBooleanCheckbox id="showOnWebFlag"
        value="#{itemHome.instance.showOnWebFlag}"/>

</a:outputPanel>

</s:decorate>



The a:outputPanel and c:if test are my additions.

What is the proper / correct way to uncheck that box using JSF and/or
RichFaces?
0
Danjojo
9/7/2010 1:19:32 PM
comp.lang.java.programmer 52298 articles. 0 followers. Post Follow

2 Replies
901 Views

Similar Articles

[PageSpeed] 6
On Sep 7, 9:19=A0am, Danjojo <dlcac...@gmail.com> wrote:
> I have to uncheck a selectBooleanCheckbox lower down in the form IF it
> is checked.
>
> So I added the showOnWebAjx id to the reRender shown below.
>
> <h:selectOneMenu id=3D"estatus" value=3D"#{itemHome.instance.estatus}"
> =A0 =A0 required=3D"true">
> =A0 =A0 <f:selectItems id=3D"estatuses"
> =A0 =A0 =A0 =A0 value=3D"#{mconsoleContext.ecometryItemStatusCodes}" />
> =A0 =A0 <a:support event=3D"onchange"
> =A0 =A0 =A0 =A0 reRender=3D"showOnWebAjx, ecycleWeeksAjx, orderSizeFoodPo=
Ajx,
> upcAjx, kitAjx, preOrderAjx, priorityProcessingAjx"
>
> actionListener=3D"#{itemHome.resetPreOrderAndPriorityProcessingFlag}"
> =A0 =A0 =A0 =A0 ajaxSingle=3D"true" />
> </h:selectOneMenu>
>
> I don't know how to uncheck the box but with the below code I can tell
> when it is C1 or H1 (2 of the values where we want to uncheck the box,
> the rest of the time we do nothing)
>
> <s:decorate id=3D"showOnWebFlagDecoration"
> =A0 =A0 template=3D"/layout/edit.xhtml">
> =A0 =A0 <ui:define name=3D"label">#{messages.showOnWebFlag}</ui:define>
>
> <a:outputPanel id=3D"showOnWebAjx">
>
> <c:if test=3D"#{'C1' eq itemHome.instance.estatus || 'H1' eq
> itemHome.instance.estatus}">UNCHECK showOnWebFlag!!</c:if>
>
> =A0 =A0 <h:selectBooleanCheckbox id=3D"showOnWebFlag"
> =A0 =A0 =A0 =A0 value=3D"#{itemHome.instance.showOnWebFlag}"/>
>
> </a:outputPanel>
>
> </s:decorate>
>
> The a:outputPanel and c:if test are my additions.
>
> What is the proper / correct way to uncheck that box using JSF and/or
> RichFaces?

Set the corresponding backing bean property to 'false'.

--
Lew
0
lew (2468)
9/7/2010 2:26:46 PM
On Sep 7, 10:26=A0am, Lew <l...@lewscanon.com> wrote:
> On Sep 7, 9:19=A0am, Danjojo <dlcac...@gmail.com> wrote:
>
>
>
> > I have to uncheck a selectBooleanCheckbox lower down in the form IF it
> > is checked.
>
> > So I added the showOnWebAjx id to the reRender shown below.
>
> > <h:selectOneMenu id=3D"estatus" value=3D"#{itemHome.instance.estatus}"
> > =A0 =A0 required=3D"true">
> > =A0 =A0 <f:selectItems id=3D"estatuses"
> > =A0 =A0 =A0 =A0 value=3D"#{mconsoleContext.ecometryItemStatusCodes}" />
> > =A0 =A0 <a:support event=3D"onchange"
> > =A0 =A0 =A0 =A0 reRender=3D"showOnWebAjx, ecycleWeeksAjx, orderSizeFood=
PoAjx,
> > upcAjx, kitAjx, preOrderAjx, priorityProcessingAjx"
>
> > actionListener=3D"#{itemHome.resetPreOrderAndPriorityProcessingFlag}"
> > =A0 =A0 =A0 =A0 ajaxSingle=3D"true" />
> > </h:selectOneMenu>
>
> > I don't know how to uncheck the box but with the below code I can tell
> > when it is C1 or H1 (2 of the values where we want to uncheck the box,
> > the rest of the time we do nothing)
>
> > <s:decorate id=3D"showOnWebFlagDecoration"
> > =A0 =A0 template=3D"/layout/edit.xhtml">
> > =A0 =A0 <ui:define name=3D"label">#{messages.showOnWebFlag}</ui:define>
>
> > <a:outputPanel id=3D"showOnWebAjx">
>
> > <c:if test=3D"#{'C1' eq itemHome.instance.estatus || 'H1' eq
> > itemHome.instance.estatus}">UNCHECK showOnWebFlag!!</c:if>
>
> > =A0 =A0 <h:selectBooleanCheckbox id=3D"showOnWebFlag"
> > =A0 =A0 =A0 =A0 value=3D"#{itemHome.instance.showOnWebFlag}"/>
>
> > </a:outputPanel>
>
> > </s:decorate>
>
> > The a:outputPanel and c:if test are my additions.
>
> > What is the proper / correct way to uncheck that box using JSF and/or
> > RichFaces?
>
> Set the corresponding backing bean property to 'false'.
>
> --
> Lew

Like this?

	public void resetShowOnWebFlag(ActionEvent ae){
		String status =3D getInstance().getEstatus();
		if ("C1".equals(status)	|| "H1".equals(status)) {
			getInstance().setShowOnWebFlag(false);
		}
	}
0
dlcacuff (5)
9/7/2010 2:56:04 PM
Reply:
Similar Artilces:

Changing Print Options on Firefox
Does anyone know how to turn on the background printing of images, and eliminate the printed header and footer tags in Firefox on the Mac? You can do this in Firefox on Windows and in IE and in Netscape on Mac (largely through the "page setup" under File), but I can't find any browser controls for this in Firefox/Mac or Mozilla/Mac. Any help would be greatly appreciated! juxa <marty@juxtadigital.com> wrote: > Does anyone know how to turn on the background printing of images, and > eliminate the printed header and footer tags in Firefox on the Mac? You &g...

colors change
How do I keep the colors I see on my screen the same after I create my pdf. I'm working in illustrator and when I create my pdf, my colors are dull and lifeless. I'm guessing it's going from rgb to CMYK??? How can I make it not do that? Thansk Jeff solrpwr wrote: > How do I keep the colors I see on my screen the same after I create > my pdf. I'm working in illustrator and when I create my pdf, my > colors are dull and lifeless. I'm guessing it's going from rgb to > CMYK??? How can I make it not do that? > > Thansk > Jeff I'm assuming you'...

Cut/Past changes font.
With Pegasus 4.21b, June 15,2004, the font changes when I past text into a document, or cut text and past it back. It also changes when I re-paragraph with [ctrl]J. Advice will be appreciated, Stan Hilliard On Wed, 08 Sep 2004 17:18:21 -0500, Stan Hilliard <usenetreplyUM@samplingplansNOTSPAM.com> wrote: >With Pegasus 4.21b, June 15,2004, the font changes when I past text >into a document, or cut text and past it back. Right-click in the document to which you want to paste the text and choose "Paste Special". This will allow you to choose the tex...

Eudora 6 Changes Font in Browser
I use Microsoft Internet Explorer V6 browser and have the text size set to Larger. If I close down both the browser and Eudora 6 and then reopen the browser the text size gets changed to Smaller under the View menu and will only change the actual text size in the browser when I reboot the system. Has anyone noticed this problem? Is there a way to address this or might this be a "bug" in Eudora 6? ron Turn off the MS viewer or add the setting SeparateMSHTMLSettings=1 to the [settings] section of eudora.ini In article <0o5jmv82o5490ao0gc38l7of3jo8b65ir3@4ax...

Nortel Passport (7480)
Hi all, I would like to change the ospf reference bandwidth in my Nortel Passports to better take in consideration our Gbit links with a better cost than FE links. Instead of using 100,000,000 (100Mbps) I would like to use 100,000,000,000 (100Gbps). Does somebody know how to change this on the Passport ?? I only found the way to set manually the cost in a per-interface basis but this is something I'd like to avoid whenever possible. thank you in advance for your tips ! Fr=E9d=E9ric Martin ...

tablelist 4.11: some changes to -listvariable not handled when -disabled
tablelist 4.11, tcl 8.3.3 and 8.5.2 set foo {{11 12 13} {21 22 23} {31 32 33}} pack [tablelist::tablelist .t -columntitles {1 2 3} -listvariable foo -state disabled] Bug: table is empty (should have 3 rows). destroy .t pack [tablelist::tablelist .t -columntitles {1 2 3} -listvariable foo] Table has 3 rows now, ok. .t configure -state disabled set foo {{11 12 13} {21 22 23}} Table has 2 rows now, ok. set foo {{11 12 13} {21 22 23} {31 32 33}} Bug: Table has still only 2 rows? .t configure -state normal lappend foo {41 42 43} Table now has 4 rows, ok. Same proble...

IP change notification
Anyone know of a utility that runs as a service and checks if the IP on a cable modem changes? It would have to be able to read it behind a firewall/router like linksys and email the notification to an email account. Any suggestions? Thanks! Try www.ipupdater.com or www.no-ip.com both of these let you register a domain name free of charge (e.g. warnock.ipupdater.com). They also give you a free tool that you run as a service on your PC. The tool checks your IP address at regular intervals. When it changes, the tool sends the new address to ipupdater or to no-ip, which will...

how to change counters inside subfigures in memoir
i'm trying to use the memoir class to put figures side by side. in one example, i want to put three figures side by side, but only want to label the first and the third as 1 and 2 respectively, leaving the middle figure un-captioned. so, i have this code: \newsubfloat{figure} \renewcommand{\thesubfigure}{\arabic{subfigure}} \begin{figure} \subbottom[][]{\includegraphics{a}\label{fig1}} \subbottom{\includegraphics{b}} \addtocounter{subfigure}{-1} % <-- this don't seem to have any effect. \subbottom[][]{\includegraphics{c}\label{fig2}} \end{figure} ...

Diskchange change the current directory.
We are running this application from F:\Test. It displays "test" but after we change to C and then back again to F the curdir returns "" (root directory. In clipper keeps the old directory (test). Procedure Main() CLS @ 10, 10 Say Curdir() // test DiskChange( "C" ) DiskChange( "F" ) @ 11, 10 Say Curdir() // "" inkey(0) Return "Mike Evans" <makis1970@hotmail.com> ha scritto nel messaggio news:473da5b3$0$1344$834e42db@reader.greatnowhere.com... > We are running this application from F:\Test. It displays "tes...

changing colormap
somehow my default colormap in matlab got changed from the standard blue to a weird rainbow pattern. how do i restore the default? for example, when i try to create a histogram, it appears in this rainbow colormap (which looks rather revolting). "Pr B" <pb2297@columbia.edu> wrote in message news:i59oje$qr4$1@fred.mathworks.com... > somehow my default colormap in matlab got changed from the standard blue > to a weird rainbow pattern. how do i restore the default? for example, > when i try to create a histogram, it appears in this rainbow colormap > (which...

Date changes before time registers midnight
To all I have established that when running a Clipper program on Windows 2000 (a 16 bit windows application that uses Clip4Win) the time (return from TIME() or SECONDS()) runs a bit slower than the system time. The NTVDM or WOW seems to allocate a timer to the application which doesn't necessarily keep up with the system time. The net result is that the date will change a few minutes before midnight after your app has run a few days. Not so good for a scheduler! If your program displays the date and time, you can test this by changing the date and time in the control panel and seeing wha...

Workaround for ascii change of behavior in scilab 5
Hello, it seems like the ascii function changed between scilab 4 and 5: the ascii table does not extend beyond 127 or in other words for example: --> ascii(ascii(129)) 4.1.2 win32 -> ans = 129. 5.1.1 win32 -> ans = 1. I don't know if it is a bug because the ascii manual is the same in both versions (and does not say what ascii should do above 127). But now I have a bunch of scripts that do not run anymore in Scilab 5 because they used this double conversion (e.g. to perform string operations like grep, strsubst etc on matrices of unsigned characters read...

How to change GUI properties?
Dear all, I make a GUI with MATLAB Guide, and I want to change some component's properites when this GUI starts. For example, there is a pop-up menu and some other buttons, and when pop-up menu is equal to 1, and the buttons should be unvisible, and when pop-up menu is equal to 2, the buttons may be visible. I can make it in the call_back function of pop-up menu, as you know, when this GUI starts, pop-up menu has an initial value, so I want to visible or unvisible these buttons accroding to the value of pop-up menu. I try to resolve it in the function of figure1_CreateFcn, but failed, beca...

Career change. Am I smoking crack?
Long story kind-of short: I am a programmer and project manager with 7+ years professional programming experience (23 years if you count all the home coding projects I did back as a child). I am seriously considering getting totally out of the tech/code/project/corporate world and switching careers. I simply am not interested anymore in programming, nor in the tech management stuff or the corporate "here's the new product we're going to bring to market" crap. Ironically, I am good at this stuff. It pays lots of money. If I switched, I would even consider a much lower-pa...

Changing record before update
Here's a tough one - I have a database that I have split. When a user enters a new record on a linked table and changes it before another user can refresh their front end, the record in the 2nd user ALWAYS reverts back to the first record after a refresh and shows that data after clicking on a list box. ...

changing saveDir and projectDir as library changes
Hi, I'm having problems figuring out how to do the following: Instead of just using fixed defaults for saveDir and projectDir (such as ./artist_states and ./simulation respectively - and I don't care how these were set - either by .cdsenv entry or use of envSetVal) , I would like to have projectDir and saveDir follow the library of the schematic being simulated. In other words, if I opened MyLib->MyCell->schematic and then invoked Analog Artist, I would like the projectDir to already be defaulted to ../simulation/MyLib and I would like the saveDir to already be defaulted to ./...

parse output and check if a change
Hi, I am sending a command to unix and then I parse the output. The output is s= tored in a Info object ( Info.java). This will be used later in application= ..=20 The problem is that the output from the unix command might change. So I wan= t to make sure that if there is a change then we parse and update the Info = object. But if there is no change then we do not need to parse and extract = the information. We can use the Info object directly. The idea I have is to use the output from the command ( a text string) and = calculate some kind of hash/md5sum. So the next time I r...

Changing Header
Hi, I am newnewnewbie. When I telnet to SendMail Server on port 25. It will show 220 apple.local ESMTP Sendmail.. blah blah.. How can I change the apple.local into something else. I know that changing hostname is one of the way. How about without changing the hostname? By the way, what should I call this thing? Header? Thank you. CL wrote: > By the way, what should I call this thing? Header? I think you are talking about that: define(`confSMTP_LOGIN_MSG',`Welcome to my wonderful server')dnl which must be put in your sendmail.mc I you really don't know sendmail.mc and just...

Time change during boot after system change
We've just replaced a leased ES45 with a DS25 on March 28th. The DS25 booted to the same system disk/root that the ES45 used. During the boot process, the time advanced one hour ahead. %%%%%%%%%%% OPCOM 28-MAR-2007 12:22:18.38 %%%%%%%%%%% Message from user SYSTEM on XXXXXX %SECSRV-I-CIASTARTINGUP, breakin detection and evasion processing now starting up %STARTUP-I-AUDITCONTINUE, audit server initialization complete %%%%%%%%%%% OPCOM 28-MAR-2007 13:22:25.81 %%%%%%%%%%% Message from user AUDIT$SERVER on XXXXXX Security alarm (SECURITY) and security audit (SECURITY) on XXX...

re-surfacing my objects after size change
When changing the size of an object, i would have to go back into surfacing and change each surface one by one. is there an easier way to auto surface my objects - after changing size? thanx....doc doc wrote: > When changing the size of an object, i would have to go back into surfacing > and change each surface one by one. > is there an easier way to auto surface my objects - after changing size? Resize them in Layout only? That way you won't have to resurface anything. Yep...and then if you save the Transformed Object from the save file menu, it'll save it out with ...

Changes in getCanonical Path behaviour
In the olden days, on Windows, File.getCanonicalPath would look the file up in the directory and find out its precise case and return that to you. Now it returns the same thing as getAbsolutePath, echoing the case of the filename as you gave it. -- Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching. Roedy Green <my_email_is_posted_on_my_website@munged.invalid> wrote: > In the olden days, on Windows, File.getCanonicalPath would look the > file up in the directory and find out its precise case and return that > to you. N...

Running header changes #2
I have got this Tex document I'm told I have got to work on - problems!! - and one thing I have got to undo is the way it alternates the running header, the left one followed by the right one, between one page and the next. I need them both on the same page, on all pages (save the first). It's got \usepackage{chngpage} and I suspect this is the culprit; but when I replace it with \usepackage{book} or \usepackage{article} (just guesses!) it gives errors. Is there some trick? M.E.: \documentclass[reqno]{amsart} \usepackage{geometry} \usepackage{amssymb} \usepackage{chngpage} \us...

how to change the change defaults
hi friends, it might be a stupid question to state. but i really need to know while programming, to change the defaults like changing the engineering notation of a real quantity i.e. fraction values or change the fix parameters to denote real value if our calculations involve the values as low as 0.000000001 and as high as 10000000. thanks hemu bisht ...

Dynamically Changing the length of a varchar(n) field
Hi Everyone, I have a question about dynamically changing the length of a varchar(n) field, in case the value I'm trying to insert is too big and will give a "truncated" error, but before the error is given! i.e. Is there some kind of a way to "test" the length of the field while Inserting the value into it, and to have it automatically increase its length to the length of the value being inserted, in case the value is too big? I've been able to do this in a "primitive" way, simply by identifying the specific error number in case the value is being trunc...

Changing focus
I'd like to know if there is any way that you can set the focus to any particular editable text box? Thanks! "Dinh Nguyen" <dinh.nguyen@peterson.af.mil> wrote in message news:eee0f5a.-1@webx.raydaftYaTP... > I'd like to know if there is any way that you can set the focus to > any particular editable text box? > Thanks! Try Martin Weber's wonderful SETFOCUS program (downloadable from MATLAB Central). BTW, has this focus issue been addressed in ML7? Anyone? Brett ...