Set the value of a object in request scope

I have the object in my req scope. I need to set value to one of the object attributes if that attribute is blank. How can I set its value.
<c:set var="benefitVO" value="${requestScope.BenefitVO}" />I need to set the following Object attribute value, if it is blank.
something like --- > benefitVO.setBnftCd("asdf");
How can I set it using JSTL tags?
any ideas
Thanks

I need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
Or have the servlet that created that request attribute take care of that requirement.

Similar Messages

  • How to set the value to non enabled UDF fields

    Dear All,
    I created a UDF at titile level of PO and that UDF item always disabled (i.e oItem.Enabled=false). Now how can set a value through coding.
    I wrote like this:
    oForm = SBO_Application.Forms.GetFormByTypeAndCount(-142, 1);
                                oItem = oForm.Items.Item("U_Poap");
                                if (oItem.Enabled == false) { oItem.Enabled = true; }
                                oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
                                oEdit.Value = "1";
                                oItem.Enabled = false; 
    But system throws an error at : oItem.Enabled=true statement.
    How to solve issue.
    Thanks in advance
    Suresh Yerra

    Hi,
    You can set the values using datasource object
    oDBs_Head = objForm.DataSources.DBDataSources.Item("@TableName")
    oDBs_Head.SetValue("U_FieldName", 0, "Value")
    regards:
    SANDY
    Sandeep Saini | Roorkee | India on Dec 26, 2008 11:01 AM

  • Set the value of a non database field in forms

    hai friends ,
    Have been struggling a lot with the problem now . Could anyone suggest me how to go about it.
    I want to set the value of a field in a form . I know the function set_value and set_value_as_(data type ) does the work . But then is there any constraint on the position where it is called.
    My requirement is on querying a form the data from the tables mut be populated( which the portal handles) and I want to populate the non database bound fields with certain values.
    Could any one help me out with this ..
    null

    I need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
    Or have the servlet that created that request attribute take care of that requirement.

  • How do I set the value of a dynamic row text field

    I have a repeated row form which contains a button and multiple text fields.  There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table.  I apologize there are multiple questions I have and I am using pseudocode to describe it.
    Top form looks like
    InputField
    | ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
    | ButtonXn | ButtonY1 | DescriptionXn
    OutputRow looks like
    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
    So I would like it to do
    ButtonX1.click
    OutputTable.OutputRow.addInstance(true)  //this works - everything else I have questions on
    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
    Question 1
    How do I address the location in each table to set a value
    Question 2
    How do I get the value of the description field in the same table and row as the button
    I would like to say something to the effect of  OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
    OutputTable.OutputRow.OutputField2 = InputField.rawValue
      Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
    OutputTable.OutputRow.OutputField3 = this.ButtonLabel
    Question 3
      How can I get the value of the button's label to set in the field
      There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
    Question 4 - unrelated to those above.
    Is it possible to build the first table
    | ButtonX | ButtonY | Description |
    from an XML File.  I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?

    Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
    So now to answer your questions:
    Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
    xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
    Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
    Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
    xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
    Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
    Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
    Hope that helps
    Paul

  • HOW to set the value attribute of FORM INPUT data to a variable in a JSP

    eg. Registration.jsp
    The data is accessed from an hidden field called course
    for example, if I have "Java programming" in the field course, and I use
    an expression to access the value from the hidden field.
    **My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <INPUT TYPE="text" SIZE=12 NAME="course"
    VALUE=<%=getParameter("course") %>
    IS there ANY OTHER WAY to set the value of VALUE to a variable?

    Instead of value=<%=request.getParameter("course")%>
    Use double codes
    value="<%=request.getParameter("course")%>"

  • Setting the value of a textbox from another page

    Hi Everyone,
    I have a multi paged application (multiple xib, multiple controllers)
    In my selection view, the view that holds the UIViewPicker control, I need to populate the page that called the selector page...
    I have the code to identify what page called the selector, and when the page is dismissed, I need to fill in the field from the calling page.
    I have included the header of the calling view in my selector view, and now I need to be able to fill in a readonly textbox in the calling view....
    Do I need to setup a property for each of the textboxes in the calling view, or can I populate them directly??
    thanks
    tony

    alt-088 wrote:
    I am sorry, but I am lost in this implementation....
    How exactly do I tell the self.parentViewController what control will receive the new text value??
    Ooooops!! I'm the one who needs to be sorry, Tony:
    // from previous post
    - (void)setTextInParent:(NSString* textValue) {
    // assume that every possible parent controller has a "textbox" object
    // which is a member of some class that has a writable 'text' property
    [previousViewController setValue:textValue forKey:@"text"]; // <-- * Idiot alert *
    Looks like another one of my senior moments. As you pointed out, we need the value of the 'textBox' property before we can set the value of the 'text' property.
    To your question on how I am displaying the second view, it is called via
    [self presentModelViewController:screen animated:YES]
    from a button click event
    Cool. That means we already have the address of vc1 in the 'parentViewController' ivar of vc2, so we don't need to add the 'previousViewController' ivar shown in my example.
    So here's a corrected and maybe more relevant example--this one has been tested (Duh!), btw:
    - (IBAction)done {
    // get the currently selected string
    NSInteger row = [pickerView selectedRowInComponent:0];
    NSString *selection = [dataArray objectAtIndex:row];
    NSLog(@"%s: selection=%@", _func_, selection);
    // set text in textBox property of parent controller
    [self.parentViewController setValue:selection forKeyPath:@"textBox.text"];
    [self dismissModalViewControllerAnimated:YES];
    I have tried to implement this code
    [self.parentViewController setValue:21 forKey:@"test"];
    but it is generating an error stating
    passing argument 1 of 'setValue:forKey:' makes pointer from integer without a cast
    Yeah, referring to the doc, [setValue:forKey:|http://developer.apple.com/iphone/library/documentation/Cocoa /Reference/Foundation/Protocols/NSKeyValueCodingProtocol/Reference/Reference.html#//appleref/occ/instm/NSObject/setValue:forKey:] wants an id type (pointer to an object of any Obj-C class) for the first arg. Since 21 is an int, i.e. a scalar value, the compiler doesn't like it (and the runtime system would like it even less).
    However when you want to use KVC to set a scalar property, the methods are actually smart enough to extract an int if you provide a NSNumber object (see "Setting Attribute Values Using Key-Value Coding" under [Key-Value Coding Fundamentals|http://developer.apple.com/iphone/library/documentation/Cocoa/Conc eptual/KeyValueCoding/Concepts/BasicPrinciples.html#//apple_ref/doc/uid/20002170 ] in the Key-Value Coding Programming Guide). So if 'test' is an int ivar of the parent controller, something like this should work:
    [self.parentViewController setValue:[NSNumber numberWithInt:21] forKey:@"test"];
    Does that cover your questions? Sorry again for the bad code. Most of the examples I post are pasted directly from working, tested code, and I usually add a disclaimer if it's just something I keyed into the forum. But when I"m having a senior moment all bets are off.
    - Ray

  • Can I use a inputHidden for javascript values that doesn't set the value?

    I have a hiddenInput field for each row in a datatable so I can restore default values to a date field with a javascript function. I am getting conversion errors because I don't have the right setters in the backing object - and I really don't want to put them there - but I don't want the tag to set the values! Is there any way to just set a hidden value somewhere for each row of a datatable but not have it try to set the value? Thanks in advance!

    I just realised that won't work because all the HTML tags will have the same name, whereas I need the dynamically generated suffix that a dataTable assigns to every element in the row i.e. '_id34', so I can reference the value in the javascript and compare it to entered values. Any more ideas? I am having huge memory problems when I'm submitting my form too, using up 2GB of mem and then dying! I'm not sure what's causing it, because it doesn't get as far as my action method code before it dies! It works for smaller tables but I need to be able to handle ~20 users with tables 4x the size I can process now without running out of memory :( Any help would be really really appreciated!!

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • Using Auto Suggest To Set The Value Of Multipe Form Fields

    I would like to use the Spry 1.5 Preview Auto Suggest widget
    to provide the value for multiple form fields based on the row the
    user selects in the auto suggestion data set. I've placed an
    example of what I want to do here:
    http://www.brucephillips.name/spry/Spry_P1_5_Preview/autosuggest/autosuggestMultipleFields .cfm
    It appears that when the user clicks on one of the rows in
    the auto suggestion data set, the current row for the data set is
    not updated but remains the default (first row in the data set).
    Therefore, if you have a spry:detailregion that uses that data set,
    the values for that detail region are from the first row in the
    data set and not the row the user selected.
    Is it possible to set the current row of the auto suggest
    data set to the row the user clicked on in the auto suggestion data
    set so that the spry:detailregion will have the values from the row
    the user clicked on?
    I had previously modified the Spry 1.4 Auto Suggest widget to
    do this. See:
    http://www.brucephillips.name/blog/index.cfm/2006/11/6/Modifing-Sprys-Auto-Suggest-Widget- to-Bind-Users-Selection-to-A-Form
    Thank you for any assistance.

    Cristian: thank you for the reply. I understand your concern
    about the user changing the auto suggest field after updating the
    complimentary fields. I think that could be handled through user
    instruction. Additionally, instead of using form fields to hold the
    complimentary data I could use non-editable paragraphs.
    I hope the change is not too difficult. I think this
    modification would make the auto suggest widget even more useful.
    For example think about a product auto suggest. User starts to type
    in the name of the product, selects the full product name from the
    auto suggestions, and now the page can immediately show in a
    spry:detailregion all the product details.
    Thanks again for considering my request. I really appreciate
    all the work the Spry team is doing. I'm looking forward to the
    official release of Spry.

  • Set the value of a CWNumEdit Control from within the code

    I am trying to update a CWNumEdit Control with data created during program execution.  I am using the set_Text function but it does not seem to be working.  I was wondering if there is something that I am missing to get this functionality to work.  Please help.
    I am developing a VS .NET 2003 WinForm GUI and am Using Measurement Studio 8.1.1.

    Hello mtd32610,
    I noticed this question was already posted on this forum.  We like to
    keep all questions related to a single issue confined to one forum, so
    please direct all future replies to one post or the other.
    As Jervin_J mentioned in the previous post, the standard method for
    updating a CWNumEdit control is to set the Value property of the
    CNiNumEdit object that is associated with this control.  You do not
    need to call the set_Text function, in fact I am not familiar with any
    set_Text function, so I think you may be calling this method on the
    wrong class altogether.
    You should have an object associated with your CWNumEdit control that
    you can set the Value property for.  As mentioned in the reply from
    Jervin_J, the normal way to populate the control is to use:
    <control>.Value = <numeric_value>;
    Regards,
    Marty H.
    National Instruments

  • Set the value to primary key

    Hi.,
    I am using jdev 11.1.1.5
    I had created GlHdEo and GLLnEO with corresponding VO . I had created a viewlink
    GlHd.jrnlno = GlLn.jrnlNo and
    GlHd.jrnltype = GlLn.jrnltype and
    GlHd.jrnlSfx = GlLn.jrnlSfx
    In UI I dragged and dropped GlHd as adf:forms and GlLn as adf:table.
    GlHd.jrno as OutputText with label
    I had dragged and dropped [save] button
        public void cb7_actionListener(ActionEvent actionEvent) {
            // Add event code here...
            BindingContainer bindings1 = getBindings();
            DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("GlJrnlHdView2Iterator");
            Row glhdr = dciter1.getCurrentRow();
            glhdr.setAttribute("GlJrnlNo",getit59Value());
            DCIteratorBinding dciter = (DCIteratorBinding) bindings1.get ("GlmYearlyDocNosView1Iterator");
            Integer value = Integer.valueOf(dciter.getCurrentRow().getAttribute("GydnDocNextNo").toString())+1;
            dciter.getCurrentRow().setAttribute("GydnDocNextNo",value);
            dciter.getDataControl().commitTransaction();
            OperationBinding ob = bindings1.getOperationBinding("Commit");
            Object result = ob.execute();
        public String getit59Value(){
            DCBindingContainer dcbindings = (DCBindingContainer)getBindings();
            DCIteratorBinding dciterator = dcbindings.findIteratorBinding("GlmYearlyDocNosView1Iterator");
            Row row= dciterator.getCurrentRow();
            return (String)row.getAttribute("GydnDocNextNo");
        }I am getting error as jrnlNo should be entered JrnlNO is a primary key

    My logic is explained below
    public void cb7_actionListener(ActionEvent actionEvent) {
            //In the following code i would set the value of GlHd.GlJrnlNo - Primary Key
            BindingContainer bindings1 = getBindings();
            DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("GlJrnlHdView2Iterator");
            Row glhdr = dciter1.getCurrentRow();
            glhdr.setAttribute("GlJrnlNo",getit59Value());
            // In the following code i would increment the value of gydn.GydnDocNextNo  
            DCIteratorBinding dciter = (DCIteratorBinding) bindings1.get ("GlmYearlyDocNosView1Iterator");
            Integer value = Integer.valueOf(dciter.getCurrentRow().getAttribute("GydnDocNextNo").toString())+1;
            dciter.getCurrentRow().setAttribute("GydnDocNextNo",value);
            dciter.getDataControl().commitTransaction(); //This commit is used to affect the changes in gydn
            OperationBinding ob = bindings1.getOperationBinding("Commit"); //This commit is used for entire table that had been used in UI
            Object result = ob.execute();
    //This method is used to retrun the value of GydnDocNextNo
        public String getit59Value(){
            DCBindingContainer dcbindings = (DCBindingContainer)getBindings();
            DCIteratorBinding dciterator = dcbindings.findIteratorBinding("GlmYearlyDocNosView1Iterator");
            Row row= dciterator.getCurrentRow();
            return (String)row.getAttribute("GydnDocNextNo");
        }In this i am performing following operation
    =>I am set the value of gydn.GydnDocNextNo to GlHd.GlJrnlNo
    =>I am incrementing the value for gydn.GydnDocNextNo

  • Setting the value of rich inputtext in jdeveloper 11g 11.1.2.3.0

    Hi,
    I am trying to set the value of input text in my .jspx page to the value of a command link. On the click of the link the value of the link needs to be displayed in the input text without having to type it.
    I have created an action method for the command link where I get the value from the command link and set it in the input text. I see in my log it is getting the current row from the command link but nothing is being set in the input text. Following is my code for the command link action method:
    This is where I am getting the value from the command link:
                    DCControlBinding cb;
                    cb = (DCControlBinding) bindings.get("ALL_DETAILS_ITEM");
                     System.out.println("cb  " + cb);
                    Row currentRow;
                    currentRow = cb.getCurrentRow();
                    System.out.println("currentRow " + currentRow);
                    String EMAIL_ADDRESS = null;
                    if ((currentRow.getAttribute("EMAIL_ADDRESS"))!= null)       
                       EMAIL_ADDRESS = (currentRow.getAttribute("EMAIL_ADDRESS")).toString();
                       System.out.println(" EMAIL_ADDRESS " +  EMAIL_ADDRESS);                                       
                           }This is where I am trying to set the input text value(P_EMAIL_ADDRESS) to the command link value(EMAIL_ADDRESS)
                        Map params = operationBinding.getParamsMap();
                        String P_EMAIL_ADDRESS = null;
                    if ((currentRow.getAttribute("P_EMAIL_ADDRESS"))== null)       
                        currentRow.setAttribute("P_EMAIL_ADDRESS", EMAIL_ADDRESS );
                         System.out.println("P_EMAIL_ADDRESS " + P_EMAIL_ADDRESS);                                       
                           params.put("P_EMAIL_ADDRESS", P_EMAIL_ADDRESS);
                           params.put("DISPLAY_TYPE", DISPLAY_TYPE);
                           Object result = operationBinding.execute();
                }I also have set a partial trigger of the input text to the command link Id in the UI.
    Any help would be appreciated.
    Thanks in advance,
    Sal

    This is overly complicated. you post the code of you command link?
    should work without any java code by setting a property listener which the from value set to the value of the link and the to property to the of the input text.
    Timo

  • Setting the value of a java variable in javascript function

    How can i set the value of a java variable in a javascript function?
    <%
    String fName = "";
    %>
    now i want to define a javascript function which can set the value of fName to the value it has been passed.
    <script language="javascript">
    function setJValue(val)
    </script>
    Thanks

    The only way you could simulate this, would be call the same page inside the Javascript function, and send it the parameter that was passed. Then you would have your Java code retrieve this parameter by request.getParameter("value");, and set the variable accordingly.

  • How to set the value of MaxRow Property of DB Adapter 11g dynamically

    I have the following requirement:-
    i am using DB Adapter to connect with MsSQL server for fetching the records from the table by using simple Select Query in my DB adapter.
    1. Receive request from Web Service Client number of records as input to fetch records form MsSQL Server.
    2. Return the result set to the service consumer
    So, here i m using MaxRow Property of Database Adapter for the number of records to be returned. But the problem is that how i can set the value to the MaxRow Property of DB Adapter dynamically from the value received as input.
    If you have any other idea to return the records dynamically from MsSQL server .Please help me.

    If you are using the DB Adapter as a reference and as you said, you are using custom SQL i guess...
    you can use the sql like...
    select top 1 * from tablename, this will result only 1 row from database(top record)...
    or select top 5 percent * from tablename, if the rows in the database are 100, then it will return the top 5 records in the database...
    check the exact syntax of top command with sql server...but using top keyword should solve your purpose to limit the number of records....
    Hope this helps...
    Thanks,
    N

  • Explicitly setting the query string in http get request

    Hi All,
    We are trying to use the query string parameter to send a GET request to a vendor. The parameter value is a string concatenated with xml ie. String=<xml></xml> It seems the vendor is reading this value as string and Looking for "<XML>" to strip out the values. The problem in OSB is when I concatenate the fn:concat("String=",<XML/>) the acutal value is translated to "String=&lt;XML/>. Is there a way to explicitly set the value so the < doesn't get encoded to &lt; ? the odd thing is that only the left less than bracket get encoded. Any help would be most appreciated...
    thanks,
    Matt
    version of OSB:
    Service Bus 10gR3
    Oracle Service Bus Version: [WebLogic Oracle Service Bus 10.3 Sat May 30 06:12:38 EDT 2009 1223943 ]
    Oracle Weblogic Server Version: [WebLogic Server 10.3 Fri Jul 25 16:30:05 EDT 2008 1137967 ]

    The left side bracket is actually getting encode as amplt; (this forum encoded it :))

Maybe you are looking for

  • How do i transfer photos from ipad to pc running vista

    how do i transfer photos from ipad to pc running vista

  • ODI not picking the file generated through calcscript

    Hi John, We have used samba and mapped the folder from linux to windows.We named the drive and specified the path. Now i ran the interface which invokes the calcscript for data extraction and the script ran well.I t generated the file. But the file i

  • Can't export from FCPX!! (error -1)

    Hi, I'm running FCPX 10.0.8 on a late 2012 iMac and I've got to get an edit out urgently for the client but I keep getting an error every time I try to export. I can't do anything with this video if I can't export it!!! I need help urgently. I get th

  • How to avoid outage from db level

    Hi All, I'm having task as, I need to give *15 diffrent ways/ideas/scripts to avoid outage from Oracle DB level in general* within short period(3 weeks). Where we need to focus and what are the stuff, need to do to complete this. I guess, Outage mean

  • HELP - LR 1 trial download needed

    My PC went up this week and I lost a whole lot of stuff including all my downloads. So I tfered to a MAC. I have my keycode when I purchased after my trial run and if I can get another trial I'll be good to go. Does anyone have a trial version for a