Submit values despite of immediate="true"

Hi,
This is my first try to post a question. So please don't be angry with me if my post isn't perfekt. :-)
I have a JSP with serveral inputText-fields. Each field is required and has a lick to a special search-JSP. To release the link without having the input-fields validated at this moment I had to add the attibute immediate="true". If I fill the input-field while choosing a value from the search-JSP the value will be submitted to the bean. Now my Problem: If I fill the first field without searching with the Link an then try to fill the second field while releasing the link, the first value disappears. (because of the attribute immediate it is not going to be submitted). Is there a possibility to submit this value despite of immediate="true".
I tried to add <f:param> to the link. This seems a possibility. But it could be that I have up to six input-field like this. In this case I habe to sumbit 5 values and this six times. That seems too much. And I hope there is another way to do it.
To clarify my problem here is a reduced and simplified part of my code:
<h:panelGroup>
     <h:outputText value="Field1" />
     <h:commandLink value="Search" action="#{pc_Test.executeSearch1}" immediate="true" />
     <h:inputText id="field1" value="#{pc_Test.field1}" required="true" />
     <h:message for="field1" />
</h:panelGroup>
<h:panelGroup>
     <h:outputText value="Field2" />
     <h:commandLink value="Search" action="#{pc_Test.executeSearch2}" immediate="true" />
     <h:inputText id="field2" value="#{pc_Test.field2}" required="true" />
     <h:message for="field2" />
</h:panelGroup>At the end of the JSP is the submit-Button. If this is clickes the fields will be validated.
I hope you can help me.
Thanx in advance.
Steffi

The immediate="true" attribute in the UICommand will skip under each the update model values phase.
You may find this article useful to get some more insights in the JSF lifecycle:
http://balusc.blogspot.com/2006/09/debug-jsf-lifecycle.html

Similar Messages

  • H:inputText and immediate="true" not updating cached backing bean value

    Hi,
    I am having a problem with h:inputText and immediate="true" when
    returning back to the same page.I looked through the forums but the
    only solution to remove the page from the session works only if I
    don't have to change any button label names in the page I am going back
    to.Unfortunately, I have to change a button name when I go back to the
    same page.The button name change works if i don't remove the page from
    session but then h:inputtext has stale values in it from the backing
    bean.I also need to avoid validation as it is a huge form.
    I have tried looking through the JSF forums but they didn't have any
    answers for a very similar question.
    I am not sure how exactly to use component binding for the input text and update the model values using an actionListener.I have tried puting a binding on an input text field and then used an actionListener instead of immediate="true' in the h:commandLink.But, putting context.renderResponse() in the actionListener method results in the model values not getting updated.
    I have also tried using component.processUpdates(facesContext) as in the UpdateModelValuePhase class -that too doesn't work.
    Thanks for any help,
    Vijay
    Details:
    The <h:inputText ..> does not populate the values back from a backing
    bean when immediate="true" is used when an action is called.
    <h:commandLink id="selectPrincipalId"
    action="#{application.selectPrincipal}" immediate="true">
    Only <h:inputText has the cached values from the first entry.
    <h:inputText id="principalLastName1Id"
    value="#{application.currentPrincipal.lastName}" size="10"/><== this
    has the cached value from the backing bean application.
    <h:outputText gets the new values from the backing bean when the same
    page is reentered.
    <h:outputText value="#{application.currentPrincipal.lastName}"></h:outputText><==
    this refreshes with the new value from the backing bean application.
    Here is the solution to rectify the problem:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    Map sessionMap = externalContext.getSessionMap();
    sessionMap.remove("/jsp/befg/tc/apply/enterCreditApplication.jsp");
    <== this is the name of the jsf page as defined in the
    faces-config.xml.

    Hi,I have encountered the same problem as you,and I find a solution myself,which is shown as follows,but I don't know if these is any hidden trouble in the code.
    <h:form>
    <h:commandLink action="#{app.action}" immediate="true" actionListener="#{app.update}">xxxx</h:commandLink>
    <h:inputText id="_id" value="#{app.val}" immediate="true"/> //must set immediate="true" else the model will be not updated
    <h:message for="_id"/>
    </h:form>
    public class App{
    public void update(ActionEvent event){
         FacesContext c = FacesContext.getCurrentInstance();
         UIViewRoot root =c.getViewRoot();
         root.processUpdates(c);//to update model and short-circuit the validators
    in such circumstance,the UIViewRoot's processUpdates method will be called in the actionlistener,and the back bean who titled to immediate(true)'s inputText will be updated, but the one who titled to immdiate(false)'s inputText will not be updated,Why?
    Can anyone tell me way?and how to solve?
    Thanks a lot!

  • Is it possible to submit and bypass validation without Immediate = true?

    I am using JDeveloper 11.1.1.6.0.
    On our form, we have a "Save" button that properly persists the binding data so that the user can come back and finish filling out the task that they are on later. For this to function properly, the save button needs to have the information on the form to be submitted. If we have no validation, and we have no required fields set, this function works properly. However, if we have any required fields that have not been filled out, the save action is not able to occur until the valiation errors have been corrected.
    We have tried changing it so that the save button has "immediate=true" set, however that causes the form data not to be submitted and thus, not persisted.
    We have also tried "immediate=true" and setting the form fields to "autoSubmitt=true", but this causes issues when we later have to clear out the data in an inputDate field. In this instance, we receive an illegal argument exception stating that the timestamp must be in format yyyy-mm-dd hh:mm:ss[.ffffffff]. We only see this error when "autoSubmit" is set to true on the field however, as we then need to also ensure that the back end data is cleraed in addition to the field's value as otherwise the field's value never is cleared.
    Is it possible to have a component submit without validation, and without being immediate? Or is this not possible?
    (On a side note, we've also noticed that if there are components that are set to "immediate", they can throw validation errors when a our save button is pressed and set to immedate, though none of the other fields throw errors)
    Thank you

    Hi,
    I understand you have a save as draft functionality. There is no way other than to use immediate=true (which doesn't work for you) or not using field validation at all to get this use case working. Also note that right now you deal with client side validation errors; when you submit the form, bypassing client side validation you will hit binding level validation, for which you need to set skip validation to true
    See this: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/40-ppr-subform-169182.pdf
    Frank

  • Strange behaviour on delete button with immediate=true

    Hi, I'm using JDev11.1.1.2
    I have dragged a view object as a editable form on the page.I added navigation + delete/create buttons.
    As I see it all delete buttons should be immediate=true, because I want the user to be able to delete the current row despite validation errors (or maybe this is achievable some other way ? )
    But now when I press the delete button, only the readonly fields are updated with next record in the iterator, but the input fields are not updated (they remain with the delete row's values).
    If I set disable=true to an inputField, then it gets updated with the next row's value.
    I tried with partialTriggers on the inputFields to the delete button - but no luck!
    Why I get this different behaviour on inputFields and outputText when the delete button is immediate=true?
    And how to deal with this problem?
    Thank you!

    Thank Frank for the answer, but still no luck
    Here is my code:
    <af:form id="f1" partialTriggers="cb6">
         <af:panelFormLayout id="pfl1" partialTriggers="cb6">
           <af:inputText value="#{bindings.Kod4.inputValue}"
                             required="true"
                             id="it1" partialTriggers="cb6">
         </af:inputText>
         <af:outputText value="#{bindings.Kod4.inputValue}" id="out1"/>
         <af:commandButton actionListener="#{bindings.Delete.execute}"
                               text="Delete" immediate="true" partialSubmit="true"
                               id="cb6"/>
         </af:panelFormLayout>
    </af:form>As you can see there are one output and one input field for a same attribute ... the output field gets updated on delete, but the input - doesn't
    There are partialTriggers and partialSubmit but still no luck
    My view is really a simple one - 3 fields, based on an entity. Tried with different view objects - still the same effect occurs.
    I don't see how a delete button can be of any help to the user if it is NOT immediate=true. I cannot add a row and delete it right away if there are validation errors
    Please help!
    Thanks

  • Popup cache with button has property immediate="true"

    Hi
    I am using jdevloper 11.1.2.2
    I have caching  problem with popup has contentDelivery="lazyUncached" and I add cancel  button on popup with  immediate="true" to skip validation in input fields at popup.
    After I click cancel button it hide popup , but again If I show popup, it still cache old data in input feilds.
    My popup source is as below
    <af:popup childCreation="deferred" id="compPop"
                      binding="#{pageFlowScope.CustomersBean.compPop}" autoCancel="disabled" contentDelivery="lazyUncached">
                <af:dialog id="d1" title="#{viewcontrollerBundle.COMPANY} #{pageFlowScope.mode}" closeIconVisible="false"
                           type="none">
                    <f:facet name="buttonBar">
                        <af:toolbar id="t2">
                            <af:commandButton text="#{viewcontrollerBundle.SAVE}" id="cb6"
                                              actionListener="#{pageFlowScope.CustomersBean.onClickSaveCompPop}"/>
                            <af:commandButton text="#{viewcontrollerBundle.CANCEL}" id="cb7"
                                              actionListener="#{pageFlowScope.CustomersBean.onClickCancelCompPop}"
                                              immediate="true"/>
                        </af:toolbar>
                    </f:facet>
                    <af:panelFormLayout id="pfl1">
                        <af:inputText value="#{bindings.CompanyNumber.inputValue}"
                                      label="#{bindings.CompanyNumber.hints.label}"
                                      required="#{bindings.CompanyNumber.hints.mandatory}"
                                      columns="#{bindings.CompanyNumber.hints.displayWidth}"
                                      maximumLength="#{bindings.CompanyNumber.hints.precision}"
                                      shortDesc="#{bindings.CompanyNumber.hints.tooltip}" id="it1">
                            <f:validator binding="#{bindings.CompanyNumber.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.CompanyName.inputValue}" label="#{bindings.CompanyName.hints.label}"
                                      required="#{bindings.CompanyName.hints.mandatory}"
                                      columns="#{bindings.CompanyName.hints.displayWidth}"
                                      maximumLength="#{bindings.CompanyName.hints.precision}"
                                      shortDesc="#{bindings.CompanyName.hints.tooltip}" id="it2">
                            <f:validator binding="#{bindings.CompanyName.validator}"/>
                        </af:inputText>
                        <af:selectOneChoice value="#{bindings.CompCategory.inputValue}"
                                            label="#{bindings.CompCategory.label}"
                                            required="#{bindings.CompCategory.hints.mandatory}"
                                            shortDesc="#{bindings.CompCategory.hints.tooltip}" id="soc3">
                            <f:selectItems value="#{bindings.CompCategory.items}" id="si3"/>
                        </af:selectOneChoice>
                        <af:selectOneChoice value="#{bindings.City.inputValue}" label="#{bindings.City.label}"
                                            required="#{bindings.City.hints.mandatory}"
                                            shortDesc="#{bindings.City.hints.tooltip}" id="soc4">
                            <f:selectItems value="#{bindings.City.items}" id="si4"/>
                        </af:selectOneChoice>
                        <af:inputText value="#{bindings.Tele1.inputValue}" label="#{bindings.Tele1.hints.label}"
                                      required="#{bindings.Tele1.hints.mandatory}"
                                      columns="#{bindings.Tele1.hints.displayWidth}"
                                      maximumLength="#{bindings.Tele1.hints.precision}"
                                      shortDesc="#{bindings.Tele1.hints.tooltip}" id="it3">
                            <f:validator binding="#{bindings.Tele1.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.Tele2.inputValue}" label="#{bindings.Tele2.hints.label}"
                                      required="#{bindings.Tele2.hints.mandatory}"
                                      columns="#{bindings.Tele2.hints.displayWidth}"
                                      maximumLength="#{bindings.Tele2.hints.precision}"
                                      shortDesc="#{bindings.Tele2.hints.tooltip}" id="it4">
                            <f:validator binding="#{bindings.Tele2.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.Fax.inputValue}" label="#{bindings.Fax.hints.label}"
                                      required="#{bindings.Fax.hints.mandatory}"
                                      columns="#{bindings.Fax.hints.displayWidth}"
                                      maximumLength="#{bindings.Fax.hints.precision}"
                                      shortDesc="#{bindings.Fax.hints.tooltip}" id="it5">
                            <f:validator binding="#{bindings.Fax.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.Website.inputValue}" label="#{bindings.Website.hints.label}"
                                      required="#{bindings.Website.hints.mandatory}"
                                      columns="#{bindings.Website.hints.displayWidth}"
                                      maximumLength="#{bindings.Website.hints.precision}"
                                      shortDesc="#{bindings.Website.hints.tooltip}" id="it6">
                            <f:validator binding="#{bindings.Website.validator}"/>
                        </af:inputText>
                    </af:panelFormLayout>
                </af:dialog>
            </af:popup>

    Hi,
    can you try and add the af:resetActionListener tag to the cancel button ?
    http://docs.oracle.com/cd/E28280_01/apirefs.1111/e12419/tagdoc/af_resetActionListener.html
    Frank

  • ActionListener  for commandButton not being called after Immediate='true"

    I have a form with multiple Boolean buttons. The inputText under these fields need to be validated. I am using
    <af:selectBooleanRadio
    group="OMSHostType" id="radio1"
    text="#{ad4jRscBundle.SAMEHOST} "
    autoSubmit="true" immediate="true"
    valueChangeListener="#{viewScope.emas_view_ad4jMngrDeploy_Ad4jMngrDeployHomeView.setSameHost}"
    shortDesc="#{ad4jRscBundle.SAMEHOSTHELPTEXT}"
    selected="#{viewScope.emas_pagemodel_ad4jMngrDeploy_Ad4jMngrDeployHomePageModel.sameHost}"/>
    I am using an explicit valueChangeListener to update the radio button values. I have multiple such radio buttons and each field have some exclusively mandatory attributes.
    My CommandButton Deploy has stopped calling the actionListener after i made the above changes.It calls the listener if I set immediate="true" in the commandButton also but that bypasses the validation phase, a result which is not desired.
    <af:commandButton id="submitCommandButton1"
    text="#{ad4jRscBundle.DEPLOY}"
    partialSubmit="true"
    immediate="true"
    action="goto_deployProgress"
    actionListener="#{viewScope.emas_view_ad4jMngrDeploy_Ad4jMngrDeployHomeView.submit_Ad4jMngrJob}"
    />
    Any idea why immediate attribute is capable of changing the commandButton's properties?

    Hi,
    without setting immediate=true, the command button action listener executes in teh InvokeApplication phase. Setting it to true invikes it in the earier ApplyRequestValue phase. Buttons that have immediate=true set skip all model updates and validation and instead directly render the response. My suggestion is to set immedatiate=false on the selectBooleanRadio - or is there are reason why you want to have this executing early in teh lifecycle?
    Frank

  • Global problem with immediate="true"

    JSF specifies that immediate="true" in UICommands should skip the Validation and Update Model phases.
    The RI uses the Update Model phase to reset the local values of the input components after updating the model. That means that in the case of immediate="true", the local values are not reset, and thus saved by the state manager.
    The problem is that the next display of the page shows the previously entered values, instead of getting the values from the model, which is somewhat strange for a 'cancel' button.
    I think this is mainly a problem with the spec which clearly indicates that the clearing of the local values should be done in the update model phase.
    Is it possible to have a workaround for this ?

    the previous posts have been made long ago, but I'll give it a try:
    I think this behavior is still buggy or at least not logical.
    Example:
    I've got a dataTable which shows a list of entries, each row with an "edit" commandButton and a "new" commandButton below the list.
    If the user clicks an "edit" button, he is redirected to the "details" page where he can edit and save the values of this entry. This works as expected. But: On the "details" page, there's also a "cancel" button, which should navigate to the list again, without doing any validation or updating.
    If I set this "cancel" button to "immediate", navigation works, but then I'll always see the values of the canceled entry, regardless of which "edit" button I click in the list.
    If the "cancel" button is not immediate, validation fails when the user clicks "new" and then "cancel", because he gets an empty form, but some or all fields are required.
    There are two workarounds:
    1) Creating two different views, one for creating a new entry and one for editing.
    2) The "cancel" button is a simple html-button, with the "onlick='location.href=xxxyyy'" attribute.
    IMHO both workarounds are ugly. So, why is the view ignoring that there is a complete different entry object in the backing bean of the "details" input fields???
    BTW: I'm using JSF SUN RI 1.1.01 (same with 1.2 current snapshot).
    With MyFaces, everythings works but it has some other bugs, so I want to stick to the Sun RI.
    Thanks,
    Walter

  • Button action bypass validation without using Immediate=true

    I have a Form in a page, and a "Query" button to popup a dialog for user to search some information, and help user to fill-in some fields.
    I want the "Query" button to ignoral all the validations in the Form (e.g.: required fields). I tried to set the Immedate for the button, but I found I cannot set any inputText value inside ReturnListener event-handler with Immedate is true.
    Is there anyway to have a button to action, and bypass all the validation without using Immediate=true?
    Thanks,
    Samson Fu

    Hi,
    if you are on JDeveloper 11g, have a look at the skipValidation property on the ADF binding and read: http://oracle.com/technology/products/jdev/tips/fnimphius/ppr_subform/index.html
    You can implement a similar approach
    Frank

  • Problem with immediate="true" used with inputText

    Hi everybody,
    I have two component, A and B, of type inpuText. When A is updated, I want B to be updated according to the value provided in A.
    I have to use immediate=True + context.renderResponse because I'm using some converters and validators because I want to avoid error messages being displayed at that point.
    I'm using partialtrigger to tell B to refresh himself when A changes it's value.
    This doesn't work.
    If I'm using the same code, but with ouputText instead, everything works!
    the code looks like this:
    <af:inputText id="A" styleClass="normalInputText"
    label="A" simple="true"
    value="#{controller.formBean.A}"
    valueChangeListener="#{controller.updateB}"
    autoSubmit="true" immediate="false"/>
    <af:inputText id="netAmount" styleClass="normalInputText"
    label="B" simple="true"
    value="#{controller.formBean.B}"
    partialTriggers="A">
    public void updateGrossPriceDependentFields(ValueChangeEvent event)
    FacesContext context = FacesContext.getCurrentInstance();
    formBean.setA((Long)event.getNewValue());
    if(formBean.getA().intValue() == 0)
    formBean.setB(new Long(222));
    else
    formBean.setB(new Long(0));
    context.renderResponse();
    Any ideas?

    Hi ,
    Just Try with this instead of context.renderResponse();
    Context.addPartialTarget(ComponantNAME);
    So that it will get refreshed
    RHY
    Message was edited by:
    RHY

  • Problem with immediate=true, maybe a Bug

    I'm using a dataTable for selecting an user. The selected userBean will be put to the session context with id "selectedUser". The next page allows to edit users values. This edit page contains a cancel button with immedtiate=true param to abort editing and go back to the list. The edit page contains some input fields like:
    <h:inputText id="firstName" value="#{selectedUser.firstName}" />
    <h:inputText id="lastName" value="#{selectedUser.lastName}" />
    These fields are showing correct values for the selected user. But after selecting another user from the list the edit page is showing the values of the previous selected user! By selecting the second user again and again after a while the edit page shows the correct values.
    Well, I've added a JSP expression to the edit page to show me if the selected user is the right one "Edit User (${selectedUser})". The value of this expression always shows the correct selected user.
    If I modify the command button from:
    <h:commandButton action="users" value="Cancel" immediate="true" />
    to:
    <h:commandButton type="reset" onclick="window.location.href='/faces/users'" value="Cancel" />
    the problem does not appear!!!
    For me it looks like a bug. Any ideas?
    Thx,
    Wolfgang

    Sorry for the imcomplete testcase, here it comes again:
    --- Users.java ---------------------------------------------
    package jsf.test;
    import java.util.ArrayList;
    import javax.faces.context.FacesContext;
    public class Users
    private ArrayList users;
    public Users()
    super();
    users = new ArrayList();
    users.add(new User("User_A", "firstName_A", "lastName_A"));
    users.add(new User("User_B", "firstName_B", "lastName_B"));
    users.add(new User("User_C", "firstName_C", "lastName_C"));
    public ArrayList getUsers()
    return users;
    public String edit()
    FacesContext context = FacesContext.getCurrentInstance();
    User user = (User)context.getExternalContext().getRequestMap().get("user");
    System.out.println("selectedUser: " + user);
    context.getExternalContext().getSessionMap().put("selectedUser", user);
    return "navToUser";
    --- User.java ---------------------------------------------
    package jsf.test;
    public class User
    private String loginName;
    private String firstName;
    private String lastName;
    public User()
    public User(String loginName, String firstName, String lastName)
    this.loginName = loginName;
    this.firstName = firstName;
    this.lastName = lastName;
    public String getLoginName()
    return loginName;
    public void setLoginName(String loginName)
    this.loginName = loginName;
    public String getFirstName()
    return firstName;
    public void setFirstName(String firstName)
    this.firstName = firstName;
    public String getLastName()
    return lastName;
    public void setLastName(String lastName)
    this.lastName = lastName;
    public String update()
    System.out.println("user update: " + this);
    return "navToUsers";
    public String toString()
    return firstName + " " + lastName;
    --- users.jsp ---------------------------------------------
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <body>
    <f:view>
    <h:form id="selectUser">
    <b>Users</b><p>
    <h:dataTable id="users" value="#{users.users}" var="user">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Login Name" />
    </f:facet>
    <h:commandLink action="#{users.edit}">
    <h:outputText value="#{user.loginName}"/>
    </h:commandLink>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First Name" />
    </f:facet>
    <h:commandLink action="#{users.edit}">
    <h:outputText value="#{user.firstName}"/>
    </h:commandLink>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last Name" />
    </f:facet>
    <h:commandLink action="#{users.edit}">
    <h:outputText value="#{user.lastName}"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    --- user.jsp ---------------------------------------------
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <body>
    <f:view>
    <h:form>
    <b>User</b><p>
    <h:panelGrid columns="2" cellpadding="5">
    <h:outputText value="Login Name" />
         <h:inputText id="lognName" value="#{selectedUser.loginName}"/>
    <h:outputText value="First Name" />
         <h:inputText id="firstName" value="#{selectedUser.firstName}"/>
    <h:outputText value="Last Name" />
         <h:inputText id="lastName" value="#{selectedUser.lastName}"/>
    <h:outputText value=" " />
    <h:panelGroup>
    <h:commandButton action="navToUsers" value="Cancel" immediate="true"/>
    <%-- <h:commandButton type="reset" onclick="window.location.href='/faces/users.jsp'" value="Cancel"/> --%>
    <h:outputText value=" " />
    <h:commandButton action="#{selectedUser.update}" value="OK"/>
    </h:panelGroup>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    --- faces-config.xml ---------------------------------------------
    <managed-bean>
    <description>
    Bean for TEST users.
    </description>
    <managed-bean-name>users</managed-bean-name>
    <managed-bean-class>jsf.test.Users</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
    <description>
    Bean for TEST user.
    </description>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>jsf.test.User</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/users.jsp</from-view-id>
    <navigation-case>
    <from-outcome>navToUser</from-outcome>
    <to-view-id>/faces/user.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/user.jsp</from-view-id>
    <navigation-case>
    <from-outcome>navToUsers</from-outcome>
    <to-view-id>/faces/users.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>

  • Urgent Issue - Immediate=true vs Detail form behavior

    I have an ADF Faces Master Table and a Detail Form (both on the same page - this is a functional requirement). They were created using the ADF Faces Master Table Detail Form Control and are based on a Master Detail Entity based View Object.
    The underlying Entity Object has some basic validations (ex: Required Name, Address)
    I have different actions in the page (Save, Add, Delete), all of them execute the corresponding data control methods.
    For Delete and Add I want to bypass input validation so I set immediate="true". So far so good.
    Now the issue (or bug):
    1. The user selects a record from the master table.
    2. The user modifies some values of that record in the detail form (ex: name).
    3. The user hits Save - > Values are committed to the database and the master table is refreshed with the detail values.
    4. The user hits Add (note that previous values are still there).
    5. The user enters Add mode but the values from the previous record are still there.
    Correct behavior should be that the current form values are cleared out when hitting add.
    I already tried the following in the Entity Object Impl class with no luck:
    protected void create(AttributeList attributeList) {
    setName("");
    super.create(attributeList);
    The only way I see it works is by setting immediate="false", but validations are not bypassed here.
    Any suggestions / experience with this issue is greatly appreciated.
    Thanks,
    Claudio.

    Hi there, I had the same problem and between us at work we spent 5 days trying to figure this out. The solution is:
    * The 'Cancel' commandButton (or commandLink) has immediate="true"
    * The inputText fields do not specify immediate (and are therefore immediate="false")
    * The action in the backing bean invoked on Cancel click must return an outcome, eg. "list"
    * There must be a navigation rule in faces-config.xml for the action, eg. as follows
    <navigation-rule>
         <from-view-id>/Admin.jsp</from-view-id>
         <navigation-case>
              <from-outcome>list</from-outcome>
              <to-view-id>/Admin.jsp</to-view-id>
         </navigation-case>
    </navigation-rule>* sessionMap.remove("/Admin.jsp") is not necessary
    If the action outcome string is null or cannot be found in faces-config.xml, then stale values from the component tree are re-displayed - the bane of many JSF programmers lives. Tinkering with the UIViewRoot seems to have no effect.
    Hope this help...
    - Adam.

  • Dialogue tick boxes un-hiding all fields, not just the ones where value has changed to true

    I am hoping someone can help me make what I want to happen, happen if certain check boxes are ticked withing the dialogue box
    right now I can see on the console print that the tick box turns the value from false to true but the OK button is also un-hiding all my fields rather than just the ones where the value has turned to true. What am I missing here
    //Create a Dialogue box for staff to state how many of the account owners are in branch in order for the names to show in the signing section
    var Signors =
        result:"cancel",
        DoDialog: function(){return app.execDialog(this);},
        bChk2:false,
        bChk3:false,
        bChk4:false,
        bChk5:false,
        initialize: function(dialog)
            var dlgInit =
                    "Chk2": this.bChk2,
                    "Chk3": this.bChk3,
                    "Chk4": this.bChk4,
            dialog.load(dlgInit);
        commit: function(dialog)
            var oRslt = dialog.store();
            this.bChk2 = oRslt["Chk2"];
            this.bChk3 = oRslt["Chk3"];
            this.bChk4 = oRslt["Chk4"];
        description:
            name: "Signors",
            elements:
                    type: "view",
                    elements:
                            type: "view",
                            char_height: 10,
                            elements:
                                    type: "static_text",
                                    item_id: "stat",
                                    name: "Who is here to sign:",
                                    char_width: 15,
                                    alignment: "align_fill",
                                    font: "dialog",
                                    type: "view",
                                    char_width: 8,
                                    char_height: 8,
                                    align_children: "align_top",
                                    elements:
                                            type: "view",
                                            char_width: 8,
                                            char_height: 8,
                                            elements:
                                                    type: "check_box",
                                                    item_id: "Chk2",
                                                    name: "Primary Applicant",
                                                    type: "check_box",
                                                    item_id: "Chk3",
                                                    name: "Associate 1",
                                                    type: "check_box",
                                                    item_id: "Chk4",
                                                    name: "Associate 2",
                            type: "ok_cancel",
    // did the value change when ticked - lets check
    Signors.bChk2 = false;
    Signors.bChk3 = false;
    Signors.bChk4 = false;
    if("ok" == Signors.DoDialog())
        if (Signors.bChk2 = true)
    getField("Signor1").hidden = false;
    getField("Staff1").hidden = false;
    getField("Date1").hidden = false;
    getField("Date2").hidden = false;
    if (Signors.bChk3 = true)
    getField("Signor2").hidden = false;
    getField("Staff2").hidden = false;
    getField("Date3").hidden = false;
    getField("Date4").hidden = false;
    if (Signors.bChk4 = true)
    getField("Signor3").hidden = false;
    getField("Staff3").hidden = false;
    getField("Date5").hidden = false;
    getField("Date6").hidden = false;
        console.println("Chk2:" + Signors.bChk2);
        console.println("Chk3:" + Signors.bChk3);
        console.println("Chk4:" + Signors.bChk4);
        console.println("Chk5:" + Signors.bChk5);
    //console.println shows if bChk.. is true or false
        console.println("Chk2:" + Signors.bChk2);
        console.println("Chk3:" + Signors.bChk3);
        console.println("Chk4:" + Signors.bChk4);
        console.println("Chk5:" + Signors.bChk5);
    //Yeah, confirmed values have changed, now show fields based on staff input
    //was primary applicant ticked
    doWhatIWant: function(results) {
    if (results [Signors.bChk2] = true)
    getField("Signor1").hidden = false;
    getField("Staff1").hidden = false;
    getField("Date1").hidden = false;
    getField("Date2").hidden = false;
    //was Associate 1 ticked
    if (results [Signors.bChk3] = true)
    getField("Signor2").hidden = false;
    getField("Staff2").hidden = false;
    getField("Date3").hidden = false;
    getField("Date4").hidden = false;
    //was Associate 2 ticked
    if (Signors.bChk4 = true)
    getField("Signor3").hidden = false;
    if (Signors.bChk4 = true)  
    ("Staff3").hidden = false;
    if (Signors.bChk4 = true)
    ("Date5").hidden = false;
    if (Signors.bChk4 = true)
    ("Date6").hidden = false;

    You're missing some curly brackets, using the incorrect equality operator, and using the long deprecated field.hidden property. Try this:
    if ("ok" == Signors.DoDialog()) {
        if (Signors.bChk2) {
            getField("Signor1").display = display.visible;
            getField("Staff1").display = display.visible;
            getField("Date1").display = display.visible;
            getField("Date2").display = display.visible;
        if (Signors.bChk3) {
            getField("Signor2").display = display.visible;
            getField("Staff2").display = display.visible;
            getField("Date3").display = display.visible;
            getField("Date4").display = display.visible;
        if (Signors.bChk4) {
            getField("Signor3").display = display.visible;
            getField("Staff3").display = display.visible;
            getField("Date5").display = display.visible;
            getField("Date6").display = display.visible;
        console.println("Chk2:" + Signors.bChk2);
        console.println("Chk3:" + Signors.bChk3);
        console.println("Chk4:" + Signors.bChk4);
        console.println("Chk5:" + Signors.bChk5);
    I don't know if that will deal with all of the problems, but it's a good start.

  • OO  ALV  displaying  without  Values  despite Internal  table contains

    My   below  OO  ALV  displaying  without  Values  despite Internal  table contains  the values ...
    Help  please ...
    REPORT zsd_concession1  NO STANDARD PAGE HEADING
                            LINE-SIZE 285
                            LINE-COUNT 64
                            MESSAGE-ID zz.
    Program Description ******************************
    This report is to Calculate consession against Quotations
    complying  standards for enhanced Performance, Readability &
    Maintenance.
    Change Log *********************************
    Remedy # /       Who       When        Why / What
    Transport #
    CLASS lcl_event_handler DEFINITION DEFERRED.
    *&      Data Definitions .
    DATA: BEGIN OF vbap_wa,
                vbeln               TYPE  vbak-vbeln,           "Quotation#
                erdat               TYPE  vbak-erdat,           "Quot date
                knumv               TYPE  vbak-knumv,           "Cond Rec#
                posnr               TYPE  vbap-posnr,           "Line Item
                matnr               TYPE  vbap-matnr,           "Mat#
                zansicat            TYPE  zmarall-zansicat,     "AnsiCat#
                zansigrd            TYPE  zmarall-zansigrd,     "Grade
                zcurrvaltnarea      TYPE  zco002-zcurrvaltnarea,"Val Area
                zcurrcstusd         TYPE  zco002-zcurrcstusd,   "Cost$
                zzbrndnm            TYPE  mara-zzbrndnm,        "Brand
                zqedscgrp           TYPE  zglbprc-zqedscgrp, "QE Disc Grp
                mstav               TYPE  mara-mstav,        "Status
                kwmeng              TYPE  vbap-kwmeng,       "Qty
                lprc                TYPE  konv-kbetr,  "List Price ZBP1
                sprc                TYPE  konv-kbetr,  "Std Pric ZNAA,ZNAX
                netpr               TYPE  vbap-netpr,  "Quot price
                mrgn                TYPE  konv-kbetr,  "margin%
           END   OF vbap_wa,
           BEGIN OF konv_wa,
                knumv               TYPE  konv-knumv,  "Cond#
                kposn               TYPE  konv-kposn,  "Cond Item#
                kappl               TYPE  konv-kappl,  "Applic
                kschl               TYPE  konv-kschl,  "Cond Typ
                kbetr               TYPE  konv-kbetr,  "Price ZBP1,ZNAA,ZNAX
           END   OF  konv_wa,
           BEGIN OF vbpa_wa,
                vbeln               TYPE  vbpa-vbeln,  "Quot#
                posnr               TYPE  vbpa-posnr,  "Item#
                parvw               TYPE  vbpa-parvw,  "Prt Fn
                kunnr               TYPE  vbpa-kunnr,  "Cust#
           END   OF  vbpa_wa,
           BEGIN OF result_wa,
                posnr               TYPE  vbap-posnr,           "Line Item
                matnr               TYPE  vbap-matnr,           "Mat#
                zansicat            TYPE  zmarall-zansicat,     "AnsiCat#
                zansigrd            TYPE  zmarall-zansigrd,     "Grade
                zcurrvaltnarea      TYPE  zco002-zcurrvaltnarea,"Val Area
                zcurrcstusd         TYPE  zco002-zcurrcstusd,   "Cost$
                zzbrndnm            TYPE  mara-zzbrndnm,        "Brand
                zqedscgrp           TYPE  zglbprc-zqedscgrp, "QE Disc Grp
                mstav               TYPE  mara-mstav,        "Status
                kwmeng              TYPE  vbap-kwmeng,       "Qty
                lprc                TYPE  konv-kbetr,  "List Price ZBP1
                sprc                TYPE  konv-kbetr,  "Std Pric ZNAA,ZNAX
                netpr               TYPE  vbap-netpr,  "Quot price
                mrgn                TYPE  konv-kbetr,  "margin%
           END   OF result_wa.
    DATA: ikonv      LIKE  STANDARD TABLE OF konv_wa,
          ivbap      LIKE  STANDARD TABLE OF vbap_wa,
          ivbpa      LIKE  STANDARD TABLE OF vbpa_wa,
          iresult    LIKE  STANDARD TABLE OF result_wa.
    *Work storage
    DATA: BEGIN OF ws,
             vbeln       TYPE vbak-vbeln,
             ok_code     TYPE sy-ucomm,
             alv_save    TYPE c,   "ALV save
             alv_variant TYPE disvariant, "ALV Variant
             alv_sort    TYPE lvc_t_sort, "Sort table
          END  OF ws.
    *Data declarations for ALV Main list
    DATA : ty_lay1        TYPE        lvc_s_layo,
           it_fieldcat    TYPE        lvc_t_fcat ,
           ty_fieldcat    TYPE        lvc_s_fcat ,
           l_smenu        TYPE REF TO cl_ctmenu,
           c_alv1         TYPE REF TO cl_gui_alv_grid,
           c_cont1        TYPE REF TO cl_gui_custom_container,
           e_dclick       TYPE REF TO lcl_event_handler.
    *Data declarations for ALV Interactive list
    DATA : ty_lay2        TYPE        lvc_s_layo,
           it_fcat        TYPE        lvc_t_fcat ,
           ty_fcat        TYPE        lvc_s_fcat ,
           c_alv2         TYPE REF TO cl_gui_alv_grid,
           c_cont2        TYPE REF TO cl_gui_custom_container.
    *Field-Symbols
    FIELD-SYMBOLS:
          <konv>  LIKE   konv_wa,
          <vbap> LIKE   vbap_wa.
    *Constants
    CONSTANTS:
          c_end_row    TYPE  i  VALUE  65000.
    *CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
         handle_double_click
         FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row.
    ENDCLASS. "lcl_event_handler DEFINITION
    *CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_double_click.
        DATA: sec_wa LIKE LINE OF iresult.
    *Reading the selected data into a variable
        READ TABLE iresult INDEX e_row-index INTO sec_wa.
    *Select the field details of the selected table
    SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
    WHERE tabname EQ ls_dd02l-tabname.
    *Calling the ALV containing the field values
        CALL SCREEN 101.
      ENDMETHOD. "handle_double_click
    ENDCLASS. "lcl_event_handler IMPLEMENTATION
    *&      SELECTION-SCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE  text-001.
    SELECT-OPTIONS:
        s_vbeln  FOR  ws-vbeln DEFAULT '2002354788' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK a.
    INITIALIZATION.
      PERFORM setup_screen_defaults.
    START-OF-SELECTION.
      PERFORM gather_report_data.
    END-OF-SELECTION.
      PERFORM create_output.
    *&      Form  initialization
    FORM setup_screen_defaults.
      CLEAR: ws, konv_wa, vbap_wa, vbpa_wa.
      REFRESH: ivbpa, ikonv, ivbap, iresult.
    ENDFORM.                    " setup_screen_defaults
    *&      Form  gather_report_data
    FORM  gather_report_data.
      SELECT  vbeln posnr parvw kunnr
               INTO TABLE ivbpa
               FROM vbpa
               WHERE vbeln IN s_vbeln
               AND ( parvw = 'SP' OR "SoldTO
                     parvw = 'WE' OR "ShipTo
                     parvw = 'ZT' ). "Top Parent
      SELECT  vkvbeln vkerdat vkknumv vpposnr vp~matnr
              z1zansicat z1zansigrd z2~zcurrvaltnarea
              z2zcurrcstusd m1zzbrndnm zg~zqedscgrp
              m1mstav  vpkwmeng  vp~netpr
        INTO CORRESPONDING FIELDS OF TABLE ivbap
        FROM  vbak  AS vk
        INNER JOIN vbap AS vp
           ON vpvbeln = vkvbeln
        INNER JOIN zmarall AS z1
           ON z1matnr = vpmatnr
        INNER JOIN zco002 AS z2
           ON z2matnr = vpmatnr
        INNER JOIN zglbprc AS zg
           ON zgmatnr = vpmatnr
        INNER JOIN mara AS m1
           ON m1matnr = vpmatnr
        WHERE  vk~vbeln IN s_vbeln
        AND    vk~auart = 'AG'."AG = Quot
      SORT ivbap BY posnr matnr.
      SELECT  kvknumv kvkposn kvkappl kvkschl kv~kbetr
              INTO TABLE ikonv
              FROM  konv AS kv
              FOR ALL ENTRIES IN ivbap
              WHERE  kv~knumv = ivbap-knumv
              AND    kv~kposn = ivbap-posnr
              AND    kv~kappl EQ 'V'
              AND    ( kv~kschl EQ 'ZBP1'
                   OR kv~kschl EQ 'ZNAX'
                   OR kv~kschl EQ 'ZNAA' ).
      SORT ikonv BY knumv kposn.
      LOOP AT  ivbap  ASSIGNING  <vbap>.
        CLEAR konv_wa.
        READ TABLE ikonv INTO  konv_wa WITH KEY
                                   knumv = <vbap>-knumv
                                   kposn = <vbap>-posnr
                                   kschl = 'ZBP1'
                                   BINARY  SEARCH.
        IF sy-subrc EQ 0.
          <vbap>-lprc = konv_wa-kbetr.
        ENDIF.
        READ TABLE ikonv INTO  konv_wa WITH KEY
                                   knumv = <vbap>-knumv
                                   kposn = <vbap>-posnr
                                   kschl = 'ZNAX'
                                   BINARY  SEARCH.
        IF sy-subrc EQ 0.
          <vbap>-sprc = konv_wa-kbetr.
        ENDIF.
        READ TABLE ikonv INTO  konv_wa WITH KEY
                                   knumv = <vbap>-knumv
                                   kposn = <vbap>-posnr
                                   kschl = 'ZNAA'
                                   BINARY  SEARCH.
        IF sy-subrc EQ 0.
          <vbap>-sprc = konv_wa-kbetr.
        ENDIF.
      ENDLOOP.
      SORT ivbap BY posnr matnr.
      LOOP AT ivbap INTO vbap_wa.
        MOVE-CORRESPONDING  vbap_wa TO result_wa.
        APPEND  result_wa TO iresult.
        CLEAR:  vbap_wa, result_wa.
      ENDLOOP.
    ENDFORM.                    " gather_report_data
    *&      Form  create_output
    FORM create_output.
      CALL SCREEN 100.
    FREE: iresult.
    ENDFORM.                    " create_output
    *&      Module  PBO_0100  OUTPUT
          text
    MODULE pbo_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      IF c_cont1 IS INITIAL.
    *Creating object of container
        CREATE OBJECT c_cont1
         EXPORTING
           container_name = 'CCONT1'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *Creating object of alv
        CREATE OBJECT c_alv1
           EXPORTING
            i_parent = c_cont1.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *Alv layout
        PERFORM alv_100_layout.
        PERFORM save_alv_layout.
    *Alv field catalogue
        PERFORM alv_100_fieldcat.
    *Displaying the ALV grid
        CALL METHOD c_alv1->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay1
            i_save          = ws-alv_save
            is_variant      = ws-alv_variant
          CHANGING
            it_outtab       = iresult[]
            it_sort         = ws-alv_sort
            it_fieldcatalog = it_fieldcat[].
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *Create object of the event class
    *and setting handler for double click
        CREATE OBJECT e_dclick.
        SET HANDLER e_dclick->handle_double_click FOR c_alv1.
      ENDIF.
    ENDMODULE.                 " PBO_0100  OUTPUT
    *&      Module  PAI_0100  INPUT
          text
    MODULE pai_0100 INPUT.
      ws-ok_code = sy-ucomm.
      CASE ws-ok_code.
        WHEN 'BACK'.
          CALL  SELECTION-SCREEN  1000.
          CLEAR ws-ok_code.
        WHEN 'EXIT'.
          LEAVE TO  SCREEN  0.
          CLEAR ws-ok_code.
          EXIT.
        WHEN 'CANCEL'.
          LEAVE TO  SCREEN  0.
          CLEAR ws-ok_code.
          EXIT.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " PAI_0100  INPUT
    *&      Form  alv_100_layout
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_layout.
      ty_lay1-numc_total = 'X'. " Numc total line
    ty_lay1-cwidth_opt = 'X'. " Optimal column width
      ty_lay1-detailinit = 'X'. " Show values that are initial in
      ty_lay1-sel_mode = 'A'. " Column selection mode
      ty_lay1-no_merging = 'X'. " No merging while sorting columns
      ty_lay1-keyhot     = 'X'.
      ty_lay1-grid_title = 'SD Concessions'.
      ty_lay1-zebra      = 'X'.
      ty_lay1-no_toolbar = ' '.
    ENDFORM.                    " alv_100_layout
    *&      Form  alv_100_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'posnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Item#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'matnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Mat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'zansicat'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'AnsiCat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'zansigrd'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Grade'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'zcurrvaltnarea'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Val Area'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 6.
      ty_fieldcat-fieldname = 'zcurrcstusd'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Cost $'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 7.
      ty_fieldcat-fieldname = 'zzbrndnm'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Brand'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 8.
      ty_fieldcat-fieldname = 'zqedscgrp'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'QE'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 9.
      ty_fieldcat-fieldname = 'mstav'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Status'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 9.
      ty_fieldcat-fieldname = 'kwmeng'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Qty'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 10.
      ty_fieldcat-fieldname = 'lprc'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'List Price'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 11.
      ty_fieldcat-fieldname = 'sprc'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Discount'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 12.
      ty_fieldcat-fieldname = 'netpr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Quot Price'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 13.
      ty_fieldcat-fieldname = 'mrgn'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Margin%'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
    ENDFORM.                    " alv_100_fieldcat
    *&      Module  PBO_0101  OUTPUT
          text
    MODULE pbo_0101 OUTPUT.
    *Check if the Custom container exists.
      IF c_cont2 IS INITIAL.
    *Creating container object
        CREATE OBJECT c_cont2
          EXPORTING
            container_name = 'CCONT2'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *creating ALV grid for interactive list
        CREATE OBJECT c_alv2
          EXPORTING
           i_parent = c_cont2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    *ALV layout
        PERFORM alv_101_layout.
    *ALV fieldcatalogue
        PERFORM alv_101_fieldcat.
    *Sorting the output by field position
        SORT iresult BY posnr.
    *ALV for display field details
        CALL METHOD c_alv2->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay2
          CHANGING
            it_outtab       = iresult[]
            it_fieldcatalog = it_fieldcat.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " PBO_0101  OUTPUT
    *&      Module  PAI_0101  INPUT
          text
    MODULE pai_0101 INPUT.
    ENDMODULE.                 " PAI_0101  INPUT
    *&      Form  alv_101_layout
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_layout.
      ty_lay2-grid_title = 'Line Details'.
      ty_lay2-zebra = 'X'.
      ty_lay2-no_toolbar = 'X'.
    ENDFORM.                    " alv_101_layout
    *&      Form  alv_101_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_fieldcat.
      REFRESH it_fieldcat.
    REFRESH it_fcat.
    CLEAR ty_fcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'posnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Item#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'matnr'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Mat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'zansicat'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'AnsiCat#'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'zansigrd'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Grade'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'zcurrvaltnarea'.
      ty_fieldcat-tabname = 'iresult'.
      ty_fieldcat-coltext = 'Val Area'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
    ENDFORM.                    " alv_101_fieldcat
    *&      Form  save_alv_layout
          text
    -->  p1        text
    <--  p2        text
    form save_alv_layout.
    ws-alv_save = 'A'.
    ws-alv_variant-report = sy-repid.
    endform.                    " save_alv_layout

    Hello
    Creating fieldcatalogs manually is one of the major error sources in ALV programming.
    There is hardly any reason why NOT to use the standard-fm LVC_FIELDCATALOG_MERGE in order to create a proper fieldcatalog.
    If you need some modification of the standard fieldcatalog (e.g. renaming of columns, etc.) just do your post-processing after calling the fm.
    Regards
      Uwe

  • Af:table sorting when immediate='true' bug

    Where can I find the patch to fix the problem of sorting an af:table when immediate='true'?

    No I don't have a bug number, I've found that this is a bug based on this thread <a href src='BUG:  ADF FACES 10.1.3_04: Table sort broken if immediate="true" but I have no idea what the number is or where to find the patch for it.
    This is a really irritating bug. I want to have sorting on my tables but if I can't put immediate='true' on the table then other components on the page will fire their validation.

  • Typing a phrase in the Address Bar of Firefox 3.6 used to lead me to the relevant website, but this doesn't happen in FF4, even though keyword.enabled value is set to true in the config page. Why doesn this happen?

    In the about:config page the keyword.enabled value is set to "true". And the keyword.URL value is set to "default". When I type a phrase in the Address Bar, a page with a Yahoo! search result opens unlike intuitively loading the relevant page using Google. Why is this happening?

    To use the Google's browse by name feature as used in Firefox 3.6, set keyword.URL to this link:
    [http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q= http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=]

Maybe you are looking for

  • IPhoto and Photoshop Elements 3

    I upgraded to iLife 06, but having issues with Photoshop Elements 3...Prior to to upgrade, all my photos remained in chronological order. For example, all my '06 photos showed as 06, the 01 for the month, and then broken down by days. Now none of tha

  • Problem with selecting text in Adobe Reader XI

    Hi all, I am encountering a problem with Adobe Reader XI and it is very strange I could not find an alike issue on the internet so I guess I have to submit a question with it. So here it is, I am using Adobe Reader XI Version 11.0.2, operating system

  • Apple TV and computer browser

    I've set up Apple TV and it connects to my MacBook Pro iTunes application without problem.  But I can't figure out how to get it to play something I might be streaming on my MacBook on a web browser:  a YouTube video, for instance, or streaming a new

  • PreparedStatement 와 cursor sharing 파라메터에 관해 질문입니다.

    PreparedStatement 와 cursor sharing 파라메터에 관해 질문입니다. cursor_sharing 파라메터를 EXACT 가 아닌 similar, force를 이용하면 리터럴이나 바인드 변수를 제외한 나머지 문장이 동일하면 같은 문장으로 취급하여 동일한 실행 계획을 이용한것으로 알고 있습니다. 그런데 만약 EXACT인경우 는 SQL-PLUS 상에서 select * from dept where deptno = &dept 이렇게

  • So some moderator made my other thread read only

    I am getting crappy DSL service after 8 years of being able to steadily get 1.3 Mbps on my 1.5 service.  Now I am lucky to get 0.8 Mbps and not get disconnected 10 times a day and have to off/on my modem.  Here is what all I have tried: Called custom