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 - Dynamically create properties

Hello Experts,

7.1.1

Apologies for hammering WD questions on the forum - all help is much appreciated! :)

 

Is it possible to dynamically add properties in a collection?

Basically I need to display a bunch of combobox type properties but I don't know in advance how many of those will be there. Effectively I need to create a property to store each selection in the combobox. I tried using the same property for all but then it messed up the selected values in the display when the user selects another property.

As an example, the form might be like this:

Q) Server Required? (dropdown: S01, S02, S03)

Q) DB Required? (dropdown: D01,D02,D03)

Q) Access Required (dropdown: Read,Write)

For now, I have a single-row collection "SelectedVal". I tied this to the combobox for all the boxes. The comboxes are shown in a grid iteration (with a save button after each option), so when the user clicks save I can save the selected value to a different collection, however sharing the common "SelectedVal" collection messes up the display when the user selects different value in the dropdowns.

Any suggestions?

Thanks

Kin

  • I think I can phrase this one a bit better

    I have a collection (Vars), and I have multiple columns inside it (Val1,Val2,Val3,Val4....Val10)
    Now, I'm iterating over a different collection (Iterator). Within it, I call a Combobox and give it a list of values to be shown. What I want is that the first time the combbox is invoked, the value is tored in Val1, next time in Val2, after that in Val3 etc.

    Something like:

    i = 0
    For Each (elem in Iterator)
    Vars.Column("Val" + i) = <selected value from combobox>
    i++
    Next
  • I can't think of any useful scenario where this would be a useful solution.
    You don't need more properties but a clear workflow.
    I think another row with some events will help you, after you have defined your use case.
  • Hi Geraldine

    My use case is of a dependent drop-down properties, however I don't know how many such properties will be displayed.

    Let's say I first select a value from dropdown1 (DD1), then based on that I need to show a filtered list of values in DD2, then based on that a filtered list of values in DD3 and so on. An example of this could be

    Pick a phone manufacturer: <List of manufacturers>
    Pick a phone model : <based on Q1 above>
    Pick a colour: <based on Q2 above>
    ...
    ...

    To further complicate this issue, the form is not static i.e. for some products we might have 6 such dependent dropdowns, for some we might have 2 etc. The dropdowns and their values are stored in a custom table, along with their parent.

    Not sure if this helps.
  • So you don't need any dynamic properties.
    Just more collections, rows, events and viewing conditions.
    All of that is already in the standard web, nothing to struggle with.
  • Ok, thanks Geraldine, I'll redesign this