Validation errors reset item attributes

I have some java script code that gets executed with an onchange event to set the disable attribute of other fields. It works great. But if I get an error when validation is run, it resets the item attributes back to disable=false. Why is this and how do I get around it? Thanks in advance for your help.
Code from javascript...
function set_other_fields(pThis){
if (pThis.value == 'U') {                 
document.getElementById('P12_DEFAULT_VALUE').disabled=true;
document.getElementById('P12_DEFAULT_VALUE').value='';
document.getElementById('P12_LOOKUP_NAME_LKUP_ID').disabled=true;
document.getElementById('P12_LOOKUP_NAME_LKUP_ID').value='';
if (pThis.value == 'D') {
document.getElementById('P12_LOOKUP_NAME_LKUP_ID').disabled=true;
document.getElementById('P12_LOOKUP_NAME_LKUP_ID').value='';
document.getElementById('P12_DEFAULT_VALUE').disabled=false;
if (pThis.value == 'L') {
document.getElementById('P12_LOOKUP_NAME_LKUP_ID').disabled=false;
document.getElementById('P12_DEFAULT_VALUE').disabled=true;
document.getElementById('P12_DEFAULT_VALUE').value='';
}

Hi Kristina,
The disabled values will be reset as the page is reloaded after the validation errors and the onchange event isn't triggered.
You can force your javascript to run whenever the page is rendered (and this would be on the initial load as well), by adding a call to your function somewhere underneath both the function and all relevant fields. So, add something like the following somewhere at the bottom of your page:
<script type="text/javascript">
set_other_fields(document.getElementById("ID_of_the_field_that_has_the_onchange"));
</script>Because this isn't within a function block itself, it will be run as soon as it is loaded by the browser - hence ensuring that everything is on the page before this point.
Andy

Similar Messages

  • ESYU: MASTER ITEM ATTRIBUTE UPDATE시 발생하는 ERROR 해결

    PURPOSE
    Master Item Attribute Update 시 발생하는 문제를 Manual Fix 시킬 수 있다.
    Problem Description
    Master Item Setup 후 종종 Attribute 값을 Update 하는 경우가 발생한다.
    이때 특정 Item의 특정 Attribute를 Update시 'FRM-40654' error가 발생하는
    경우가 있다. 이는 item attribute 들의 앞이나 뒤에 blank가 들어가 있는
    경우 발생하는 문제이며 Regacy System에서 Item Import시 blank가 들어가는데
    이것이 문제의 원인이 된다.
    아래의 script를 돌려 Item Attribute에 들어가 있는 blank를 remove한다.
    Solution Description
    set serveroutput on size 1000000
    DECLARE
    len_var1 NUMBER;
    len_var2 NUMBER;
    sql_stmt VARCHAR2(450);
    ln_cursor INTEGER;
    ln_rows_proc INTEGER := 0;
    CURSOR mtl_system_columns_cur is
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'MTL_SYSTEM_ITEMS_B'
    AND DATA_TYPE = 'VARCHAR2';
    BEGIN
    for cur in mtl_system_columns_cur
    Loop
    sql_stmt := 'select nvl(length(' || cur.column_name || '),0),
    nvl(length(trim(' || cur.column_name || ')),0)';
    sql_stmt := sql_stmt || ' from mtl_system_items_b ';
    sql_stmt := sql_stmt || ' where inventory_item_id = ' || &inv_id ;
    sql_stmt := sql_stmt || ' and organization_id = ' || &org_id ;
    ln_cursor := dbms_sql.open_cursor;
    DBMS_SQL.PARSE(ln_cursor,sql_stmt,dbms_sql.native);
    DBMS_SQL.DEFINE_COLUMN(ln_cursor,1,len_var1);
    DBMS_SQL.DEFINE_COLUMN(ln_cursor,2,len_var2);
    ln_rows_proc := DBMS_SQL.EXECUTE(ln_cursor);
    IF DBMS_SQL.FETCH_ROWS(ln_cursor) > 0 then
    DBMS_SQL.COLUMN_VALUE(ln_cursor,1,len_var1);
    DBMS_SQL.COLUMN_VALUE(ln_cursor,2,len_var2);
    END IF;
    DBMS_SQL.CLOSE_CURSOR(ln_cursor);
    sql_stmt := '';
    IF (len_var1 != len_var2) then
    dbms_output.put_line('Bad Column: ' || cur.column_name);
    END IF;
    len_var1 := 0;
    len_var2 := 0;
    END LOOP;
    EXCEPTION
    when Others then
    dbms_output.put_line('Error is' || sqlerrm(sqlcode));
    end;
    commit;
    Update mtl_system_items_tl
    set description= trim(description - script 결과값);
    update mtl_system_items_b
    set description = trim(description - script 결과값);

  • Validation error :JBO-27008 vanishes by pressing submit two times???

    Hi All
    I am developing a web application using ADF BC,struts and jsp with JDEV 10.1.3.
    In my JSP page whenever I create a new record, after submit the desired record is submitted into the read-only table below, but I receive the validation error:
    JBO-27008: Attribute set for MaterialName in view object viewJoinPurchaseComplexUnit1 failed.
    Wondering that when I press the submit button again the error vanishes and my data is inserted into the database.
    I'm wondering why I have to press submit two times and then everything goes right? What is wrong among here? what should I do?

    Frank,
    The view in my BC Tester runs very well. Consider I have a viewJoin which is created by joining 4 view objects and I try to insert in one of them and the other views are reference,updateable. in my jsp page(input form) I have to fill in some reference fields in order to display the user what he has selected from the other page(handeled with javascript). Does this have something to do with the problem? when I do not fill the MaterialName field I do not encounter this problem. I have other fields like MaterialName filled from outside and are reference but they are working fine. Also, I do not have this error when Update, delete, Find/execute, and by create when I change the field materialname to null everything goes fine, but all the other transactions(Update, delete, Find/execute) cripple by that.

  • Button condition on page item and Validation error Conflict

    Hi,
    I have a select list page item and a button on page whose condition is based on the select list page item value(eg, If (:P2_item1='val1'){return true;}) with condition type=PL/SQL function returning boolean. This buttons submits the page.
    It' coming fine in normal case. However, if I select some value val2 from the list and then click the button, and if there are any validation errors (like mandatory check or email check fail etc), then the button disappears because it evaluates the button condition based on the changed value(val2), but the page has not yet been submitted because of validation errors.
    I think this can be solved if I create the button condition based upon database column value instead of page item as db col value won't change until the page is submitted.
    This look like very basic use-case and I would like to know if there is any better solution to this problem.
    Note: I am using Apex 4.2.1

    I don't want to show/hide the button on the change of the page item lov value, so i am not using Dynamic action.
    What i was is to make button visible based on a condition(which is based on page item), for which we have condition attribute of a button available.
    This is a very common thing where a user chooses the button condition as Value of item/column in expression 1 is null/expr2. But what if the user changes the page item value but it doesn't get submit due to validation error. In that case, the button condition fails.
    So, i guess i have to use column name in expression 1, can u tell how to do that?
    Expression 1 = IF (:P2_STATUS='val1') then return true;
    How to change the above to use db column 'status' instead? Any direct way(like #Status#) or I have to query db to get it using select.
    Any alternative approach?

  • Validation Error when updating Feature work item to completed state?

    We are on the latest version of TFS 2013 and have customized process templates based off of the Scrum template.
    We have a custom workflow for the Feature work item type. I get an error when trying to update the state to custom done state of "Prod Deployment Successful". The error I receive is below:
    TF237165: Team Foundation could not update the work item because of a validation error on the server etc etc.
    I have TFS Admin rights as well as project and project collection Admin rights.
    Custom States:
    Planned
    Canceled
    On Hold
    In Progress
    Ready For QA
    QA Deployment Failed
    QA Deployment Successful
    Ready For Stage
    Stage Deployment Failed
    Stage Deployment Successful
    Ready For Prod
    Prod Deployment Failed
    Prod Deployment Successful
    Custom Workflow:
    "  "  TO    Planned
    Planned  TO  Canceled
    Planned  TO  On Hold
    Planned   TO  In Progress
    In Progress TO   On Hold
    In Progress TO   Ready For QA
    On Hold  TO  In Progress
    Ready For QA  TO  QA Deployment Failed
    Ready For QA  TO  QA Deployment Successful
    QA Deployment Failed  TO  Ready For QA
    QA Deployment Failed TO   In Progress
    QA Deployment Successful TO   Ready For Stage
    QA Deployment Successful  TO  Ready For Prod
    Ready For Stage TO   Stage Deployment Failed
    Ready For Stage  TO  Stage Deployment Successful
    Stage Deployment Failed TO   Ready For Stage
    Stage Deployment Failed TO   In Progress
    Stage Deployment Successful  TO  Ready For Prod
    Ready For Prod  TO  Prod Deployment Failed
    Ready For Prod  TO  Prod Deployment Successful
    Prod Deployment Failed  TO  Ready For Prod
    Prod Deployment Failed  TO  In Progress
    I have also updated the Process Configuration file to map the states to the meta states so I can show the custom states on the Feature board. The section in the process configuration file that relates to Feature is below:
    <States>
            <State type="Proposed" value="Planned" />
            <State type="InProgress" value="Canceled" />
            <State type="InProgress" value="On Hold" />
            <State type="InProgress" value="In Progress" />
            <State type="InProgress" value="Ready For QA" />
            <State type="InProgress" value="QA Deployment Failed" />
            <State type="InProgress" value="QA Deployment Successful" />
            <State type="InProgress" value="Ready For Stage" />
            <State type="InProgress" value="Stage Deployment Failed" />
            <State type="InProgress" value="Stage Deployment Successful" />
            <State type="InProgress" value="Ready For Prod" />
            <State type="InProgress" value="Prod Deployment Failed" />
            <State type="Complete" value="Prod Deployment Successful" />
          </States>
    The error ONLY happens when I try to update a Feature state to "Prod Deployment Successful". I have looked at other posts and searched the internet and have found no help for my exact issue in TFS 2013. For some
    reason, I can't update the state from "Ready For Prod" to "Prod Deployment Successful".  Does anyone have any ideas of what could be wrong or causing my issue?
    Thanks in advance!

    I finally figured out my issue and fixed it.
    I had to update a reference name in the WIT xml file to Common.BusinessValue instead of Closed.

  • Getting mandatory attribute validation error when the value is defaulted through customization

    Hi
    I am getting Mandatory attribute validation error when we default the value through customization.
    In the UI we have attribute called Last Name which is mandatory at EO level. Customer wanted to default Last name to some value, through page composer it is defaulted to some text and saved.
    When ever we open the page the the same value is defaulted as Last Name and appearing in the UI. But when we submit the page, EO level validation is failing. hence we are getting last name is missing.
    When i debug the code last name attribute value for EO is blank.
    In the UI the attribute last name is associated with bindings  --> #{bindings.lastname.inputvalue}
    The validation is failing if we remove the default binding associated with inputtext box.
    Can some body help what can be reason and is there any solution?
    Thanks,
    Praveen

    version 12.1.2
    I am struggling with same situation, I can't set the default value at business component because, the default value comes from a REST service at run time. In page A,  I have a field F1 that contains value from REST service. Page B has a database bound field F2, whose default value should come from F1 in Page A when a user navigates from Page A to Page B. If I set the value of F2 to be the value of F1, then it displays the value in the UI, but nothing gets submitted to EO and fails at commit.
    To make things difficult, here is my situation: Page A lives in bounded taskflow TF1, and Page B lives in bounded taskflow TF2. So I have created an input parameter P1 in TF 2, which carries over the value of F1 in Page A to Page B. When I am in Page B, I can successfully see the value of the taskflow input parameter P1. So, how do I  programmatically set the value of field F2 with the value of input parameter P1?
    I tried setting the F2.inputValue  in a method call M1 in  taskflow TF2 prior to Page B, but I get null pointer exception as it can't see field F2 yet.
    It seems like a simple thing to do, but I have spent a lot of time trying to make it work without any success.
    I would greatly appreciate any guidance.

  • Translated item labels swap to original language after validation error

    Hello,
    I've the weird behaviour in my application that translated item labels change to the original label name in case a validation error on that item occurs. I am displaying inline+notification errors. Only the labels of the "error-items" show the behaviour. What is this and how can I fix it.
    Many thanks in advance!
    Jacob

    Hi Arie,
    It might be I'm not using translated applications in the right way then. What I do is I always leave the language of the application: application primary language
    In order to switch from language I change the primary language from dutch to french or vice versa. In this way, the application language changes accordingly from dutch (original) to french (translated). f this is not the proper way, what do you suggest?
    In case a validation error occurs on an item with label "NAAM". The error is displayed inline with that item and in the notification area, and the item label is now "NOM"
    Apex version is 3.1.0
    Hope this makes things clearer.
    Jacob

  • Weird attribute validation error

    Hi!
    I'm trying to get an XML message to validate in Spring WS. I have the following XML Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema version="1.0"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               elementFormDefault="qualified"
               targetNamespace="http://namespace.lantmateriet.se/distribution/products/geoaccess/admindirekt/v1"
               xmlns:app="http://namespace.lantmateriet.se/distribution/products/geoaccess/admindirekt/v1">
      <xs:element name="FindCountyRequest">
        <xs:complexType>
          <xs:choice>
            <xs:element name="id" type="xs:string"  form="unqualified"/>
            <xs:element name="name" type="xs:string"  form="unqualified"/>
          </xs:choice>
          <xs:attribute name="detail" use="required">
              <xs:simpleType>
                  <xs:restriction base="xs:string">
                      <xs:enumeration value="GENERAL"/>
                      <xs:enumeration value="DETAILED"/>
                  </xs:restriction>
              </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
      </xs:element>
    </xs:schema>When I send the following message...:
    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
                   xmlns:app="http://namespace.lantmateriet.se/distribution/products/geoaccess/admindirekt/v1"
       <soap:Header/>
       <soap:Body>
          <app:FindCountyRequest detail="DETAILED">
             <id>21</id>
          </app:FindCountyRequest>
       </soap:Body>
    </soap:Envelope>...I get this error:
    WARN  XML validation error on request: cvc-complex-type.3.2.2: Attribute 'detail' is not allowed to appear in element 'app:FindCountyRequest'. at org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor.handleRequestValidationErrors(AbstractFaultCreatingValidatingInterceptor.java:154)
    WARN  XML validation error on request: cvc-complex-type.4: Attribute 'detail' must appear on element 'app:FindCountyRequest'. at org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor.handleRequestValidationErrors(AbstractFaultCreatingValidatingInterceptor.java:154)What?! How come it says that I must have the attribute and that, at the same time, it is not allowed?
    Any ideas?
    Thanks!

    I've come to the conclusion that the attribute is in the wrong namespace.
    How do I fix the schema so that the message validates?

  • Validation error 'Item not found' in Middleware

    Hi,
    In the middleware monitor, I have some bdocs failed with the validation error ' Item was not found. Validation error occured. module CRM_DOWNLOAD_BEA_VAL, BDoc Type BEABILLDOCCRMB'.
    When i look at the document numbers associated , they do exist.
    It is in this state for a long time.
    Can anyone help.
    Regards,
    Pratima

    Hi Venkat,
    There are no messages in the outbound or inbound queue releated to these bdocs.
    These bdocs exist only in the monitor with validation error.
    Regards,
    Pratima

  • Error in CNS0 :Sales unit is not valid for the item

    Dear Team ,
    we are using assembly process ,after creation of project from sales order ,requirments are pass to production planning (PP), Asign the bom to activites then we are going to delivery through project (cns0) at the time system shows error" sales unit is not valid for the item" we check the options in material master .please  help me on this issue.
    Thanks &Regards
    R.B.RAO

    Have a look at the following note:-
    Note 140551 - VL384 Stock transport order and batch selection
    G. Lakshmipathi

  • Error in TextField Validation Widget reset() method

    There appears to be an error in the Textfield Validation
    Widget's reset() method. When I set the widget to "real" or
    "custom" validation, the reset() method is throwing an error when
    it reaches the line "this.oldValue = this.input.defaultValue;"
    I seached the code and it appears that
    "this.input.defaultValue" is not set anywhere else. Is there a
    missing option, or is this line incorrect and copied over from
    another widget that uses "defaultValue"?

    It looks as though you're trying to use main-content as a CSS selector. If it's a class, it should begin with a dot (period) like this:
    .main-content
    If it's an ID selector, it should begin with a hash:
    #main-content

  • How to fire a clear item process on validation error

    Hi
    this is probably a simple one but eludeing me at the mo...
    I have 2 password fields > password and verify password respectively.
    I want to be able to clear both fields in the event the password verification validation fails.
    I have created a clear cache process with the condition set to 'When inline validation errors displayed' but i don't think the flow of logic goes as far as the processes after validation errors occur??
    anybody got a work around?

    You can use a function returning boolean validation and when it fails set the items to null before returning false, e.g.,
      if :OLD_PW <> :NEW_PW then
        :OLD_PW := null;
        :NEW_PW := null;
        return false;
      end if;Scott

  • Attribute validation error for tag CFQUERY

    I have a CF application that's running fine on a shared host. I now have a VPS running version of CF 9. When I try to use this on the VPS, I get the following error:
    Attribute validation error for tag CFQUERY.
    The value of the attribute datasource, which is currently '', is invalid.
    The datasource is being set in application.cfc, and again works just fine in the shared environment.
    The only differences is the shared is running on Windows, and the VPS is Linux. Also, the Windows is running version 9,0,1,274733 and the Linux is 9,0,0,251028
    Any help would be greatly appreciated.

    bbholdem wrote:
    I have a CF application that's running fine on a shared host. I now have a VPS running version of CF 9. When I try to use this on the VPS, I get the following error:
    Attribute validation error for tag CFQUERY.
    The value of the attribute datasource, which is currently '', is invalid.
    The cause of the error is obvious. Somewhere in your application, the cfquery tag is used as follows, with an empty string as datasource:
    <cfquery datasource="">
    </cfquery>
    That is a mistake. The error message should tell you where that occurs.

  • Attribute Validation error.     

    I keep getting this error. It is so damn vague.

    Exceptions
    13:27:07.007 - Template Exception - in D:\Coldfusion
    Applications\b2\security tests\control.cfm : line 34
    Attribute Validation error.

  • Validation error corrupts component tree?

    I've got a strange problem trying to use validation on input fields.
    The basic setup is as follows:
    I've got a page divided into two parts with separate h:form tags, the one holding a dataTable with some elements and the other showing the element details in inputFields once an item is selected in the dataTable via a commandLink. A commandButton on the detail side allows you to update the values of the selected item which is being reflected in the dataTable on reload. So far so good.
    Here comes the strange part:
    All the inputFields are marked required. Now once you leave a field empty and try to submit the form, you get a validation error as expected. BUT if you now select a different element from the dataTable, ONLY the field whose validation formerly failed is being updated, the other fields still show the same value as before. The backing bean method that belongs to the commandLink is being executed, and the underlying data object of the input fields is being set properly, only the values in the component tree aren't updated. This behaviour persists until you enter a valid value in the formerly invalid input field and submit. Debugging shows that as long as at least one field has had validation errors, only the getter of these backing beans properties are being invoked during render response phase, as opposed to the "normal" case where the getters of all the backing beans properties are being called.
    For some reason, the render response phase seems to ignore the other components in the component tree when there was some validation error on one or more fields.
    Another interesting observation:
    This is the behaviour if I don't specify an action attribute in the commandLink selecting an element from the dataTable, as I want to return to the same page again. But if I define a navigation case that brings me to the same page and put that into the action attribute, the problem doesn't occur. Unfortunately this is no option for me, as I'm aiming to do all this with ajax.
    I've created a simple example so you can try out yourself:
    test.jsp:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <html>
    <head>
    <title>validator test</title>
    </head>
    <body>
    <f:view>
         <h:form id="form1">
              <h:dataTable id="table" value="#{bean.datas}" var="data" binding="#{bean.table}" border="1">
                   <h:column>
                        <h:commandLink actionListener="#{bean.selectData}" value="#{data.string1}" />
                   </h:column>
                   <h:column>
                        <h:outputText value="#{data.string2}" />
                   </h:column>
              </h:dataTable>
              </h:form>
         <hr />
         <h:form id="form2">
              <h:inputText value="#{bean.data.string1}" id="field1" required="true" />
              <h:inputText value="#{bean.data.string2}" id="field2" required="true"/>
              <h:commandButton value="submit" />
         </h:form>
    </f:view>
    </body>
    </html>Bean.java:
    needs to be defined in faces-config.xml as bean "bean" with session scope
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.component.html.HtmlDataTable;
    import javax.faces.event.ActionEvent;
    public class Bean {
         private Data data;
         private List<Data> datas;
         private HtmlDataTable table;
         public Bean() {
              datas = new ArrayList<Data>();
              datas.add(new Data("data1value1","data1value2"));
              datas.add(new Data("data2value1",""));
         public void selectData(ActionEvent event) {
              data = (Data)table.getRowData();
         public List<Data> getDatas() {
              return datas;
         public Data getData() {
              return data;
         public void setData(Data data) {
              this.data = data;
         public HtmlDataTable getTable() {
              return table;
         public void setTable(HtmlDataTable table) {
              this.table = table;
         public class Data {
              private String string1;
              private String string2;
              public Data(String string1, String string2) {
                   this.string1 = string1;
                   this.string2 = string2;
              public String getString1() {
                   return string1;
              public void setString1(String value) {
                   string1 = value;
              public String getString2() {
                   return string2;
              public void setString2(String value) {
                   string2 = value;
    }My system setup:
    WinXP Professional
    JDK 1.6.0-b105
    Tomcat 5.5.20 (also tried 6.0.7)
    JSF RI 1.1.02_b08 (also tried 1.2_04-b10-p01, different but anyway not expected behaviour with MyFaces 1.1.5)
    Thanks for any input,
    Harry.

    Is there noone here who can tell me if this is behavior like specified or if I miss some point?
    A possible solution seems to be telling JSF programmatically to rebuild the view root. Does anyone if this is possible?

Maybe you are looking for