Buy Now
Sign in

CC6 When to use What Snytax

CSDweb , December 24 2017
C
CSDweb
Please help. I'm confused and can't find a good guide for using CC6. I have a CC6 connection with a read_placetitle function populating a radio group field inside of a CC6 form which works nicely. Using debug I can see that it creates an array [read_placetitle
  • with the key/value pairs used to populated the radio group. What I can't figure out is how to display the value selected in a text or textarea field so that it can be edited/saved in a db. What syntax do I need to use to get the contents of the [read_placetitle] array to display within a text field? The read_placetitle function has a model name of Placetitle and is set to retrieve these fields (Placetitle.address, Placetitle.title, Placetitle.id). I've tried (as the value for the text field), Placetitle.address, {val:Placetitle.address}, {var:read_placetitle.Placetitle.address}, Data:[address], Data:[read_placetitle] and {var:read_placetitle,Placetitle[address]} but none of these work. What is the proper syntax to use for the value of a text field? It would also be nice to know when/how to use Data: vs Var: with a period vs with
  • . Thank you for any help/insight you can provide.
    admin
    Hi CSDweb,

    If the value is in array format then you can not use it in a text field, you need a single string for the text field.

    You use {data:xyz} to get request data, for url parameters or posted form fields values for example, and {var:abc} to get data returned by functions and views.

    You want to display the value selected in the radio after the form has been first saved ? if yes then you need read the record data and select "first matching" then use something "like" this:
    {var:read_data_name.model.field_name}

    in the value field of your field view.

    Best regards
    Max
    If your main question got answered then please mark the answer using the button!​
    ​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
    C
    CSDweb
    Thank you. This is very useful. I would encourage you to include more information like this in your FAQs for newbies like me. CC6 appears to be a great product, but it's been a very frustrating experience trying to build an application. The demos/FAQs help, but more detail (e.g. a listing) about the commands/syntax to use would be very useful. For example, last evening I came across the use of 'replace/self' in relation to the AJAX Dynamic result of a view but I've not been able to find out when/why it's used or if there are also other options available. I've also seen some references to using the slash (/) with empty but I've not found any instructions on the rules for using it.
    C
    CSDweb
    You want to display the value selected in the radio after the form has been first saved ? if yes then you need read the record data and select "first matching" then use something "like" this: {var:read_data_name.model.field_name}


    What if, as I do you want to dynamically display (in a textfield) the key/value selected in a dropdown when it's changed, but hasn't been saved? I have a dropdown populated with a key/value pair (title/address) with the title selectable. I also have a text box in the same CC6 form where I would like to display the 'address' currently selected via the drowdown, and have it change whenever the dropdown selection is changed. I then want to save the currently selected dropdown selection and the textbox contents.
    admin
    Hi CSDweb,

    Regarding the dropdown, I have posted in the other topic, live updates will need a custom function, because there is no field event to handle this now.

    Regarding the documentation, I will try to prepare more soon.

    Best regards and happy new year!
    Max
    If your main question got answered then please mark the answer using the button!​
    ​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!