Setting bean field in view

How can you set a value in a bean from the view?

See
http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSPIntro8.html#wp70763
for a bean with a property that has get and set methods.
The SQL tag examples are helpful examples
http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSTL7.html#wp63722

Similar Messages

  • JSF setting bean fields without overring values.

    Imagine I have two <h:inputText> components:
    One is a SSN (Social Security Number) inputText and the other one is a Name component.
    I have put a onValueChangeListener on my SSN inputText for when its value changes.
    When it changes, I call a Business Method which accesses a DAO and retrieves the person's Name from a DAtabase.
    on the onValueChangeListener method I set: beanName.setName(XXDAO.findXXXBySSN(ssn)).getName())
    something like that...
    the problem lies in the Update Values Phase because all the values I set in the Listener method are overriden by the Update Values PHase. They get set with the old form values and all the processing I do is worth nothing...
    Any help???

    Yeh its a problem because the value changed is called before the model update.
    So what you can do
    you can update the variables yourself then call
    FacesContext.getCurrentInstance().renderResponse();
    in your value change this will skip the model update
    (note i have found a problem with the view not refreshing with this still unresolved problem i have a post ongoing about this)
    with renderResponse you can also make a navigation rule to navigate back to the same page and call it in your value changed method.
    FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(FacesContext.getCurrentInstance(),null,"test");
    where test is the navigation rule
    this will force the view to be updated
    The other soultion i found to this was to move the value changed event to the model update phase. This way your setters are called before yoru value changed event
    something like
    public void changeMethod(ValueChangeEvent event)
    PhaseId phaseId = event.getPhaseId();
    String oldValue = (String) event.getOldValue();
    String newValue = (String) event.getNewValue();
    if (phaseId.equals(PhaseId.ANY_PHASE))
    event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
    event.queue();
    // correct phase update local variables for the new class Number
    else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES))
    }

  • How to set key fields in a Database view

    Hi guru's
    iam balaji,plz guide me with how to set key fields in a view.......that field is a non key field in the base table....
    thanks in advance,
    Balaji.S

    take a look at this:
    Diagnosis
        In the view, not all of the mandatory fields were included as key
        fields. The key of the view therefore is not unique.
    System Response
        All the fields are regarded as key fields in order to guarantee that th
        key lengths are unique.
    Procedure
        For views with a large number of fields, this could have a negative
        effect on the performance for the language construction described below
        In this case, all the mandatory key fields should be included in the
        view.
    regards

  • How to populate a set of fields multiple time in the page ?

    Hi All,
    JDev Ver : 11.1.1.5
    I have a requirement as follows,
    My page contains 1. Add Button
    2. Five fields.(one input text and four select one choice)
    The fields are like one input text and remaining select one choice. And also these fields contains validations.
    Actions
    On click of add button , I have to show the fields , similarly I have to add one more set of fields in the page below the first set when I click the add button, Like this I will add as many as I need.
    How to achieve this requirement,
    1. Do I need to generate the view objects dynamically from managed bean ?
    2. Do I need to create a custom component ?
    For Time being , I have added 3 set of fields pages and showing one by one. I want to do this dynamically.
    Please let me know the suggestion for this Requirement.
    Thanks,
    Gopinath

    Hi,
    to do this:
    1. reate a managed bean that exposes a HashMap property. The HashMap is of type e.g. Map<Person>
    2. To create a new set of fields, add a new entry to the HashMap and refresh the af:form. The af:form contains and af:forEach that you use
    to iterate as often as you have entries in the HashMap. Each text field you bind to #{bean.HashMapProperty['key'].attribute}, for example
    #{bean.HashMapProperty['key'].FirstName}
    #{bean.HashMapProperty['key'].LastName}
    #{bean.HashMapProperty['key'].EmployeeId}
    3. When the user updates a field, the HashMap is updated based on the "key"
    4. The managed bean should be in viewScope and referenced from the field's value property
    Frank

  • Entity Bean on dataBase views

    Hi forum,
    I Have to migrate an existing application to JEE (with EJB3).
    In this application there are a lot of dataBase views.
    I'm new in EJB3 and I don't know how to structure cleanly entity beans (Specially when it are created from dataBase views).
    My problem is that for each query made from the same dataBase view I almost have to create a new entity bean with a different @Id.
    What can I do to to avoid it?
    I had thought to genrate a new @Id (attribute not persistent) but I think is not possible. It's right ?
    Someone can help me ?
    Thanks

    Hello Kenny,
    The view can be treated the same as a table, it just needs to have some field or set of fields that can uniquely identify rows for it to be able to map to an Entity. Unless the view has rows that are exact duplicates, in the worst case you can use the entire row as the primary key.
    Best Regards,
    Chris

  • How to set value from one view to other view's context node attr b4 save

    HI all,
    My requirement is as below:
    There are two views in component BP_CONT.
    BP_CONT/ContactDetails    IMPL class
    BP_CONT/SalesEmployee   SALESEMPLOYEE    STRUCT.SALESEMPLOYEE
    I want to set value from first view to second view's context node's attribute.
    i get Sales Employee BP number in ContactDetails view, from here i want to set that value in to STRUCT.SALESEMPLOYEE
    of second view in the same component.
    please send me code snippet for doing the same.
    Thanks in advance.
    seema

    Hi Seema
    You can access the fields from different views by either using custom controllers or by using component controllers, in your case you can access the Sales employee BP number from the Component controller.
    first access the component controller  as below in BP_CONT/SalesEmployee  (in do_prepare_output method) or in (specific setter method)
    lv_compcontroller type ref to CL_BP_CONT_BSPWDCOMPONENT_IMPL,
    lv_partner type ref to cl_crm_bol_entity,
    lv_role type string,
    lv_partner_no type string.
    lv_employee TYPE REF TO if_bol_bo_property_access,
    lv_compcontroller  = me->COMP_CONTROLLER.
    lv_partner ?= lv_compcontroller  ->typed_context->-partner->collection_wrapper->get_current( ).
    lv_role = lv_partner->get_property( iv_attr_name = 'BP_ROLE' )
    IF LV_ROLE = 'SALESEMPLOYEE'
      lv_partner_no ?= lv_current->get_property( iv_attr_name = 'BP_NUMBER' ).
    endif.
    now set the value
    lv_employee ?= me->typed_context->salesemployee->collection_wrapper->get_current( )
    CHECK lv_employee IS BOUND.
        lv_employee->set_property( iv_attr_name = 'SALESEMPLOYEE' iv_value =  lv_partner_no  )
    Thanks & Regards
    Raj

  • CProjects - Set-up field control - Usage of conditions

    Hello
    In cProjects, in set-up field control it is possible to adjust behavior (display, updatable, mandatory, u2026) field by field.
    My questions are:
    - Where to find the complete list of conditions available?
    - Is any condition is usable everywhere, for example C001 Object is released on a DAG Document (means the object link to this document is released)?
    - Is there a condition with a meaning like u201CThe object is in creationu201D (to have for example a phase description not updatable after creation)?
    - How to create its own conditions?
    Thanks for your help.
    Rémy
    Here you can find a list of conditions for the main objects.
    CTO (Checklist)      C001 Object is released
    ITO (Checklist Item)      C001 Object is released
    MTG (Project Participant)      C001 Object is released
    PPO (Phase)      C001 Object is released
    TTO (Task)      C001 Object is released
    MTG (Project Participant)      C002 CATS is active
    TTO (Task)      C002 CATS is active
    TTO (Task)      C004 Confirmation for task
    MTG (Project Participant)      C005 Role start and finish are specified
    ITO (Checklist Item)      C006 Object has a superior phase
    TTO (Task)      C006 Object has a superior phase
    TTO (Task)      C007 Phase without approval
    TTO (Task)      C008 Appr. is in process, granted, rejected
    CTO (Checklist)      C009 Ind. 'Changeability' to 'Cannot Be Chgd'
    ITO (Checklist Item)      C009 Ind. 'Changeability' to 'Cannot Be Chgd'
    CTO (Checklist)      C010 Ind.'Changeability' to 'Partlly Chngble'
    ITO (Checklist Item)      C010 Ind.'Changeability' to 'Partlly Chngble'
    PPO (Phase)      C011 Project Type 'Initiative'
    PPO (Phase)      C015 Constraint: As soon as possible
    TTO (Task)      C015 Constraint: As soon as possible
    ITO (Checklist Item)      C016 Constraint: As late as possible
    PPO (Phase)      C016 Constraint: As late as possible
    TTO (Task)      C016 Constraint: As late as possible
    ITO (Checklist Item)      C017 Constraint (Finish Date): None
    PPO (Phase)      C017 Constraint (Finish Date): None
    TTO (Task)      C017 Constraint (Finish Date): None
    TTO (Task)      C018 Task is a summary task
    TTO (Task)      C019 'Remaining Work Man.'indicator is active
    TTO (Task)      C020 Object is part of a project version
    ITO (Checklist Item)      C030 Access to Forecasted Dates
    PPO (Phase)      C030 Access to Forecasted Dates
    TTO (Task)      C030 Access to Forecasted Dates
    OAG (Object Link)      C100 Object has not been specified yet
    RAG (Checklist Reference)      C200 Checklist reference was created
    ATO (Approval)      C300 Approval has the status: Created
    EAG (Project Element Link to Role)      C400 Status: Staffing in Process/Complete
    MTG (Project Participant)      C500 Status: Staffing in Process/Complete
    MTG (Project Participant)      C501 Confirmation for project role
    BAG (Link to Business Partner)      C502 Distribution is active
    MTG (Project Participant)      C502 Distribution is active
    MTG (Project Participant)      C503 Status: Staffing in Process
    MTG (Project Participant)      C504 Cost/revenue rate is initial
    TTO (Task)      C504 Cost/revenue rate is initial
    MTG (Project Participant)      C505 Org. Unit (Staff. Manager) is changeable
    MTG (Project Participant)      C506 Org. Unit (Cand. Manager) is changeable
    MTG (Project Participant)      C507 Staffing Manager is changeable
    MTG (Project Participant)      C508 Candidate Manager is changeable
    SAO (Individual Approval)      C600 Approval allows decision maker change
    DAG (Document)      C700 cProjects file is checked out
    DAG (Document)      C701 Plug-in for documents is used
    DAG (Document)      C702 Document has status 'Not in Process'
    DAG (Document)      C703 Document is changeable
    DAG (Document)      C704 Link to document template
    DAG (Document)      C705 Document in projekt-/checklist template
    DAG (Document)      C706 cProj. file is checked by current user

    Hi Matthias
    I am trying to setup field control to make a bespoke field in a bespoke tab toggle between READ only and Editable. 
    I have gone through number of posts and the SAP note you mentioned. I have setup the entire configuration required and it is still not working.
    What confuses me is that, to setup a field control dynamically, is it all done via configuration?. Is some coding still required in the VIEW methods?. I am setting up a debug breakpoint in the class method that is created for the condition I created, but the program is not stopping there so I think the condition method is not being called.
    Please can you give some more details.
    Thanks
    Raj

  • Error: Attribute set for field_name in view object VO_instance failed

    While I try to add a new row in a table using a VO created on two EOs, it comes back with error message 'Attribute set for <field_name> in view object <VO_instance> failed' for each field I enter the data. Please suggest me if I am missing something while doing it.

    Are you sure you are specifying a value for the attribute of the VO and the value of correct data type.
    Also, please make sure that you have one row coming from each EO , so that the VO has one row, and a outer join is not happening.
    Thanks
    Tapash

  • Project Server workflow freezes on setting Project field

    Hi,
    In Project Server 2013 I've created a workflow with the SharePoint Designer. I want the workflow to set the project stage status and then a Project Field. Setting the project stage status works fine, but when I insert the action of setting the project field
    the workflow freezes and the Submit button is greyed out. Remove this action, re-publish the workflow and everything works fine. There are no required or read-only fields in the workflow stage and the custom field I want set is a plain project level custom
    field with no special properties. It is not on any pdp, nor in any view, because I'm only using it for OData reporting. Setting the field as "workflow-controlled" doesn't make a difference. It is the same in Project Online. What am I missing?   

    Setting a project field should not be a problem or holding in anyway, what kind of field is it and what value is being provided ?
    Take a look at the article here, it explains the process of
    creating an approval, make sure you are following the same process, it would be advisable to go through these module on working with workflow
    http://blogs.office.com/b/project/archive/2012/09/18/demand-management-sharepoint-designer-project-server.aspx
    http://msdn.microsoft.com/en-us/library/office/ee767694.aspx
    http://msdn.microsoft.com/en-us/library/office/jj163494.aspx
    On a side note curios to know how the publishing was done via SharePoint designer ?
    Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com

  • How to set the field non-editable in the classical report..

    Hi..
              How to set the field non-editable in the classical report..

    Hi experts,
    For the component 'ICCMP_EMP_SRCH' there is a view 'BUPAEMPSEARCH' , which has 2 context nodes 'CUSTOMER' AND 'SEARCHEMPLOYEE' , i need to add the field 'NICKNAME' which is part of the 'CUSTOMER' context node on the search screen. Currrently all the fields on the screen screen are from the 'SEARCHEMPLOYEE' context node. when i did the configuration , the 'NICKNAME' field is greyed out . I have already generated the Getter ,Setter , GET_I, GET_M methods for the 'NICKNAME' field and the context node and controller class and context class are all active .
    on debugging the GET_I method, i see that rv_disabled = 'TRUE' and the current = collection_wrapper->get_current( ) is returning empty value .
    for this rv_disabled to be set false , the code below is not triggered since there is no value in current.
    IF current->is_property_readonly(
    'NICKNAME' ) = abap_false. "#EC NOTEXT
    rv_disabled = 'FALSE'.
    ENDIF.
    when i check for other search fields of context node 'SEARCHEMPLOYEE' , all the fields are set to rv_disabled = 'FALSE'.
    can anyone suggest how to approch this. iam i missing any binding between context nodes or any activations ?
    The field properties are set as Input field and the display checkbox is not checked.

  • How can I use Document Set description field in a SharePoint workflow

    We bundle together related documents into a Document Set and then route the Document Set for approval using a Sharepoint 2010 workflow.  Within the workflow, we are also sending an email to each approver, and an email to a manager if items become past
    due.  I have been asked if I can add the Description field from the Document Set to the email text.
    I am familiar with the use of the "Add or Change Lookup" control to insert fields into the email text.
    For example: Data Source "Current Item" with field "Title" becomes
    [%Current Item:Title%].
    The problem is that I can't find a data source that will pull in the Document Set description.
    Any help would be appreciated.

    Hi,
    According to your post, my understanding is that you wanted to use Document Set description field in a SharePoint workflow.
    I recommend to modify the view to display the description field.
    If you add the description, it will display the value.
    Then you can create workflow as below:
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Set the field's prompt at the RowViewer

    Hello all,
    I am working with Oracle JDeveloper 3.2, using JSP, and I have this problem:
    I did not find a method to set the field's prompt at the RowViewer (JSViewCurrentRecord Class).
    Humberto Zappe Loy

    The following function in DataWebBeanImpl.java shows how the attribute label is obtained.
    public String getAttributeLabel(RowSet rs, AttributeDef aDef)
    String sLabel = aDef.getName();
    if (aDef.getProperty("LABEL") != null)
    sLabel = aDef.getProperty("LABEL").toString();
    else
    String sPropName = aDef.getName() + "_LABEL";
    sPropName = sPropName.toUpperCase();
    if(rs.getProperties().get(sPropName) != null)
    sLabel = rs.getViewObject().getProperties().get(sPropName).toString();
    return sLabel;
    You will notice that the value for the label is obtained via a call to AttributeDef.getProperty() or a call to rs.getViewObject().getProperties().get(sPropName) this means that you can set a property via the BC4J attribute or view object wizard and the DataWebBeans will make use of this property for rendering the prompts. You can edit an attribute's properties by clicking on the view object to activate it in the navigator and then right-clicking on the attribute to invoke it's editor. Once you have the attribute editing UI, you can click on the properties tab to add your new properties.

  • Attribute set for Choice in view object xxPickSlipYesNoVO1 failed

    Hi all,
    I have a problem that i find pretty weird.
    The context is: I created a custom page that contains a table populated with some printer names. And the other field it contains is a messageChoice item. Both of these items are populated using custom VO that i also created and included in a custom AM. The VO that contains the printer names is used in a Query region with a table and it works perfectly. But the messageChoice is feeded by a VO that contains the following query :
    select 'No' choice from dual
    union
    select 'Yes' choice from dual
    I know this is very simple but i did not find any other way to populate the messageChoice than by using a view object. Where the problem comes is in the runtime behavior. When the custom page loads, "Yes" is automatically loaded in the dropdown. Then when i click the submit button it works perfectly but if i choose "No" i get the following message:
    Error
    Last Request Only - Attribute set for Choice in view object xxPickSlipYesNoVO1 failed
    Note: "Last Request Only" is the prompt of the messageChoice.
    And when this error is displayed the submit button does not want to work ....
    I dont know how to solve this i did some research but i did not find anyone with a similar issue!! yet! So i turned to you expertise to help me in solving this problem.
    Best Regards,
    Carl

    Carl,
    as u said u have removed the attribute sets created previously,. I would advice to delete myclassses folder , recompile and run. Also follow Sumit's suggetion for creating lookup, as that is the standard way of doing.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HCM F&P - How to set the field as Required based on drop down values

    Hi Experts,
    I have a requirement to set the Date field as mandatory when a particular value is selected in drop down list. I have already tried with MessageBox though it displays the error message but process moves further i.e. on clicking Check & Send button it throws an error message but still it moves further and i can see only Send button. Ideally it should halt there itself.
    Thanks & Regards,
    Jitesh Talreja

    Thanks for your valuable inputs
    Chintan
    I have already tried this. It only highlight the field with the red border but still allow to move further.
    Mukesh
    Yes, we can definately control this from the backend but that would be the last option i should execute. Ideally, this is something to be controlled in front end itself
    Poornima
    By setting the field attrbiute Required will set the field mandatory as a whole irrespective of drop down values or any other UI element.
    Regards,
    Jitesh Talreja

  • Please help me I am not seeing Database table column names in field explorer view

    Hi,
    I am developing a crystal report using eclipse and sql server. After creating connection, when i drag and drop tables, The table name and its columns should apper in field explorer view. Then we drag the columns onto crystal report. Unfortunately I am just  seeing only table names but not column names in field explorer view. Could anyone help me?
    After downloading eclipse I have plugged in the crystal report using the following instructions
    1. Click on the Help menu, and then Software Updates > Find and Install... to open the Install/Update wizard.
    2. Select Search for new features to install and click Next.
    3. Click the New Remote Site button. This will launch the New Update Site wizard
    4. Type the Business Objects Updsate Site for the Name field and the following for the URL: http://www.businessobjects.com/products/dev_zone/eclipse/
    5. Click OK to complete the wizard.
    6. Enable the newly created Business Objects Update Site checkbox as well as the Callisto Discovery Site (which should appear by default with Eclipse 3.2) and click Finish.
    Expand the Business Objects Update Site node and enable the Crystal Reports for Eclipse 1.0.0v555 checkbox.
    8. Expand the Callisto Discovery Site and click the button "Select Required". This will automatically select the required Eclipse features necessary to successfully install Crystal Reports for Eclipse.
    Thank You
    Rajavardhan Sarkapally

    Now we have a lot of views which select data from the tables, but I need to get the "Table Column Name" that is linked in the view.
    If you are using SQL Server 2012/2014, then you can use
    sys.dm_exec_describe_first_result_set (Transact-SQL) to gte the informations.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Doubt regarding Message statement

    Hi, I want to pop up a message in which I want the valye of X tp be replaced by its value. DATA: X(3) TYPE C VALUE 'FFF'. MESSAGE ID 'ERROR MESSAGE' TYPE 'E' NUMBER '000' WITH 'COMPUTED' '&X&'. But this does not work. Can someone help me out ? Tushar

  • I wanna change the tab name in tcode ie02  :)  i'll give u points !!!

    Hi abapers, In screen ie01 i want to change the tab name, like instead of general, i want to put some other. If it is possible, do help me. <b>I ensure u for giving ur share of point.</b> Regards, [email protected]

  • Valuation process in COPA with ML

    Hi Gurus!! I would like setting the valuation process in COPA, we have configured Material ledger without actual costing and all our products have the prices control indicator (v )  variable price/periodic unit price. I'm trying to do all the process

  • Color Cast in "Grid" Thumbnails

    I have a strange color cast (pink) that only shows up in the "Grid" and only on the thumbnails of the original RAW file. This color cast shows up in the over-exposed highlights of my thumbnails and is "NOT" because the "Highlight Hot Areas" is turned

  • Premiere elements 10 for mac

    I plan to download premiere elements 10 for Mac. I am currently running a project in elements 9. 1. Can I complete my project in 9 or will there be a conflict with 10 sitting there? 2. Does 10 for Mac have chroma key now? 3. I have read about install