This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes disabled issue for inputtext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "disabled issue for inputtext" Watch "disabled issue for inputtext" New topic
Author

disabled issue for inputtext

Tejas Aj
Greenhorn

Joined: Feb 10, 2010
Posts: 6
Hi all,
i am using ibm portal. we are using jsf pages in portlet. when i load my page i am disbling one of the input text on the page. this i m handling in the constructor. there is a edit button on the page , when i click on the button the field gets enabled. now when i change something in the input text box and do a submit the new value is not sent in the request and rather the old value only goes. also i am disabling the box after clicking on save. here the old value is seen again. please help me as to how i should retain the same value and send in the request.

attaching jsp the code below: please check the id id="inputTxtAnticiptdEndDate" and id="txtComments"

<%-- jsf:pagecode language="java" location="/src/pagecode/view/endofassignment/EOAValidation.java" --%><%-- /jsf:pagecode --%><%@taglib
uri="http://java.sun.com/portlet" prefix="portlet"%><%@taglib
uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%><%@taglib
uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
uri="http://java.sun.com/jsf/html" prefix="h"%><%@taglib
uri="http://giams.com/jsf/GIAMSCustomJSF" prefix="giams"%><%@page
language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" session="false"%><portlet:defineObjects />
<link rel="stylesheet" type="text/css" title="Style"
href='<%=renderResponse.encodeURL(renderRequest.getContextPath()
+ "/theme/stylesheet.css")%>'>
<f:view>
<f:loadBundle var="giamsBundle"
basename="com.ibm.endofassignmentportlet.nl.GIAMSResourceBundle" />
<f:subview id="subview1"><jsp:include
page="../common/LeftNavigationMenu.jsp" flush="false"></jsp:include></f:subview>
<hx:scriptCollector id="scriptCollector1"
preRender="#{pc_EOAValidation.onPageLoadBegin}">


<h:panelGrid columns="1" cellpadding="1" border="0" width="100%">
<h:form styleClass="form" id="form1" accept="">
<hutputText id="titleEOA" styleClass="outputText"
value="#{giamsBundle['title.end.of.assignment']}" escape="false"></hutputText>
<hutputText id="titleValidation" styleClass="outputText"
value="#{giamsBundle['title.validation']}" escape="false"></hutputText>
<%-- <hutputText id="requiredFieldsMsg" styleClass="outputText"
value="#{giamsBundle['msg.required.fields']}" escape="false"></hutputText>--%>
<giams:errorMessages></giams:errorMessages>

<hutputText value="<br/>" escape="false" />

<h:panelGroup>
<hutputText styleClass="outputText" id="txtInformationMssg"
value="John Holmes, Manager XYZ, #{giamsBundle['msg.submitted.request']}"></hutputText>
<hutputText value=" " escape="false" />
<hutputText styleClass="outputText" id="txtAssigneeFirstName"
value="#{pc_Assignee.firstName}"></hutputText>
<hutputText value=" " escape="false" />
<hutputText styleClass="outputText" id="txtAssigneeLastName"
value="#{pc_Assignee.lastName}"></hutputText>
</h:panelGroup>

<hutputText value="<br/>" escape="false" />
<hutputText value="<br/>" escape="false" />

<hx:panelSection styleClass="panelSection"
id="pSectionMgrSubmittedData" initClosed="false"
style="border-width: thin; border-style: groove">


<hx:panelFormBox helpPosition="over" labelPosition="left"
styleClass="panelFormBox" id="frmBoxMgrSubmittedData">

<hx:formItem styleClass="formItem" id="frmItemRequestType"
label="#{giamsBundle['lbl.request.type']}">
<hutputText styleClass="outputText" id="txtRequestType"
value="#{pc_EOAValidation.requestTypeValue}"></hutputText>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemHomeCountry"
label="#{giamsBundle['lbl.home.country']}">
<%-- <hutputText styleClass="outputText" id="txtHomeCountry"
value="#{pc_Assignee.homeCountry}"></hutputText> --%>
<giams:referenceDataOutputText id="txtHomeCountry"
refdataCode="COUNTRY" refdataValue="#{pc_Assignee.homeCountry}">
</giams:referenceDataOutputText>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemHomeLocation"
label="#{giamsBundle['lbl.home.location']}">
<hutputText styleClass="outputText" id="txtHomeLocation"
value="#{pc_Assignee.companyDetails.homeLocation}"></hutputText>
<%--<giams:referenceDataOutputText id="txtHomeLocation"
refdataCode="IBM_LOCATION"
refdataValue="#{pc_Assignee.companyDetails.homeLocation}">
</giams:referenceDataOutputText>--%>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemCurrProjctdEndDate"
label="#{giamsBundle['lbl.validation.curr.projected.end.date']}">
<hutputText styleClass="outputText" id="txtCurrProjctdEndDate"
value="#{pc_Assignee.assignment.plannedEndDate}">
<hx:convertDateTime pattern="#{pc_Formatter.dateFormat}" />
</hutputText>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemAnticiptdEndDate"
label="#{giamsBundle['lbl.validation.screen.anticipated.end.date']}"
escape="false">
<h:inputText styleClass="inputText" id="inputTxtAnticiptdEndDate"
disabled="#{pc_EOAValidation.editable}"
value="#{pc_Assignee.assignment.anticipatedProjEndDate}">
<hx:convertDateTime pattern="#{pc_Formatter.dateFormat}" />
<hx:inputHelperDatePicker id="datePickerDepartureDate" />
<hx:inputHelperAssist errorClass="inputText_Error"
id="assistDepartureDate" />
</h:inputText>
<%-- <hutputText styleClass="outputText" id="txtAnticiptdEndDate"
value="#{pc_Assignee.assignment.anticipatedProjEndDate}">
<hx:convertDateTime pattern="#{pc_Formatter.dateFormat}" />
</hutputText> --%>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemComments"
label="#{giamsBundle['lbl.comments']}">
<h:inputText styleClass="inputText" id="txtComments"

value="#{pc_Assignee.assignment.eoaComments}">

</h:inputText>
<%-- <hutputText styleClass="outputText" id="txtComments"
value="#{pc_Assignee.assignment.eoaComments}"></hutputText> --%>
</hx:formItem>

<f:facet name="left">
<hutputText value="   " escape="false" />
</f:facet>
</hx:panelFormBox>

<f:facet name="closed">
<hx:jspPanel id="jspPanel2">
<hx:graphicImageEx id="imageEx1" styleClass="graphicImageEx"
alt="#{giamsBundle['alt.expand.mgr.data']}" align="middle"
value="/theme/img/menu_bar.GIF" width="100%" height="10"></hx:graphicImageEx>
<hx:graphicImageEx id="imageExClosed1"
styleClass="graphicImageEx"
alt="#{giamsBundle['alt.expand.mgr.data']}" align="middle"
value="/theme/img/icon-link-expand-dark.gif"></hx:graphicImageEx>
<hutputText id="text3" styleClass="outputText"
value="#{giamsBundle['lbl.manager.submitted.data']}"></hutputText>
</hx:jspPanel>
</f:facet>
<f:facet name="opened">
<hx:jspPanel id="jspPanel1">
<hx:graphicImageEx id="imageEx2" styleClass="graphicImageEx"
alt="#{giamsBundle['alt.collapse.mgr.data']}" align="middle"
value="/theme/img/menu_bar.GIF" width="100%" height="10"></hx:graphicImageEx>
<hx:graphicImageEx id="imageExOpen1" styleClass="graphicImageEx"
alt="#{giamsBundle['alt.collapse.mgr.data']}" align="middle"
value="/theme/img/icon-list-close.gif"></hx:graphicImageEx>
<hutputText id="text2" styleClass="outputText"
value="#{giamsBundle['lbl.manager.submitted.data']}"></hutputText>
</hx:jspPanel>
</f:facet>
</hx:panelSection>

<hx:panelFormBox helpPosition="over" labelPosition="left"
styleClass="panelFormBox" id="frmBoxButtons">

<hx:formItem styleClass="formItem" id="frmItemButtons">

<hx:commandExButton type="submit"
value="#{giamsBundle['btn.edit']}" styleClass="commandExButton"
id="btnEdit" title="#{giamsBundle['hvr.edit.assignee']}"
action="#{pc_EOAValidation.doEditAction}"
rendered="#{pc_EOAValidation.releaseManagerData }"></hx:commandExButton>

<hutputText value=" " escape="false" />

<hx:commandExButton type="submit"
value="#{giamsBundle['btn.save']}" styleClass="commandExButton"
id="btnSaveUpper" title="#{giamsBundle['hvr.save.assignee']}"
action="#{pc_EOAValidation.doSaveAction}"
rendered="#{pc_EOAValidation.releaseManagerData }"></hx:commandExButton>

<hutputText value=" " escape="false" />

<hx:commandExButton type="submit"
value="#{giamsBundle['btn.release']}"
styleClass="commandExButton" id="btnReleaseMgrSubmittedData"
title="#{giamsBundle['hvr.release.assignee']}"
action="#{pc_EOAValidation.doReleaseMgrSubmittedDataAction}"
rendered="#{pc_EOAValidation.releaseManagerData }"></hx:commandExButton>
</hx:formItem>

</hx:panelFormBox>

</h:form>

<h:form styleClass="form" id="form2">

<hx:panelSection styleClass="panelSection"
id="pSectionMobRepReqData" initClosed="false"
style="border-width: thin; border-style: groove">

<hx:panelFormBox helpPosition="over" labelPosition="left"
styleClass="panelFormBox" id="frmBoxMobRepReqData">

<hx:formItem styleClass="formItem" id="frmItemConfirmedEndDate"
label="#{giamsBundle['lbl.confirmed.end.date']}" escape="false">
<h:inputText styleClass="inputText" id="txtConfirmedEndDate"
size="20" disabled="true"
value="#{pc_Assignee.assignment.confirmedEndDate}"
title="#{giamsBundle['hvr.confirmed.end.date']}">
<hx:convertDateTime pattern="#{pc_Formatter.dateFormat}" />
</h:inputText>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemMoveOutDate"
label="#{giamsBundle['lbl.move.out.date']}" escape="false">
<h:inputText styleClass="inputText" id="txtMoveOutDate" size="20"
disabled="true" value="#{pc_Assignee.assignment.moveOutDate}"
title="#{giamsBundle['hvr.move.out.date']}">
<hx:convertDateTime pattern="#{pc_Formatter.dateFormat}" />
</h:inputText>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemActualEndDate"
label="#{giamsBundle['lbl.actual.end.date']}" escape="false"
showHelp="none">
<h:inputText styleClass="inputText" id="txtActualEndDate"
size="20" value="#{pc_Assignee.assignment.actualEndDate}"
tabindex="2" title="#{giamsBundle['hvr.actual.end.date']}">
<f:converter converterId="CustomDateTimeConverter" />
<f:attribute name="label"
value="#{giamsBundle['lbl.actual.end.date.validation']}" />
<hx:inputHelperDatePicker id="datePickerActualEndDate" />
<hx:inputHelperAssist errorClass="inputText_Error"
id="assistActualEndDate" />
</h:inputText>
<hutputText value="      "
escape="false" />
<hx:commandExButton type="submit"
value="#{giamsBundle['btn.release']}"
styleClass="commandExButton" id="btnReleaseActualEndDate"
action="#{pc_EOAValidation.doReleaseActualEndDateAction}"
tabindex="3" title="#{giamsBundle['hvr.release.ey']}"
rendered="#{pc_EOAValidation.releaseActualEndRender }"></hx:commandExButton>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmEndOfAssgnStatus"
label="#{giamsBundle['lbl.actual.endofassign.status']}"
escape="false" showHelp="none">
<%-- <h:inputText styleClass="inputText" id="txtEndOfAssgnStatus"
size="20" value="asd"
tabindex="2" title="#{giamsBundle['hvr.actual.end.date']}">
</h:inputText> --%>
<giams:referenceDataSelectOneMenu
styleClass="referenceDataSelectOneMenu" id="cmbEndOfAssgnStatus"
refdataCode="ENDOFASSGNSTATUS"
value="#{pc_Assignee.assignment.eoaStatus}">
<f:converter converterId="RequiredConvertor" />
<f:attribute name="label"
value="#{giamsBundle['lbl.actual.endofassign.status.validation']}" />
</giams:referenceDataSelectOneMenu>
<hutputText value="      "
id="eoaStatusSpace" escape="false" />
<hx:commandExButton type="submit"
value="#{giamsBundle['btn.save']}" styleClass="commandExButton"
id="btnSave" action="#{pc_EOAValidation.doSaveAction}"
tabindex="7" title="#{giamsBundle['hvr.save.assignee.record']}"
rendered="#{pc_EOAValidation.submitRender }"></hx:commandExButton>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemDepartureDate"
label="#{giamsBundle['lbl.departure.date']}" escape="false">
<h:inputText styleClass="inputText" id="txtDepartureDate"
title="#{giamsBundle['hvr.departure.date']}" size="20"
value="#{pc_Assignee.assignment.departureDate}" tabindex="4">
<hx:convertDateTime pattern="#{pc_Formatter.dateFormat}" />
<hx:inputHelperDatePicker id="datePickerDepartureDate" />
<hx:inputHelperAssist errorClass="inputText_Error"
id="assistDepartureDate" />
</h:inputText>
<hutputText value="      "
escape="false" />
<hx:commandExButton type="submit"
value="#{giamsBundle['btn.release']}"
styleClass="commandExButton" id="btnReleaseDepartureDate"
action="#{pc_EOAValidation.doReleaseDepartureDateAction}"
tabindex="5" title="#{giamsBundle['hvr.release.ia.tax']}"
rendered="#{pc_EOAValidation.releaseDepartureDateRender }"></hx:commandExButton>
</hx:formItem>

<hx:formItem styleClass="formItem" id="frmItemSanctionStatus"
label="#{giamsBundle['lbl.sanction.status']}" escape="false"
showHelp="none">
<%-- <h:selectOneMenu styleClass="selectOneMenu"
id="cmbSanctionStatus" required="true"
value="#{pc_Assignee.assignment.sanctionStatus}" tabindex="6"
title="#{giamsBundle['hvr.sanction.status']}">
<f:selectItems value="#{pc_referenceData.statusList}" />
<f:converter converterId="RequiredConvertor" />
<f:attribute name="label"
value="#{giamsBundle['lbl.sanction.status.validation']}" />
</h:selectOneMenu>

<hutputText styleClass="outputText" id="cmbSanctionStatus"
value="#{pc_Assignee.assignment.sanctionStatus}">
</hutputText> --%>

<giams:referenceDataOutputText id="cmbSanctionStatus"
refdataCode="SANCTIONSTATUS" refdataValue="#{pc_Assignee.assignment.sanctionStatus}">
</giams:referenceDataOutputText>

<hutputText value="                "
id="sanctionStatusSpace" escape="false" />
<hutputText value="    "
id="sanctionStatusSpace2" escape="false" />

<hx:commandExButton type="submit"
value="#{giamsBundle['btn.ia.tax.delivery']}"
styleClass="commandExButton" id="btnReleaseIATaxDelivery"
action="#{pc_EOAValidation.doReleaseIATaxDeliveryAction}"
tabindex="7" disabled="#{pc_Assignee.assignment.sanctionStatus!='Y'}"
title="#{giamsBundle['hvr.release.ia.tax.delivery']}"
rendered="#{pc_EOAValidation.releaseDepartureDateRender }"></hx:commandExButton>

<%-- <hx:commandExButton type="submit"
value="#{giamsBundle['btn.save']}" styleClass="commandExButton"
id="btnSave" action="#{pc_EOAValidation.doSaveAction}"
tabindex="7" title="#{giamsBundle['hvr.save.assignee.record']}"
rendered="#{pc_EOAValidation.submitRender }"></hx:commandExButton> --%>
</hx:formItem>
<f:facet name="left">
<hutputText value="   " escape="false" />
</f:facet>
</hx:panelFormBox>


<f:facet name="closed">
<hx:jspPanel id="jspPanel4">
<hx:graphicImageEx id="imageEx3" styleClass="graphicImageEx"
alt="#{giamsBundle['alt.expand.morep.data']}" align="middle"
value="/theme/img/menu_bar.GIF" width="100%" height="10"></hx:graphicImageEx>
<hx:graphicImageEx id="imageExClosed2"
styleClass="graphicImageEx"
alt="#{giamsBundle['alt.expand.morep.data']}" align="middle"
value="/theme/img/icon-link-expand-dark.gif"></hx:graphicImageEx>
<hutputText id="text5" styleClass="outputText"
value="#{giamsBundle['lbl.mobility.rep.required.data']}"></hutputText>
</hx:jspPanel>
</f:facet>
<f:facet name="opened">
<hx:jspPanel id="jspPanel3">
<hx:graphicImageEx id="imageEx4" styleClass="graphicImageEx"
alt="#{giamsBundle['alt.collapse.morep.data']}" align="middle"
value="/theme/img/menu_bar.GIF" width="100%" height="10"></hx:graphicImageEx>
<hx:graphicImageEx id="imageExOpen2" styleClass="graphicImageEx"
alt="#{giamsBundle['alt.collapse.morep.data']}" align="middle"
value="/theme/img/icon-list-close.gif"></hx:graphicImageEx>
<hutputText id="text4" styleClass="outputText"
value="#{giamsBundle['lbl.mobility.rep.required.data']}"></hutputText>
</hx:jspPanel>
</f:facet>

</hx:panelSection>
</h:form>

</h:panelGrid>

</hx:scriptCollector>
</f:view>
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Please use the code button while posting code. Also, please post only the snippet where you think you have a problem.
suresh dasari
Ranch Hand

Joined: Oct 05, 2009
Posts: 121

Hi,

even I faced the same problem with inputtext disabled property.
to overcome this problem I duplicated the variables in the jspx file -- one which is visible are disabled and to have mapping with the backingbean same variable duplicated but hidden in the code, so even the inputtext is disabled the hidden variable will have mapping with the backingbean.

I dont know whether the logic I used is correct or not, please let me know if any one has an alternative for this.


Sun Certified Java Programmer with 93 percent
 
Consider Paul's rocket mass heater.
 
subject: disabled issue for inputtext
 
Similar Threads
need help in jquery
rich:dropSupport not working
Foreign key field population from datatable to textbox?
JSTL and bean data
Display background color