How to use a single page for create and update mode.

Hi,
I need to develop a single page to be used for both create and update modes.
I am going to use a variable MODE
and i will set this in the emp summary page.
Based on the button clicked by the user i have to render the JSF page.
For tis if the user selects a perticular and cliks on update thn i will pass the empno to the next.
so there in the next i will appy a ViewCreiteria on my View Obj to fetch only that row so that only that emp will be displayed ion update mode.
This is working fione for me.
So now the issue is
when the user clicks on CreatEmp button.
i need to enable my VO for insert operations.
for this i wrote the code like this in the beforePhase event
FacesContext ctx = FacesContext.getCurrentInstance();
ValueBinding valBinding = ctx.getApplication().createValueBinding("#{data}");
BindingContext bContext = (BindingContext) valBinding.getValue(ctx);
DCDataControl dcControl = bContext.findDataControl("DataControl");
Application app = ctx.getApplication();
ApplicationModule am = (ApplicationModule) dcControl.getDataProvider();
System.out.println("After Appmodule initiation");
// get the VO reference and initiate the query
System.out.println("Before Page VO initiation");
PrismDmPageSectionViewImpl vo = (ViewImpl)am.findViewObject("View");
//ViewRowImpl row = (ViewRowImpl) vo.createRow();
/* TO CREATE AN EMPTY ROW*/
Row row=vo.createRow();
System.out.println("New Row is created");
//vo.createKey(row);
vo.insertRow(row);
vo.setCurrentRow(row);
By doing this a new empty page is rendered.
But when i fill up the values and click on ok.. i am getting the error like this..
JBO-27023: Failed to validate all rows in a transaction.
JBO-27027: Missing mandatory attributes for a row with key null of type View3
JBO-27014: Attribute Id in View3 is required
JBO-27014: Attribute PageeId in View3 is required
Please point me out where i am missing.
Thanks

Hi,
In my opinion you are over complicating things.
This is what I do for using the sme page as both create and update without all this code.
1) Create a browse page containing a an adf table with a select one component bound to your view object.
2) Create an additional edit page containing only an edit form containing fields of your view object that your users must enter in order to add or edit rows.
3) Link the pages in the JSF diagram with an "edit" navigation case from browse to edit page and a "return" navigation case from edit to browse (make sure that redirect option is NOT set on both cases)
4) Remove the submit button from the edit page and add two application module bindings for the commit and rollback operations as command buttons in the form footer facet. Make sure that both buttons has an action of return and that their disabled property is set to false. You will probably change their labels to ok and cancel respectively.
5) Drop a create action for your view object from the data control palette inside your page as a command button and set the action property to edit also.
3) Set the action property of the view button to edit
This should basically work without any code from your part. -- at least it does so for me -- if you like to make it a bit more funcy you may add am action listener inside your buttons and set a requeScope variable for example #{requestScope.editing} to true or false depending on the button clicked. Then add a title to your page with a value like #{requestScope.editing == true ? 'Editing record' : 'Adding a new record'}..
Hope that helps.
Thanassis

Similar Messages

  • DEBMAS IDOC for CREATE and UPDATE

    How do i use DEBMAS IDOC dynamically for create and update customer information.
    I have a file as source which would have combination of information for new and change customer information. and there is a field in the file with t code xd01(create) and xd02(update).
    Please advise.
    -Vasu

    Hi,
    The field MSGFN is the one which decide the operation.
    Please pass the values accordingly to indicate the Create/Update.
    In inbound IDOC case ,process code will check MSGFN and do the action.
    Regards,
    Akshay.

  • How do I set up pages for mac and ipad to share a document and keep them synced.

    How do I set up pages for mac and ipad to share a document and keep them synced.

    You can upload them from Mac to iCloud and then download on the iPad. They only directly sync between iOS devices. The Mac version of Pages has more options that are not available on iOS. If you use a font that is not available on iOS it will change the font. Some layout options aren't available either.

  • How to Use the language function for assignment and validation

    Hi All,
    If anyone can explain me in details with example ,how to use the language function for assignments and validations?
    Thanks
    Arnab

    Hi Arnab,
    The expression is checked only for the current MDM session.
    If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
    Try connecting to the DM with the XYZ language.
    It should go to the if part rather than else.
    Hope it helps.
    Thanks,
    Minaz

  • How to use KAUF_AUFNR_CHANGE  to change Process order and Update a field

    Hello ,
    I am working on 4.6C system and I hve a requirement to change Process order and Update a field value passed from a ABAP Program. I am looking for suitable Function modules or Bapi ( available in 4.6c) .
    I have come across FM KAUF_AUFNR_CHANGE . Would appreciate any guidance on how to use the FM in my program and Update a field in the Process order.
    Many Thanks!

    All the importing parameters of this function module have a striaght structure of the transperent tables...
    i have checked the code and it has a modify statement based on the importing parameter..
    pick one record in databas and pass it to the importing parameters, with some values changed...
    i think that should work
    what values  to pass the import values of FM -KAUF_AUFNR_CHANGE.
    Edited by: ssm on Aug 4, 2011 7:19 PM

  • HT1918 My husband's iPhone4 uses one apple id for purchases and updates, but another is listed in the App Store. How do I reconfigure his phone to only use the apple I'd and password that is used in the the "featured" section of the App Store?

    My husband's iphone4 seems to have 2 apple ids. The one listed in the featured section of the App Store is the correct one. The one that asks to be signed into for purchase and updates is also mine, and the incorrect one. Hence, our devices are linked. How can I remove my apple Id from his phone so that there is no connection between the two?

    I think it may be because he got his phone first and not seeing a future issue, I set his phone up to my already existing apple Id used for my iPod. If I connect his iPhone to our pc, can I create his own apple id account?

  • How to use wsit with jeveloper for developing and testing web servises

    hi, all. Just want to ask one realy simple quastion.
    I'm new with web servises, so my question may be doesn't fall well into this section , but this community looks friendly for me and i hope to get some usefull links and advises.
    First of all could anybody say me if i'm righ or wrong with the following suggestions:
    1. What is the principal difference between axis 2 and wsit products? Do i understand right that they both extend or support so called jax-ws2 API and represent different approaches in that (are they competitors?), or this products serve for different sakes at all and could be used together? I want to understand without much digging how these products correlate with each other...
    2. If i'm right what is oracle favor? And if oas standard supply doesn't include wsit, how to install and use this product for creating interoperable web servises in jdeveloper enviroment? ...or jax-ws 2.1 wasn't included in oc4j v10 and will be the part of v11 only?
    Thanks in advance. Alex.
    Message was edited by:
    Timin
    Message was edited by:
    Timin

    Both Axis and WSIT are not Oracle products - so I'm not exactly sure why would you post the question here.
    JDeveloper has native support for JAX-RPC based Web services development in 10.1.3 and JAX-WS support in 11 - check out the online demos linked from the home page to see these in action.

  • How to use an external drive for windows and mac

    I recently got an external hard drive (2 TB seagate expansion) and I need to be able to use it with both my mac and my windows computer. I have read numerous forums and tried downloading various third party programs but nothing seems to work! One of the things i have read was to create a partition on the drive, this is easy enough and i did try it so i do have one side i can add stuff from from windows and one side i can add stuff to from my mac but then i cant access the other side. So say i need to get a file from my mac to my windows. I add a file to the mac side of the partition from my mac but then when i plug it into windows i cant retrieve that because its on the mac side of the partition (and vis versa). Is there some sort of easy way around this? or some way in which i can format the drive where i can move files back and forth from windows to mac without any expensive third party programs?
    Thanks!
    Bryan
    PS. I did notice when i originally got the hard drive i had a bunch of files on it that were added from windows. When i plugged it into my mac i could see and copy these files but i could not add new files. Is there anyway to get around this "read only" type formate if i were to reset my drive back to its factory settings?

    Three ways to go;
    Repartiton the drive (1 partition) as MBR and with FAT32 file system. This is readable and writable by both Mac and Windows, but has a file size limit (which I think is 4GB).
    The alternative is to leave the drive formatted as NTFS for Windows (this is not normally writeable from Mac) and employ a third-party software application which can write to NTFS. NTFS-3G, Paragons NTFS for Mac and Tuxera NTFS have all been recommended elsewhere.
    Or you can repartition as GUID with HFS+ (Mac OS Extended Journalled) file system. This would not normally be accesible to the Windows machine, but once again there is 3rd-party softwsre available to enable Windows to read and write to it. MacDrive is the only one I'm aware of, but there are probably others.

  • Can we use IDOC_INPUT_ Message type for creating and changing the document

    Hi,
    I have a requirement to create or change the requisition data.
    Can I use IDOC_INPUT_PREQCR01 function module for both the purpose.
    OR shall I go for custom function module by using BAPI function modules to create or change the data.
    Please help me in this regarding.
    Answers will be rewarded.
    Thank you.
    Eswar

    Hello Eswar
    You could use the IDoc processing function module if you had the data already available in the IDoc specific format (which is unlikely). This would mean you are receiving the IDoc data from another SAP system.
    Instead, check the BAPI explorer (transaction BAPI) if you can find an appropriate BAPI.
    Regards,
      Uwe

  • Urgent please: Master-Deatils OAF Page for enter and Update data

    Hi all,
    i need your help to build master-details oaf page for Enter / Update data
    for example: We have Locations , Department , Employees tables
    all these tables on one oaf page (OAAdvancedTable)
    when user enter New Location and go to Enter it's Departments and for each department, he can Enter they employees.
    and Regarding to Update date:
    - when user select Location , Department table fetch all departments and user can update
    waiting your support for urgent please
    Regards
    Hany

    i do these Steps :
    1- Create LocationEO,DepartmentEO and EmployeesEO
    2- Create Association between LocationEO and DepartmentEO with one-to-Many relation (LocToDeptAO)
    3- Create Association between DepartmentEO and EmployeesEO with one-to-Many relation (DeptToEmpAO)
    4- Create View Object (LocationVO)
    5- Create DepartmentVO (and add LocationEO due to LocToDeptAO)
    6- Create EmployeesVO (and add DepartmentEO due to DeptToEmpAO)
    7- Creare View Link between LocationVO and DepartmentVO (Based On LocToDeptAO) --> LocToDeptVL
    8- Creare View Link between DepartmentVO and EmployeesVO (Based On DeptToEmpAO)---> DeptToEmpVL
    9- Add LocaionVO to Application Module, then add DepartmentVO Via (LocToDeptVL)
    10-Add EmployeesVO to Application Module Via (DeptToEmpVL)
    and Then Run Test AM, all data fetch sucessfully, and i can insert data with proper relations
    NOw, i want to implement this Business Logic in single oaf Page using 3 OAAdvancedTable (Master - Details -Details )
    Regards

  • How to use Multiple Single Option for selection in the Customer Exit

    Hi,
    How can we handle the multiple single values in the customer exit variable.
    I have a requirement which is as follows -
    Table A fiields -> Field Coach, Partner 2, Relation between PArtner 1 & Partner 2, Valid from, valid to date.
    Table B ->  Service Month, Start Date, End Date.
    Table C -> Billing Date, Execution Partner,cal month /year.
    For the Field coach in TABLE A, multiple Partner 2 are present.
    Report has to be built on Table C.
    User inputs the Service month and Field Coach . User can enter multiple field coach values.
    For the All the Field Coach values entered, corresponding Partner2's have to be found from Table A and to be passed to the Execution Partner in Table C.
    Now if we want to use customer exit variable on the field Execution Partner, how can we handle the Multiple Single selections in the customer exit.
    Thanks,
    Shubham

    Hi,
    While creating the variable you must have to specify multiple value.
    In customer exit
    write code multiple times and append the values.
    For example:
    when 'variable'.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 1.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 2.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 3.
    APPEND L_S_RANGE TO E_T_RANGE.
    Regards,
    Ranganath.

  • HOW TO USE A SINGLE PERFORM FOR VARIOUS TABLES ?

    perform test TABLES t_header.
    select
           KONH~KNUMH
           konh~datab
           konh~datbi
           konp~kbetr
           konp~konwa
           konp~kpein
           konp~kmein
           KONP~KRECH
           FROM konh INNER JOIN konp
                  ON konpknumh = konhknumh
           into table iTABXXX
            "ANY TEMPERARY INTERNAL TABLE.
           for all entries in t_header
           where
                 konh~kschl = t_header-kschl
             AND konh~knumh = t_header-knumh.
    endform.
    how can I use above perform for various internal tables of DIFFERENT LINE TYPES but having the fields KSCHL & KNUMH.

    u can use single perform....
    just see this example......hope this is what u r expecting....
    tables : pa0001.
    parameters : p_pernr like pa0001-pernr.
    data : itab1 like pa0001 occurs 0 with header line.
    data : itab2 like pa0002 occurs 0 with header line.
    perform get_data tables itab1 itab2.
    if not itab1[] is initial.
    loop at itab1.
    write :/ itab1-pernr.
    endloop.
    endif.
    if not itab2[] is initial.
    loop at itab2.
    write :/ itab2-pernr.
    endloop.
    endif.
    *&      Form  get_data
          text
         -->P_ITAB1  text
         -->P_ITAB2  text
    form get_data  tables   itab1 structure pa0001
                            itab2 structure pa0002.
    select * from pa0001 into table itab1 where pernr = p_pernr and begda le sy-datum and endda ge sy-datum.
    select * from pa0002 into table itab2 where pernr = p_pernr and begda le sy-datum and endda ge sy-datum.
    endform.                    " get_data
    Regards
    vasu

  • How to use the Smart Cover for FaceTime and Videos?

    Hi,
    I bought a new iPad recently with a Smart Cover. I find the Smart Cover very good for typing, at the low angle. The angle is very nice, it feels very comfortable and it allows fast typing. But then what is called the FaceTime/Video angle seems way too steep for me, like 80 degrees. I need to be like 3 meters away, at least, to watch a movie correctly or to be captured by the FaceTime camera. I'm rather tall but still, I don't really get it. I thought for the first couple of days that I was folding the cover in a wrong way but it seems not.
    Am I the only one to experience this issue? Or is there another way of folding the cover to get a correct angle? I haven't tried another Smart Cover but I would doubt that mine is faulty. But if it is how the Smart Cover is designed, I'm surprised that Apple went with that, I mean, I can't see the use of this angle, if you need to be so far away from the iPad. I actually bought one (and the Smart Cover) to use it as a support for books/tutorials when I'm coding on my Mac, and I'm finding that I can't find a place for the iPad with the cover on my desk because it ends up to be too steep anywhere I place it...

    godbout wrote: ... Am I the only one to experience this issue? Or is there another way of folding the cover to get a correct angle?
    My experience is the same as yours (and everyone else's, I suppose.)
    Other than the various ways you can fold it, Smart Cover is not adjustable.
    This link shows what Smart Cover can do.
    You have already found the best workaround for Smart Cover: reposition yourself, the iPad, or both so the camera view shows what you want in the picture.
    You decide the best location for your iPad while you capture video.  Because iPad connects wirelessly, you need not worry about dangling cables.
    Message was edited by: EZ Jim
    Mac OSX 10.7.3

  • How to use relative DSN filename for connection (in Design mode)

    Hello,
    I connect Crystal Reports to Oracle database via ODBC with connection information stored in DSN file.
    I use "Crystal Reports Basic" in Visual Studio 2008 SP1. CR has no SP. Windows XP Pro SP3, my development machine.
    I created a DSN file, and in Database Expert I'm creating a new ODBC connection and trying to fill the File DSN.
    But, the file name is absolute, and I need to use file name relative to the report file, because I want several programmers and several reports to share the connection parameters. This would also simplify the deployment.
    When I try to copy the DSN file to the solution folder and use just the relative path, then a error is reported:
    Logon failed.
    Details: HY000 General Error: Invalid file DSN
    which probably means that the file could not be found.
    This problem does not exist in runtime, as the connection string could be set programmaticaly.
    Does Crystal Reports accept relative DNS file name?
    If does not, are there any other possibilites to achieve this?

    If still an issue post your question the .NET SDK forum.

  • How to use the Output clause for the updated statment

    How to use the output clause for the below update stament,
    DECLARE @MyTableVar table(
        sname int NOT NULL)
    update A set stat ='USED' 
    from (select top 1 * from #A 
    where stat='AVAILABLE' order by sno)A
    Output inserted.sname
    INTO @MyTableVar;
    SELECT sname
    FROM @MyTableVar;
    Here am getting one error incorrect syntax near Output
    i want to return the updated value from output clause

    see
    http://blogs.msdn.com/b/sqltips/archive/2005/06/13/output-clause.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • No sound on my Sony Bluetooth Headset because Windows 7 can't find Bluetooth peripheral device driver

    SO, I am dealing this problem for the second day in a row and no working solution still. I own the latest iMac 2014 (though the model is exactly as 2013) 2,7 Ghz with Bluetooth 4.0, I've installed through Bootcamp Windows 7 x64. My bluetooth headset

  • [SOLVED]getting permission denied

    I put this in command line /mnt/EFI/boot /dev/sda1 vfat rw,flush,tz=UTC I'm getting a permission error Last edited by tmccaffery (2013-04-04 10:04:40)

  • Invoice

    Dear All, When I want to add AP Credit memo, the error message appears : "payment amount is greater than invoice amount", what could be the caused of the error message ? The invoice is closed and I want to create AP CM to the closed invoice by duplic

  • Material view

    hi guys, i am trying to manually refresh my material view. But encounter a error message saying: ORA-00054: resource busy and acquire with NOWAITthis happen when creating the INDEX. There is a schedule refresh at 0:00 am. This refresh is database one

  • Gramatical Error in Default Interactive Report

    When creating an interactive report, by default the maximum number of rows returned is set to 10,000 and the related message is set to: "This query returns more then 10,000 rows, please filter your data to ensure complete results." Two problems with