SelectOneMenu disabled attribute disappears
Hi,
I have the following code to create a selectOneMenu:
<h:selectOneMenu id="geboorteLand" tabindex="12" value="#{myForm.geboorteLand}" disabled="true"
>
<f:selectItems value="#{enumeratiesBean.landen}"/>
</h:selectOneMenu>
and it generates the following
<select> starttag:
<select id="body:myForm:geboorteLand" name="body:myForm:geboorteLand" size="1" tabindex="12">
The problem is that the disabled attribute is not being rendered at all. Does anyone know this problem?
Greets,
Rob
Yep, that's a bug. The tag class for <f:selectitem>
is not passing the "disabled" flag on to the
underlying SelectItem bean. This will be fixed for
the final release.
CraigA couple of pieces of further information on this:
I've been able to work around this kind of problem (in the beta) by using a backing bean to calculate the list of SelectItem instances to be displayed, accessed something like this:
<h:select_one id="selection" value="...">
<f:selectitems value="#{mybean.validSelections}"/>
</h:select_one/>
[/code}
where the getValidSelections() method of your backing bean returns a List of javax.faces.model.SelectItem beans. Any "disabled" property on these beans will be honored.
However, my experiments with Internet Explorer 6 so far indicate that it seems to ignore the following W3C standard syntax to disable an available option:<option value="foo" disabled="disabled">The Foo Option</option>
We are still investigating this issue -- any information or feedback that might be helpful should be sent to <[email protected]>.
Craig McClanahan
Similar Messages
-
Disabled attribute on link causes Return Listener disfunctioning
Hello,
Using JDev 11g Studio Edition Version 11.1.2.1.0
I have a af:commandImageLink which, when clicked on, opens a Dialog.
On the af:commandImageLink, a returnListener is defined and there is an EL expression on the disabled attribute.
When the EL expression for the disabled attribute resolves to true during the LifeCycle processing, the returnListener isn't called, although the commandImageLink was enabled at the start of the LifeCycle processing that initiated the display of the Dialog in the first place.
Is this expected behaviour, or is this a bug?
StevenFrank,
I understand that the dialog open and return listener aren't executed in the same request lifecycle.
It seems that I didn't correctly explained the issue I'm facing.
Here is a second attempt to describe the problem...
1. The user clicks on the af:commandImageLink which results in a modal dialog being displayed.
2. The user makes some changes within the modal dialog. The changes he made will cause the EL expression on the af:commandImageLink disabled attribute to evaluate to true.
3. The changes are commit and the dialog is closed.
Problem: The return Listener isn't called, since the disabled attribute on the af:commandImageLink is true.
This seems like a bug to me.
I would expect that the returnListener registered on the UI widget that causes the dialog open event, to be called when the dialog is closed. Even if the UI widget is disabled after the dialog is closed.
The framework should honour the state of the UI widget at the time the dialog open event is raised to decide if the returnListener should be called.
Does this make any sense?
Steven.
Edited by: Steven Janssens on 5-mrt-2012 4:27 - Relaunching question -
Disabling attributes or operations using StandardMBean
In the Best Practices document at http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/best-practices.jsp I find the following advice:
If you need some particular abilities of Dynamic MBeans, for example the ability to supply descriptions for the attributes or operations, or the ability to disable certain attributes or operations, then you should consider subclassing javax.management.StandardMBean rather than implementing the DynamicMBean interface.
I'm trying to learn about the various types of MBeans. Are there any details available on how to disable certain attributes or operations using a subclass of StandardMBean, and does anyone have a good use case for this feature?
Thanks...Hi,
Disabling attributes and operation is not something I would recommend, but if
you need to do it it should be relatively easy to use javax.management.StandardMBean
for that.
For instance if you want to disable invoke for a given MBean, you could
write a subclass of StandardMBean and override its invoke method to do something
like:
@Override
public Object invoke(String methodName, Object[] params, String signature)
throws ... {
// disable method whatever
if (methodName.equals("whatever"))
throw UnsupportedOperationException("method whatever is disabled");
// allows other methods
return super.invoke(methodName,params,signature);
}For background reading see:
javax.management.StandardMBean: When and Why.
http://blogs.sun.com/jmxetc/entry/javax_management_standardmbean_when_and
-- daniel
http://blogs.sun.com/jmxetc -
OID Attributes Disappear After Schema Import
I'm running OID 11.1.1.5, and am importing the schema of another OID instance (10g). I had originially tried to import the whole schema - took all the attributes and object classes and imported them in one ./ldapmodify command via file with the correct format:
output schema:
./ldapsearch -h <> -D <> -w <> -p <> -b cn=subschemaSubentry -s base -v "objectclass=*"
import schema:
./ldapmodify -h <> -D <> -w <> -p <> -c -f <>
the file format looked like so for each attribute and object class:
dn: cn=subschemasubentry
changetype: modify
add: attributetypes
attributetyptes: ( <nnn> NAME ' ' SYNTAX ' ' SINGLE VALUE )
dn: cn=subschemasubentry
changetype: modify
add: objectclasses
objectclasses: ( <nnn> NAME '' SUP tup STRUCTURAL MUST ( ) MAY ( ) )
After running this file I saw the following behavior:
- many of the attempts returned "object / attribute already in use"
- the attributes were no longer viewable in the schema tab
- i could see the object classes that were imported
- the object classes contained entries of the attributes that were supposed to be created
- attributes within the object class contained none of the required values (OID, Syntax, etc)
- when i tried to edit the attributes from within the object classes, it throws an error and all attributes disappear from the objectclass
- OID becomes hosed
I have a full backup of the instance that I revert to while trying to debug this issue. My questions are-
1. Has anyone else run into this?
2. Any idea what the root cause is?
3. If so, how do you recover?
4. Is OID recoverable after this kind of behavior, or is a restore required?Looks like I was able to resolve my issue! Some of the attribute add fields had a SPACE in after the quote in the DESC value.
Rather than:
DESC 'some description'
It had:
DESC ' some description'
Hope that helps another poor soul. This led to major application-wide destruction if not done correctly; very little error checking on the scripts side. -
Disabled attribute in selectitem not working
According to the beta 1.0 spec in 9.4.9, <f:selectitem> has a disabled attribute, but UISelectItem (4.1.11.2) doesn't mention it.
I can put it in the tag:
<f:selectitem itemValue="AZ" itemLabel="AZ" disabled="true"/>with no complaint, but it doesn't seem to make any difference in the rendered HTML.Yep, that's a bug. The tag class for <f:selectitem>
is not passing the "disabled" flag on to the
underlying SelectItem bean. This will be fixed for
the final release.
CraigA couple of pieces of further information on this:
I've been able to work around this kind of problem (in the beta) by using a backing bean to calculate the list of SelectItem instances to be displayed, accessed something like this:
<h:select_one id="selection" value="...">
<f:selectitems value="#{mybean.validSelections}"/>
</h:select_one/>
[/code}
where the getValidSelections() method of your backing bean returns a List of javax.faces.model.SelectItem beans. Any "disabled" property on these beans will be honored.
However, my experiments with Internet Explorer 6 so far indicate that it seems to ignore the following W3C standard syntax to disable an available option:<option value="foo" disabled="disabled">The Foo Option</option>
We are still investigating this issue -- any information or feedback that might be helpful should be sent to <[email protected]>.
Craig McClanahan -
Safari 1.24 (OS X 10.3.8) doesn't recognize "disabled" attribute
In Safari 1.24 (OS X 10.3.8), Safari doesn't recognize "disabled" attribute when the input type="password". It works correctly when the input type="text". Is there any work around this issue ? Upgrading to newer Safari is not the answer I'm looking for.
Thank you.Hi,
If it's a bug in Safari's handling of the input element, then no there's nothing you can do to get around it.
What are you trying to achieve? If you explain your aims maybe someone could offer an alternative solution. -
SelectOneMenu disables itself after facesMessage
Hello All,
I have been working this for a while now and not really sure how to get around it. I have a SelectOneMenu populated with selectItems inside a form. The required attribute is set to true and the requiredMessage attribute is set to "Please select a position". The form elements (including the selectOneMenu) is nested inside a rich:modalPanel.
What happens is that since the selectOneMenu is required the messages fire--the expected behavior BUT the selectOneMenu for some reason also disables itself. Now, I am thinking that this "disabled" quality of the selectOneMenu has something to do with the component loosing it value and/or selectItems values--not sure though. The applicable code is listed below:
<rich:modalPanel id="groupsAddPanel" width="500" height="450" style="background-color: #EEEECB;"
binding="# {membersHandler.addNewMembers}">
<f:facet name="header">
<h:panelGroup>
<h:outputText id="groupsAddPanelHeaderText"
value="#{membersHandler.addMembersHeaderLabel}"/>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/images/close.png"
style="cursor:pointer" id="hidelinkAddGroups"/>
<rich:componentControl for="groupsAddPanel"
attachTo="hidelinkAddGroups"
operation="hide" event="onclick"/>
</h:panelGroup>
</f:facet>
<a4j:region id="groupsAddRegion">
<a4j:form id="groupsAddForm" ajaxSubmit="true" rendered="true" status="groupAddStatusId" >
<h:panelGroup id="groupsAddPanelGroup" rendered="true" >
<table cellpadding="3" cellspacing="0" border="0" id="addGroupsTable"
style="background-color: #EEEECB;" >
<tr>
<td class="groupsTdLables">
<h:outputText id="posLblGroupsAddForm" value="Position: "/>
</td>
<td colspan="3" class="addGroupsInputs">
<h:selectOneMenu id="positionDropDown"
valueChangeListener="#{membersHandler.positionSelected}"
required="true"
requiredMessage=" Please select a position!"
value="#{membersHandler.dirtyMembers.srpMemLuId}"
binding="#{membersHandler.membPosHtmlSelectOneMenu}">
<f:selectItems value="#{membersHandler.generalSelectItem}"
binding="#{membersHandler.membPosSelectItems}"/>
<a4j:support event="onchange" reRender="positionDropDown"/>
</h:selectOneMenu>
</td>
</tr>
</table>
<h:panelGrid id="groupsAddPanelButtonsPanelGrid" columns="3" style="text-align:center; width:100%;">
<a4j:commandButton id="saveLinkAddGroupsPanel" value="#{srpBundle.hlinkSave}"
styleClass="buttons01" status="groupAddStatusId"
rendered="true" action="#{membersHandler.saveNewRow}"
onclick="this.value='Processing...'; this.disabled=true;"
oncomplete="windowclose();">
<a4j:support event="onclick" reRender="addGroupsTable"/>
</a4j:commandButton>
<rich:spacer id="blankspaceId" width="200px;" />
<a4j:commandButton id="cancelLinkAddGroupsPanel" value="#{srpBundle.hlinkCancel}"
styleClass="buttons01" status="groupAddStatusId"
rendered="true" reRender="facStudRotcForm" immediate="true">
<rich:componentControl id="richCmptCntrlCancelAddGroupsPanel" for="groupsAddPanel" attachTo="cancelLinkAddGroupsPanel"
operation="hide" event="onclick"/>
</a4j:commandButton>
</h:panelGrid>
</h:panelGroup>
</a4j:form>
<a4j:status id="groupAddStatusId" startText="One Moment Please..."
stopText="Ready!" style="text-align: center; font-size: 14px; font-weight: bold;"/>
</a4j:region>
<rich:messages id="richMessagesBaseForm2"
binding="#{membersHandler.htmlRichMessages}"
style="text-align: left"
passedLabel="Data is allowed to be stored."
layout="list">
<f:facet id="richMessagesBaseFormFacetHeader" name="header">
<h:outputText id="baseFormOutPutText" value="Entered Data Status:"></h:outputText>
</f:facet>
<f:facet id="richMessagesBaseFormFacetPassed" name="passedMarker">
<h:graphicImage id="baseFormImagePassed" value="/images/passed.gif"/>
</f:facet>
<f:facet id="richMessagesBaseFormFacetError" name="errorMarker">
<h:graphicImage id="baseFormImageError" value="/images/error.gif"/>
</f:facet>
</rich:messages>
</rich:modalPanel>I didn't see a need to post the valueChangeListern method because according to my debugger I never get there. The require=true attribute
doesn't let the valueChangeListerner fire.
Any ideas?place your select one menu in Ajax enable ajaxouputpanel and assign id to that component and re render the ajaxoutputpanel i hope it will resolve your problem.
AjaxOutputPanel
like the code.
<a4j:outputPanel layout="block" id="positionDropDown">
<h:selectOneMenu valueChangeListener="#{membersHandler.positionSelected}"
required="true"
requiredMessage=" Please select a position!"
value="#{membersHandler.dirtyMembers.srpMemLuId}"
binding="#{membersHandler.membPosHtmlSelectOneMenu}">
<f:selectItems value="#{membersHandler.generalSelectItem}"
binding="#{membersHandler.membPosSelectItems}"/>
<a4j:support event="onchange" reRender="positionDropDown"/>
</h:selectOneMenu>
</a4j:outputPanel>Edited by: [email protected] on Sep 16, 2008 11:55 PM -
Struts: How to set 'disabled' attribute name using a property in ActionForm
I have the following struts tag:
<nested:select property="someProperty" disabled="<nested:write property="screenReadOnly"/>">
<html:options .../>
</nested:select>
where 'screenReadOnly' is a boolean variable in the ActionForm.
However this does not work. Is there a way to use this technique in a struts way (without using any scriplets) for attribute names instead of having duplicate struts tags where the only difference is, in this case, the disabled value?
For those that are interested, I get the following thrown exception:
weblogic.servlet.jsp.JspException: (line 120): Non-matching extension tags //[ null;
Line: 120]
at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:856)
at weblogic.servlet.jsp.JspLexer.mCLOSE_EXTENSION_TAG(JspLexer.java:2674)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1987)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1860)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:1100)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java:89)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:192)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:255)
Cheers.
Normie.Rule of thumb: You can't use tags for attribute values.
-
SelectOneMenu size attribute?
JSF 1.0's selectOneMenu tag does not have a size attribute. I have a dropdown that has about 50 options and the list expands to the entire screen. I only want to show about 10 at a time with a scrollbar if >10 are in the list. How can I adjust the size?
I tried using style="size:10" but that isn't working either. Do I just have the syntax wrong?Sorry, I misunderstood the size attribute and how it works with a dropdown list. Basically what I want to happen is when the down arrow is clicked for the dropdown, I want the expanded list to only show like 20 options with a scrollbar on the right. Is this even possible?
-
A beautiful credit sequence that had exported satisfactorily appeared the next time the project was opened with nothing in the credits but basic text and all attributes (fonts and placements) gone. No other damage to the storyline occurred. This was unprecedented. Any ideas what caused it and/or how to recover the attributes and/or how to prevent it from happening in the future?
Because I'm in the completion stages of a film that has taken years to produce I've been stuck using older versions of the OS (Snow Leopard) and FCP (10.0.9). I'll replace everything on a new Mac Pro when this is done but I've got to wrap up the project with what I have first.
I have the project file on the Mac Pro's main HD and the event library files for it on a separate internal HD.
Thanks!
JT
OregonThanks for the prompt reply.
The puzzle remains, even though the next time I launched the program, the attributes returned.
What I meant was, in playing the storyline with the elaborate titles, everything else that had been edited into the movie, including numerous composited and shots with various parameters adjusted, played normally except for that sequence in which every title played with all the text appearing in the centered basic title mode with none of the font attributes or placements within the frame on display. Still a worrisome event. -
Javascript attributes disappear when going back
This question is mostly about javascript and cookies but
since I use CF i decided to post here.
I have a very simple question - I hope!
I have the following code in my very simple page:
When I click on the link "turn black", the layer "newdiv"
turns black. Now if I click on the google link go to google and hit
the back button to come back to my page, the layer "newdiv" retains
its original background color of gray.
I want the color to remain black when I hit the back button.
It works fine on Mozilla and Netscape, but does not work on IE6.
How can I make it work on IE ? Any pointers much
appreciated.Hi sanman,
You need to drop a Javascript cookie when the user clicks on
the "change background link". You'll set that cookie to
bgcolor="black" or someithing and tell it to expire when the
browser closes. When the page first loads, ask if the cookie
exists. If it doesn't, put the default gray color. If it does, set
the bgcolor of the div to the value of the cookie. This way, no
matter where the user goes after they leave this page, when they
come back, the div will be the color that they chose. It will even
work if the user clicks on "back".
I don't know the code by heart because it's been awhile since
I've used it, but if you Google Javascript cookies, you can find a
bunch of tutorials on how to set and delete JS cookies.
Peter -
Apex4 does not render readonly attribute properly for IE.
I found that Apex4 renders the readonly attribute with an extra quotation mark for IE. So I get this:
"readonly="readonly"
And it doesn't work, obviously. For Firefox, all is good.
The simplest solution seems to be to just leave the Disabled attribute set to No and manually add "readonly=true" to the "HTML Form Element Attributes" field.Hi,
yes that is a problem on our known issue list http://www.oracle.com/technetwork/developer-tools/apex/40-known-issues-159870.html and will be fixed in our upcoming patchset 4.0.1. Actually the release candidate for this patchset has already been installed on apex.oracle.com. So there you should not be able to reproduce the problem anymore.
Regards
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins -
How to specify a radio button as disabled in Net-UI
How do i specify a radio button to be disabled using the net-ui ??
i know i can do it in HTML using
<INPUT TYPE="RADIO" NAME="btn1" VALUE="today" DISABLED>
So what is the Net-UI equivalent to the same ? I could not find much information
in the workshop documentation pertaining to the same
I have my radio button set up as
<netui:radioButtonGroup dataSource="{actionForm.itemSelected}" >
<netui:radioButtonOption value="{pageContext.itemNumber}" labelStyle="right"
>
</netui:radioButtonOption>
how do I specify a disabled property ??? I presume it can be done using labelStyle
but I dont know what to write in it .
Help !! MayDay !! MayDay !!
Thanks
Kar
</netui:radioButtonGroup>Kar,
The netui:radioButtonOption does not have a disabled attribute. I think your
only option is to use javascript to set disabled to true.
- john
"kar piyush" <[email protected]> wrote in message
news:4087ec3e$[email protected]..
>
How do i specify a radio button to be disabled using the net-ui ??
i know i can do it in HTML using
<INPUT TYPE="RADIO" NAME="btn1" VALUE="today" DISABLED>
So what is the Net-UI equivalent to the same ? I could not find muchinformation
in the workshop documentation pertaining to the same
I have my radio button set up as
<netui:radioButtonGroup dataSource="{actionForm.itemSelected}" >
<netui:radioButtonOption value="{pageContext.itemNumber}"labelStyle="right"
>>
</netui:radioButtonOption>
how do I specify a disabled property ??? I presume it can be done usinglabelStyle
but I dont know what to write in it .
Help !! MayDay !! MayDay !!
Thanks
Kar
</netui:radioButtonGroup> -
Disabling a checkbox which is in a table, from managed bean
disabling a checkbox which is in a table, from managed bean -
i am able to iterate table and get/set value of checkbox but i want to disable it, how can i do that?
FacesContext facesContext = FacesContext.getCurrentInstance();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings}", Object.class);
DCBindingContainer bindings = (DCBindingContainer) valueExp.getValue(elContext);
DCIteratorBinding iter = bindings.findIteratorBinding("dogsIterator");
RowSetIterator rit = iter.getRowSetIterator();
rit.reset();
while(rit.hasNext()) {
Row currentRow = rit.next();
Attribute attr = (Attribute)row.getAttribute("checked");
what code should come here to disable checkbox?
rit.closeRowSetIterator();
thanks.Wes Fang wrote:
You might find it easier to simply use EL and evaluate that value on the disable property:
<af:column ...>
<af:selectBooleanCheckbox ... disabled="#{row.bindings.checked.inputValue==YOUR_DISABLE_VALUE?true:false}"/>
</af:column>
i used this approach.
kept a bean in session and used it's property in disabled attribute - now setting this property in my bean... -
Why I cannot process a disabled field when using htmldb_item
I have a report that has this in the select statement
case when c.sec_lic_status in (1,2,7,505,1002,1004,1005) then
htmldb_item.text(2,sum( distinct a.fee_variable),8,20)
else
htmldb_item.text(2,sum( distinct a.fee_variable),8,20,'disabled')
end "Quantity 1"
The above shows correctly. If there are 2 records one field is disable and the other is enabled.
I have a process that fires on submit - after Computations and Validations. But the records don't changed when updating the enabled one.
In debugging and writing to a file using the UTL_FILE package, I'm able to pinpoint that the disable fields are the problem.
Is there a trick on manually processing disabled fields?
I've found that when I uncheck the show box in the report, I cannot use the fields either. This is not a problem, just another comment.
My main problem is what do I have to do to manually process a disabled field.
Thanks for your help, comments, pointers, or anything that could help me or give me ideas.
juanJuan - HTML items with the disabled attribute are not POSTed with the form so your after-submit processes never see them. Try 'readonly="readonly"' instead. Others may be able to suggest how to also give those cells a greyed-out appearance.
Scott
Maybe you are looking for
-
Keep getting download error for update version 5.0.01
-
Video blog works with safari, but all of a sudden firefox NOTHING
Hey gang.... www.danhproductions.com.....on the demo video section always came up no problem...just noticed on my firefox it will not show the video blogs and says at the bottom: # Exception: TypeError # Message : localizedSpans.each is not a functio
-
Sync problems with i-phone 4s and i-pad 2 using IOS 7.1.1
I have been sycning through my PC for years. Where did the "start sync" command go on the IOS update?
-
Get transactional currency total based on currency type
hi, i have created a custom report related to fi which is working fine. but now the issue is in that report we r having a transaction currency field WRBTR.the users want to calculate totals based on currency. for example my output is tran curr curr
-
Is it possible to get java on a hp ipaq hx7400? I downloaded IBM's WebSphere Everyplace Micro Environment 5.7.1 but it dosent seem to work.