Skip to Content
avatar image
Former Member

work around context elements

Hi all,

I have a context node cardinality 0..n

I need this to render a set of ui elements.

Let say the node have 2 attributes named bank1 and bank2.

Every time user click on a button 2 add a new set of 2 input fields bank1 and bank2. I will add this towards the context node.

Now let say there are already 3 sets of ui elemnents and 3 sets of context elements.

Set 1

Set 2

Set 3

The problem: User can only always delete the most recent set but not set 1 or set 2. How to allow user to cherry pick which set to delete?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jun 17, 2011 at 08:33 AM

    Did you provide any button for deletion against each set...

    Or else you can do one thing...If a user clicks on button for deletion...show the user a popup for those UI elements that needs to be deleted by giving a checkbox against each set...so that those which are checked can be deleted at one go..

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Krishna Reddy B

      Hi kissnas,

      The problem is not about removing element.

      I have dynamically rendered several sets of ui elements (input fields/text view/drop down etc )

      All these input fields/drop downs are bind to context node cardinality 0..n with their respective attributes.

      Say there 3 sets of ui elements now,

      Set 1

      Set 2

      Set 3

      User can only delete the most recent set like set 3 then followed by set 2 and set 1. The program supposed to let user delete any set they wish. How to do that?

      To better understand the problem:

      initially say three input elements added

      1. Input 1 - Binding -> INFOTYPE9_RENDER.1.BANKN -> value = "Account1"

      2. Input 2 - Binding -> INFOTYPE9_RENDER.2.BANKN -> value = "Account2"

      3. Input 3 - Binding -> INFOTYPE9_RENDER.3.BANKN -> Value = "Account3"

      now if the user deletes the first input set. you are deleting the context element 1. Once you delete the first element, the index of second element will be automatically changed from 2 to 1 and same for 3rd element from 3 to 2.

      so after deleting the first element your context collection will look like this

      INFOTYPE9_RENDER.1.BANKN -> value = "Account2"

      INFOTYPE9_RENDER.2.BANKN -> value = "Account3"

      there wont be any element with index 3. But your 3rd input is still pointing to INFOTYPE9_RENDER.3.BANKN which is not available in the context collection.

      so in this case you need to change the binding of the reminaing two input fields

      1. Input 2 - Binding -> INFOTYPE9_RENDER.1.BANKN -> value = "Account2"

      2. Input 3 - Binding -> INFOTYPE9_RENDER.2.BANKN -> Value = "Account3"

      How do I reset the binding of the 2 remaining input fields?

  • avatar image
    Former Member
    Jun 20, 2011 at 04:15 AM

    Hello siong,

    please dont create two threads for the same problem. Close the other thread if its not answered and always have one thread for one problem.

    in your use case retaining the mapping between the UI elements id and context element index will be a problem in the deletion case. Because if you delete a context element, the index of other elements will be changed automatically. But your UI element Id wont be changed.

    Workaround/solution for your usecase

    1. Whenver the user clicks on delete button, always delete the last set of UI elements. But in the context node, delete the respective context element (context element of respective index)

    ex: if you have 3 set of UI elements, if the user opts to delete the first set, then delete the 3rd set if UI elements and delete the context element of index '1'.

    in the same scenario if the user opts of delete the 2nd set of ui elements, then delete the 3rd set of UI elements and delete the context element of index '2'.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 21, 2011 at 04:34 AM

    What I did was:

    1. Delete and re-arrange my itab ( in delete action )

    2. Remove all UI elements (wddomodifyview)

    3. Invalidate all context elements (wddomodifyview)

    4. Rebind the context with the re-arrange itab (wddomodifyview)

    5. Re-render the UI elements with the re-arrange itab (wddomodifyview)

    Add comment
    10|10000 characters needed characters exceeded