If object B doesn't have collection, we only need to represent B as grid B and then save the object. But how do I represent this case? one solution crossed my mind is using another grid. so everytime the row selected in grid representing object B is changing, the grid representing C changes to display C objects owned by the currently selected object B.but this poses another problem. I want to send the data by json to the server. lets say grid B has 5 B objects, and right now object B number 2 is selected, so grid C displays list of C objects of B number 2 only. So I cannot include the C objects of the other 4 B objects in the json string I'm about to send to server. Some help please? thanks
I don't have the code yet. It's still conceptual. Because of this problem, my coding process is halted. But is the problem clear to you? I'm still thinking of the layout design that can accommodate this case.
I don't understand any of that question. I suppose that might be because the classes are named A, B, and C, though, which increases the coefficient of meaninglessness. You're talking about grids, and then collections, and then objects, and then sending data to servers... so there's a bit of GUI design, a bit of data design, a bit of describing actions, all about some unnamed objects which contain basically no useful data.
And yes, your coding process certainly should be halted. You don't have anything which you can write code for. So carry on designing until you have something which you can describe.
since this is still an idea (none of my projects have encountered such case, but somehow this morning I thought of it, so why not prepare even if this case hasn't happened yet). lets say you have 5 sons, and each of these sons of yours has 3 sons. For your details, I can simply use textboxes to store your name, DOB and age. as for your sons, a grid will do (it consists of 3 columns : name,age,DOB, just like your details). Now the problem is with your grandsons. What I think now is adding another grid below your son's grid (lets say grandson grid). If I select son number 2 in son's grid, the grandson grid will display the details of son number 2's sons (but none of the remaining 4 sons' sons). As far as I know I can only grab data displayed at the screen, so I'm missing the details of the other 4 sons' sons when I build my json string.
Is this about right? So how do you propose I build the json string ? Remember, we're in the view right now (i.e. html displayed in the browser, client-side) not some java file, that's why I thought this question should be put in HTML section. Right now the layout design is your detail, your sons' detail in grid Son and your sons' son's details in grid Grandson. as I've said earlier, the problem is with the grandson details. how do I get them when I build json?
That's just a representation in the java side. I'm looking for the appropriate layout strategy for this scenario in my html. The inheritance doesn't matter. Perhaps I chose the wrong analogy since the focus seems to have shifted to inheritance which is not my question. My problem is a grid which each of its rows has their own details. What I've encountered until now is just a case like an receipt with a list of stuff to buy. For this, a couple of textboxes for the receipt info(like the date of purchase, buyer's name, etc) followed by a grid of things to buy will do the trick. Hopefully this is clear enough to describe my problem.