Create link to delete item (in non-edit mode)

Hi there,
I've been trying to create a portlet that displays items (titles + edit- and delete-links) and I got so far as to be able to create the edit-link and that seems to work. The edit link is as follows (p_news is an wwsbr_all_items%rowtype)
htp.p('<a href="/portal/pls/portal/PORTAL.wwv_edit_tab.edititem?p_thingid='|| p_news.ID ||'&p_cornerid='||p_news.folder_id||'&p_siteid='||  p_news.caid||'&p_language=sf&p_looplink='|| p_link||'&p_itemtype=basetext&p_topicid=-1&p_topicsiteid=0&p_cornerlinkid=&p_parentid=0&p_currcornerid=&p_containerpageid='|| p_news.folder_id||'">Edit</a>');and after a lot of head scratching, I managed to create a delete link as follows:
htp.p('<a href="/portal/pls/portal/PORTAL.wwpob_page_dialogs.delete_portlets_dlg?p_instance_list='|| p_news.caid||'_'|| (TO_NUMBER(p_news.id)-1)||'_'||  p_news.caid||'_'|| p_news.folder_id||'_'|| p_news.folder_id||'&p_in_edit_mode=1&p_back_url='||p_link||'&p_confirm_url='||p_link||'&p_mode=3">delete</a>');Now what really makes me wonder is this bit:
p_instance_list='|| p_news.caid||'_'|| (TO_NUMBER(p_news.id)-1)||'_'||  p_news.caid||'_'|| p_news.folder_id||'_'|| p_news.folder_id||'&and specifically the
(TO_NUMBER(p_news.id)-1)I mean, it works (unlike everything else i tried in the past few days). But can this be true? Can I use this unbelievanble hack-like "solution" in production? Is there a Oracle-approved way of creating delete-links programmatically (outside the html layout templates)?
Rgds, stupefied in Finland
Edit: gaaah, how do I get multiple rows of code and not one real long one..? >:(
Edited by: Baguette on 05-May-2010 03:57

The API calls are normally executed within scripts but you could obviously call them from a PL/SQL item as well.
The API call works fine in 10.1.4.2. Did a simple test :
<ol>
<li>Create a page group called 'test'
<li>Add two items of type base URL
<li>Created a small anonymous block with the following code :
DECLARE
  CURSOR c1 IS
    SELECT masterthingid,id,version,iscurrentversion,active,siteid,name
    FROM portal.wwv_things WHERE siteid = (SELECT id FROM portal.wwsbr_sites$
    WHERE name = '&PgName') and itemtype = 'baseurl' ORDER BY masterthingid ;
BEGIN
  FOR c1_rec IN c1 LOOP
  dbms_output.put_line('Now deleting item '||c1_rec.name) ;
  portal.wwsbr_api.delete_item(
          p_master_item_id=>c1_rec.masterthingid
         ,p_caid=>c1_rec.siteid
         ,p_mode=>portal.wwsbr_api.DELETE_ITEM_DEFAULT
         ,p_version_number=>NULL) ;
  END LOOP ;
EXCEPTION
     WHEN wwsbr_api.ITEM_ALREADY_DELETED THEN
       dbms_output.put_line('ITEM_ALREADY_DELETED');
     WHEN wwsbr_api.ITEM_ACTIVE_VERSION THEN
       dbms_output.put_line('ITEM_ACTIVE_VERSION');
     WHEN wwsbr_api.INVALID_VERSION_NUMBER THEN
       dbms_output.put_line('INVALID_VERSION_NUMBER');
     WHEN wwsbr_api.INVALID_MODE THEN
       dbms_output.put_line('INVALID_MODE');
     WHEN wwsbr_api.INVALID_CAID THEN
       dbms_output.put_line('INVALID_CAID');
     WHEN wwsbr_api.INVALID_ITEM_ID THEN
       dbms_output.put_line('INVALID_ITEM_ID ');
END ;
/<li>Ran this code.
<li>Invalidated the web cache for the root page of test. The items were deleted
</ol>
Calling the API directly through your browser is tricky. I tried it and got the following error first :
+10/05/07 11:57:16 portal: [module=RepositoryServlet, ecid=79740104487,1] ERROR: Repository Gateway error: Request Processing Error:+
portal.wwsbr_api.delete_item: PROCEDURE DOESN'T EXIST
This is normal as the procedure is executed by PORTAL_PUBIC. Granting execute privileges on wwsbr_api to public did not help. The error message changed to :
+10/05/07 11:58:27 portal: [module=RepositoryServlet, ecid=79740176945,1] ERROR: Repository Gateway error: Database Error: ORA=6502 ORA-06502: PL/SQL: numeric or value error: character to number conversion error+
ORA-06512: at line 31
In this case, you probably need to wrap the wwsbr_api.delete_item() procedure into your own procedure and call this from your portlet.
Hope this helps,
EJ

Similar Messages

  • Deleted Items Stay in Edit mode?

    When Adding Items to a portal, for instance an Image... and then I want to delete that image... I can delete it so the image no longer shows on the finished page, but the Item still shows in the Edit mode. How do I delete the Item so it no longer shows in Item mode

    Assuming that you are using 10g:<br><br>
    Yes, you can disable this feature. Click on Properties of the Page Group that you want to disable this feature. Go to the third tab Items.<br><br>
    On this tab you will see 2 options :<br>
    Retain Deleted Items <br>
    Display Unpublished, Expired, and Deleted Items In Edit Mode <br><br>
    Either enable or disable based on your preferences.

  • Item field to non-editable mode(display mode) in Purchase Order(ME22n).

    Hi SDN,
    Based on the Comany code i need to modify the item level fields like <b>Item, Account Assignment, Material</b> to non-editable mode(display mode) in Purchase Order(ME22n).
    So i modifed in the method MODIFY_SCREEN_TC_LINE of class CL_TABLE_VIEW_MM and set the value L_FIELD_STATUS = *  for the screen filed MEPO1211-EBELP. When i execute, the whole column changed to display mode and the empty rows filled with 0(zero). But i want only grey mode for the line items that are present for that PO but not for the whole column. So can any one guide me to do so. I am using 4.6c.
    Thanks in Advance
    Regards
    Basha

    Hi Ramesh,
    Normally you can change the currency field, after entering information in Data base's table, go to Detail's table and change the rate as you want, then directly choose your PO number.
    so the system accept the rate entered aven though the PO had another rate.
    Regards.

  • How to make a field in non Editable mode

    Hi All:
    Now i created one form through wizard method this consists of following details
    Table name:T1
    Fields:No,Name
    here my requirement is how to make this "No" field in non editable mode after the insertion of the first record.

    You can make it a display item, you can disable the item, or you can set the update property to No. See the set_item_property in the Help documentation.

  • 'Choose function drop-down is coming in non editing mode

    Hi,
       I am trying to create RFC iView.I given function Group asBAPI_BILLINGDOC_GETDETAIL and Function Name: as BILLINGDOC.But once i am selecting the button Find  'Choose function drop-down is coming in non editing mode. Please provide the needful.
    Thanks,
    kundan

    Hi,
    Plz ensure the function group name and funciton module name are correct..
    Drop down will be enabled only after clicking on find button provided by proper details of function group and name

  • FBL5N - Feild selection non editable mode

    Hi All,
    When i execute FBL5N transaction,i am not able to select the feilds as per my desire bcoz the feild display ICON is in non editable mode.
    The only option i have is layout selection and not the feilds selection.
    Can you let me know how to change it to editable mode.
    regards

    Hello,
    You don't have authorization for maintain ALV layouts. Please contact to your Basis department for authorization.
    ALV layout authorization object is S_ALV_LAYO. Please tell your Basis departman to give this object value for '23'.
    Regards,
    Burak

  • Help Needed---Opening Attachments/Templates of a BP in non-editable mode

    Hi...
    I am new to CRM...
    How do we open a document/Template attached to a BP in non-editable mode in web UI?
    Helpful Answers would be rewarded.
    Thanks
    Swapna

    Hi...
    I am new to CRM...
    How do we open a document/Template attached to a BP in non-editable mode in web UI?
    Helpful Answers would be rewarded.
    Thanks
    Swapna

  • Selection screen in Non-EDIT mode

    Hi all,
    I have a selection screen in which the user wants a field to be in Non-EDIT mode. How to do it?
    PARAMETERS : s_vkorg like vbrk-vkorg default '1000'.
    (The above parameter shud be in non-editable mode) 
    select-options : s_vtweg for vbrk-vtweg.
    select-options : s_spart for vbrk-spart.
    Pls reply.
    Thanks in advance.
    Vijay

    Vijay,
    Use the code below.
    REPORT zscreen.
    TABLES: vbrk.
    SELECT-OPTIONS : s_vtweg FOR vbrk-vtweg MODIF ID mo1.
    SELECT-OPTIONS : s_spart FOR vbrk-spart MODIF ID mo1.
    * At selection Screen Output Event
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'MO1'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.

  • The note field is in non-editable mode in appraisal document

    Hi all,
    In appraisal document,
    the reviewer can give his comment in the status u201CIn Processu201D and in the Sub Status u201CAnnual Review by Addl Managers/Reviewersu201D in an appraisal document. It is editable when I am trying via web but when I try to upload the comment from backend GUI  ( using phap_admin) the note field is in non-editable mode. My client requires it in editable mode at the back end.
    Can any one help me on thisu2026

    Hello Girish,
    Can you please check the appraisal  template, Proper access has been given to use the note column. If still faces problem can look for the BADI  HRHAP00_COL_ACCESS.
    You can look for the following notes also :
    1554467   column access does not work
    Best Regards,
    Deepak..

  • Appraisal Document opens in non-editable mode

    The Appraisal cycle is as follows: Appraisee-> Appraiser-> Reviewer
    The appraisal document is flowing correctly as per the status flow and the corresponding participants are able to act on it. But when the Appraisal document reaches the Reviewer, i.e. the last stage, it opens in a non-editable mode. Hence the Reviewer is not able to make any changes in the document. The buttons are also in disabled mode.
    Request you to help me with the same.

    Hi,
    Thanks for your response. Problem solved. The Roles and Element access was fine.
    Needed to set the BSP iView parameter MODE = X
    Now its working fine.
    Sheetal

  • ALV Grid fields from editable to non-editable mode

    Hi,
    I am displaying my data through ALV Grid. In my grid the non-key fields are in editable mode.
    When I edit any of the editable fields and place the cursor on other field the field which I have edited should become disable(non-editable). Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it.
    Thanks & Regards,
    Adithya M.

    Hi Adithya,
    I am confused by your statement "place the cursor on other field the field which I have edited should become disable" -- are you stating that this is the requirement or what is currently happening with your program.  The way the edit fields should work by default is they are editable at all times unless you tell it otherwise. 
    If you are saying your requirement is to change the field to disabled once the field is edited (runtime change), first you want to handle the event on data changed then within your method of handling on data changed, you can disable the field from being edited by using cell styles and changing the value to disabled. 
    If you look at program BCALV_GRID_EDIT,
    You will find code where it disables the field for edit using Cell Style -- this will give you an idea how Cell Style controls editable fields and display fields:
            ls_cell-style  = cl_gui_alv_grid=>mc_style_enabled.
            ls_cell-maxlen = 4.
            ls_cell-fieldname = 'CARRNAME'.
            append ls_cell to gt_sflight-cell.
    This specific code will set the field disabled when the program is first exectued, in your case if you need to do this at run time, after someone edits the field, you need to implement handling the event on data changed, in the same program you will find:
    method handle_data_changed.                 
       perform data_changed using er_data_changed.
    endmethod.                     
    It is within this method that you can disable a field for editing.
    However, once it is disabled you will not get back into the handle_data_changed method.  I'm not sure I understand your statement "Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it."  Why would you want the user to be able to edit something, then show it disabled, then let them click on it and edit it again?  Why not just leave it in edit mode?  Maybe if I understand the requirement better, I can answer this portion of the question. 
    If this is based on security or changing from edit to display for the entire grid, you can run the same program mentioned above and click on the Change/Display button in the top left to see how it enables and disables the entire grid for editing.
    Cheers,
    Bonnie

  • Text Items are non editable

    Hi,
    I have developed a simple form, which will display values from a view.
    I have set the Update Allowed and Insert Allowed properties to Yes, still the fields are non editable.
    Can anyone please help me on this.
    Thanks in advance

    user593058 wrote:
    I mean, I could not able to insert new values or update existing values in the form. You haven't answered my question.
    Were you able to change the values on the screen but couldn't save it to the database or you couldn't even change the values in the item's on the form's screen???
    When you say you are not able to change values, what is the error code/message you are receiving????? You need to provide some information.
    Can you explain the above approach? and if we have trigger on the view, then the fields will be editable?If your view is a simple view with no join between two tables, then you can update if you have a join bewteen 2 or more tables and you have calculated fields then you need to have database triggers on the view to execute DML operations on the base tables.
    Tony

  • In sales order sold to party is non editable mode

    Dear Experts ,
    I am facing one issue regarding customer code in sales order,my issue is
    As we are creating sales order with reference to service order ,when it comes to sales order the sold to party is in  non editable field,as we want to give the option for the user to change the sold to party address and save the document,is there any standard process to change the sold to party at sales order level,how to do that,and what will be the effect If i change the sold to party address,soon reply will be more helpful and thankfull.
    I have check all the related questions but I cant find related answer for this.

    Hello,
    Sold to Part is non modifiable in SAP Standard.
    For changing Customer address you need to change the Sold to Party code in Sales Order.
    Just go to partners Tab & double click on Customer Code of required partner & system will open Customer Address in new screen. You can change the address here.
    This change will be applicable only to particular Transaction & Customer Master address will not be changed.
    Hope this helps,
    Thanks,
    Jignesh Mehta

  • IPhoto shows original as thumbnail and in non-edit mode

    Hey guys,
    my problem started when my MacBook Pro turned of
    when iPhoto '11 was open
    without going into safety mode (battery needs replacement; haven't planned on it since it is only 3 years old and 550 cycles)
    then no thumbnails were displayed at all, so I started the rebuilding. But that did not work out at all.
    my problem is that if I use iPhoto:
    Thumbnails displays the original photo not the edited one
    If I look at the Photo in fullscreen (double-click the photo) it shows the original
    If i go into edit mode (pressing ENTER) the "real" photo shows up,
    and i can go back an it is the original again
    i can edit it, undo it and then the thumbnail and fullscreen photo is ok
    RAW photos just show up in edit mode, else it is blackscreen with a "/!\"
    Please help me, since iPhoto is totally unusable to me now and I'm sad
    Thank you for your help!
    //Alkoholfrei

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Non-editable mode for customer master data in VA01 and VA02

    Hi all,
    User requirement is they don't want to give permission to change customer master data (payer & ship-to ). I didn't find any user exit to do screen non-editable.
    Can any one help me in this..
    Regards,
    Sudhakara

    Hi Sudhakar Reddy,
    For this transaction code user exits available :
    SDTRM001  Reschedule schedule lines without a new ATP check
    V45A0001  Determine alternative materials for product selection
    V45A0002  Predefine sold-to party in sales document
    V45A0003  Collector for customer function modulpool MV45A
    V45A0004  Copy packing proposal
    V45E0001  Update the purchase order from the sales order
    V45E0002  Data transfer in procurement elements (PRreq., assembly
    V45L0001  SD component supplier processing (customer enhancements
    V45P0001  SD customer function for cross-company code sales
    V45S0001  Update sales document from configuration
    V45S0003  MRP-relevance for incomplete configuration
    V45S0004  Effectivity type in sales order
    V45W0001  SD Service Management: Forward Contract Data to Item
    V46H0001  SD Customer functions for resource-related billing
    V60F0001  SD Billing plan (customer enhancement) diff. to billing
    For ur requirement whixh exit is suitable plz check it out. other wise put breakpoint for userexit and check it out.
    Rewards somr points.
    Rgds,
    P.Nag

Maybe you are looking for

  • How do I activate iMessage on my macbook pro?

    how do I activate iMessage on my macbook pro? I have opearting system: Software  Mac OS X Lion 10.7.4 I cannot find it anywhere

  • Plz help me out ASAP

    I ve table having following data: item_code    ent_dt 10112005          2002-10-25 10112005          2002-12-18 10112006          2005-03-31 10112006          2005-07-01 10112006          2005-08-09 10112020          2002-09-23 10112020          2002

  • What is the importance of Only One Business Partner Allowed

    Hi all, We know that the Relation between BP and Contract account is : 1 BP : n CA. If the above relation is true, I would like to know the importance of the configuration "Only One Business Partner Allowed" in the below path: Financial Accounting(Ne

  • How to install the backup made during my last sync

    I just had a recent problem with the update 2.0.2 which I have been reading has happened to many other people. My problem is not about that since I am not going to update now until 2.0.3 comes out just in case. Anyways, after I had a technician in Ar

  • Shaun the Sheep in After Effects

    i just want to share. lol i accidentally press shift button and right mouse click over this area and then....... you may also try this unpredictable thing. i dont know where the sound came from but if you're using OSX lion and AE CS5 this thing will