This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Webdesigner question (again)

Hi Experts,

7.1.1

IS it possible to add a dynamic table? I need to display a table to the user (this is ok), and the user clicks a button "Add Row" which adds another row to the table. 

Not sure how to do this - any help will be much appreciated

Thanks

Kin

  • Yes, this is possible. You can do that if you display your collection via a grid.

    The button can be placed in the footer definition of the grid, so that it will displayed at the end of your table. Within the "Action" block of you button you need to define an "Insert" control for your collection to insert the new row.

    If you want you can also define a static column for a simple property and add a second button at the end of each row, with the option to delete a row if needed. In the "Action" you have to add the "Delete" control and your filter should look like the following code...

    UID_Column = ( SELECT CURRENT UID_Column FROM MyDynamicCollection )

    -
    Regards
    Sven
  •  

    I tried doing what you suggested Sven, but its not working. When I click request nothing pops up which makes me think something is wrong in the config. Any ideas?

    Once again, thanks for taking the time to respond :)

  • I got a bit further and I can see my columns but I don't see the footer containing the button "Add Row". I've configured the footer to Always show.
  • Got it working - had to enable Show Headers always. Thanks Sven
  • In custom module of v7.1.1, I have a grid to display records from a collection (i.e. PersonWantsOrg). I add a component under Local components; have Update and Save actions within Definition/Action with “Collection with filter rule” like uid_personwantsorg = (select current uid_personwantsorg from PersonWantsOrg) and also add the Cursor of Collection to the component. In Main, I have a SAVE button, underneath the Server action I add “Component reference/Call action” to call my local component so that when SAVE button clicked the change would save to the table. However I get the error “There is no cursor defined on the collection PersonWantsOrg”.

    Where could I be wrong or missed?

    Thank you!

  • The Save Button is not in the Grid and Not in the Iteration. It doesn't have a cursor.
  • So a cursor has to associate with the Iteration. I did move SAVE button into the Iteration container but then SAVE button shows on each of rows in the Grid.
    Can you please provide the guidance how to handle this? Thanks!
  • Various options...
    on the grid band see workflow control. Save the cursor to a local collection and then use this on the save button.
  • Hello Geraldine,

    I am not quite sure that I understand how to implement your last sentence "Save the cursor... on the save button". Here is what I did but no luck. Please check where I was wrong so as to right for your suggestion. Thanks!

    1. selected "Row specific action" in Grid band as below.

    2. Not sure how to save the cursor to a local collection (is PersonWantsOrg). Thus I added the cursor to Local components (same to what I did before)

    3. SAVE button call the local component UpdateCP10.

  • In your case the iteration will be done by the grid control. Because you have put the button outside of the grid, you still have no cursor - as Geraldine also said.

    So, because I am not quite sure what you want to do I can give you a way to solve your problem.

    If you want to be able to save each row separatly you can create a new column within your grid that contains your button and the logic that you have implemented.

    Another way could be to create a new column with boolean value that you can name IsSelectedToSave for your collection PersonWantsOrg. Then you need to create a new column for your grid that should contain a checkbox control and should reference to your new column.

    Your save action should contain the following filter:

    IsSelectedToSave = True

    Note: Ensure that you remove the CURRENT syntax.

    -

    Regards

    Sven