• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Create empty typed JSON object?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by proggy View Post
    You can't, perhaps JSON isn't the most appropriate notation for your problem?
    OK. The problem domain is this :

    Client wants Grids on a form. The Grids represent hierarchical data. It must be possible to manipulate the Grids (add and delete parent and child rows) without persisting any data to the database tables until the form is submitted.

    So this means I have to maintain a DataTable per grid in memory.

    There is some GUI logic that says if the "Count" column of the Parent row does not have the correct number of child records then prevent form submission and display some client side validation.

    Owing to the constraints of the BPM framework, this can only be done on the client side. So I need to effectively keep a client side copy of the DataTable.

    JSON looked like a good approach. If you have to create JSON objects prepopulated with garbage then I agree, they are not what I need.

    What would be a better client side technology? I wanted to stay away from basic arrays. JSON had lots of cool stuff baked in to decorate the columns with constraints which I liked.
    Knock first as I might be balancing my chakras.

    Comment


      #12
      Originally posted by suityou01 View Post
      OK. The problem domain is this :

      Client wants Grids on a form. The Grids represent hierarchical data. It must be possible to manipulate the Grids (add and delete parent and child rows) without persisting any data to the database tables until the form is submitted.

      So this means I have to maintain a DataTable per grid in memory.

      There is some GUI logic that says if the "Count" column of the Parent row does not have the correct number of child records then prevent form submission and display some client side validation.

      Owing to the constraints of the BPM framework, this can only be done on the client side. So I need to effectively keep a client side copy of the DataTable.

      JSON looked like a good approach. If you have to create JSON objects prepopulated with garbage then I agree, they are not what I need.

      What would be a better client side technology? I wanted to stay away from basic arrays. JSON had lots of cool stuff baked in to decorate the columns with constraints which I liked.
      What are you using here? .NET ,JAVA, Python ,LISP?

      Comment


        #13
        Originally posted by suityou01 View Post
        How can I create an empty typed JSON object in javascript?
        Originally posted by suityou01 View Post
        Owing to the constraints of the BPM framework, this can only be done on the client side. So I need to effectively keep a client side copy of the DataTable.
        Originally posted by proggy View Post
        What are you using here? .NET ,JAVA, Python ,LISP?
        Why does it matter?
        Knock first as I might be balancing my chakras.

        Comment


          #14
          Originally posted by suityou01 View Post
          Why does it matter?
          Because he doesn't understand what you're asking
          Coffee's for closers

          Comment


            #15
            Originally posted by suityou01 View Post
            Why does it matter?
            Sorry I read grids on a form and thought it was some windows client, my mistake sorry. I'm out of ideas I would do as jmo1 suggests and ask on StackOverflow.

            Comment


              #16
              Originally posted by Spacecadet View Post
              Because he doesn't understand what you're asking
              Now now.
              Knock first as I might be balancing my chakras.

              Comment


                #17
                Originally posted by suityou01 View Post
                Now now.
                I'm busy so just scanned it, missed the part you mentioned this is a web app. I am so sorry. Because of that I will only charge half a days rate.

                Comment


                  #18
                  And he's back databinding to nested arrays........

                  Comment


                    #19
                    Originally posted by DimPrawn View Post
                    And he's back databinding to nested arrays........

                    No, no I'm not. The grids are bound to Datatables.

                    Did you read the thread at all.
                    Knock first as I might be balancing my chakras.

                    Comment


                      #20
                      JSON is javascript and javascript is prototype based and supports dynamic typing. Next !
                      Vote Corbyn ! Save this country !

                      Comment

                      Working...
                      X