Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Using Repeat Control for Data Entry

Integrated Application Platform › Forums › General › Using Repeat Control for Data Entry

  • This topic has 5 replies, 3 voices, and was last updated 5 years, 3 months ago by ajith.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 5, 2018 at 2:02 am #1365
    ajith
    Participant

    Hi,

    Suppose I have an Access defined as

    Controller
    	{
    	Controls: ('Access' 'mytable'
    			#(Vert 
    				field_1 
    				field_2
    				(Repeat(Horz sub_1 sub_2))))}

    for entering data into mytable with the fields field_1, field_2 and field_3.
    How can I get the data from the Repeat get filled into field_3 of the relevant record?

    Note that my query is related to what was discussed in https://suneido.com/forums/topic/a-field-to-enter-structured-text/

    Thanks,
    ajith

    February 5, 2018 at 2:19 am #1366
    amckinlay
    Keymaster

    Hi Ajith,

    I think all you need to do is add name to the Repeat

    (Repeat (...) name: field3)

    Andrew

    February 6, 2018 at 5:06 am #1368
    ajith
    Participant

    Hi Andrew.

    Yes, that small addition does the magic.

    But, when the layout is complex, I get an error message – uninitialized member: “Name”
    This happens when Repeat is kept inside two containers of the same type as in this example

    #(Vert
    				field_a
    				field_b
    				(Horz
    					Fill
    					Vert(
    					(Repeat(Horz sub_1 sub_2) name:field_c)))))

    Adding a Name:”V2″” to the inner Vert brings another error- uninitialized member: “YStretch”.

    Please do explain a bit of what is happening when a name argument is given / which other controls can be used in a similar fashion to enter data into a field (without using a field definition).

    Thanks,
    ajith

    February 6, 2018 at 5:38 pm #1371
    amckinlay
    Keymaster

    I’m not sure what the errors are from. I’m traveling again (and so is Jeff), but I’ll see if I can get someone to look into it.

    “name:”, which becomes .Name after construction, is used for several things. For example, when you refer to a control by e.g. .Horz.Field the “Horz” and “Field” are the names of the respective controls. A lot of controls have default names (look for Name: on the class) but the default name can be overridden by specifying name: on the control specification e.g. (Horz … name: myhorz)

    When you specify just a field name, so the control comes from the Field_ definition, then the name is automatically set to the field name.

    RecordControl also uses the names as the field names in the record that it manages. This works with any control that is “data aware” i.e. Send ‘Data’, ‘NewValue’, and ‘NoData’. Most of the standard controls e.g. Field and CheckBox are like this.

    I hope that helps explain it a little.

    February 6, 2018 at 6:10 pm #1372
    liqian
    Participant

    Hi Ajith,

    I think you have wrong parentheses around vert

    Please try the following code:

    Controller
    	{
    	Controls: ('Access' 'mytable'
    			#(Vert 
    				field_1 
    				field_2
    				Fill
    					(Vert
    						(Repeat (Horz sub_1 sub_2) name: 'field_3')
    					)
    			)
    		)
    	}
    February 7, 2018 at 12:52 am #1373
    ajith
    Participant

    Hi Andrew and Liqian,

    Thanks for the explanation and pointing out my error. Everything is working fine after correcting my error.

    ajith

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language