473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Getting info into a Object..

Hi - Im sitting and trying to understand this OOP - and need to create a
class wich can do the following..

ShowBlocks() - Displays the data wich is inside it - If empty creates a form
wich sends the info back to the Object, wich show the stuff..
AddBlock( $type ) - Creates an empty blok - wich is addet to a blocks area
object...( Or somethin like it )
Store() - safes the info into a file, and updates mySQL...

I have figured out most of the stuff but the way to get the empty block ->
creating form with some different strings/textbloks and a file -> putting
stuff into object -> now showing what its looks like and aking if i want to
add a extra block....... now showing x blocks then asking if i want an extra
block - i haven´t got a clue of how to do it !

Does anyone of you have an example with an object thats goes : See im a
empty object -> here you can put an line into me -> see im not empty now (
showing the string) do you want to add an extra line ? - ect ect..

In Advance Thanks !
Timo.
Jul 17 '05 #1
2 2312
Timo J wrote:
Does anyone of you have an example with an object thats goes : See im a
empty object -> here you can put an line into me -> see im not empty now (
showing the string) do you want to add an extra line ? - ect ect..


Timo,

I do not really understand the rest of your mail, so i will just try to
answer this last question. Yes, we have objects that output a list and
the user can click a button to add another line. So far it seems what
you are looking for.

But our lines represent objects retrieved from the database. SO if the
user clicks 'Add', he gets a different form that represents the new
object. He fills out the form, then clicks the 'Create new' button and
the object is created, validated and stored in the datbase. If he then
clicks the 'Context' button he gets back into the list, which has a new
line that shows the object's "label". If he clicks on that line he gets
back to the object form that now has a 'Update' button so that he can
modify the object. It seems to me that this is much more then what you
are trying to do.

Assuming you just want an object with text lines, i would do the following:
- create an empty object and let it produce the form. It should put 'Add
line' submit button in the form.
- If the user clicks the 'Add line' button, the form is submitted. The
script then recreates the empty object from the form.
- The object checks the $_RREQUEST and finds out that the 'Add line'
button has been pressed and adds an empty line to itself.
- The objects outputs its form as usual. As there is an empty line in
the object the empty line will also be in the form.
- The user fills out the line. Whatever button (except for a cancel
button) he presses the new line goes into the object and may be saved
into the database or so.

Is this what you wanted to do?

Greetings,

Henk Verhoeven,
www.phppeanuts.org

BTW, for the user it might be nice to have a javascript add the line to
the form without needing the server, but that has little to do with OOP.

Jul 17 '05 #2

"Henk Verhoeven" <ne**@metaclassREMOVE-THIS.nl> skrev i en meddelelse
news:bu**********@news1.tilbu1.nb.home.nl...
Timo J wrote:
Does anyone of you have an example with an object thats goes : See im a
empty object -> here you can put an line into me -> see im not empty now ( showing the string) do you want to add an extra line ? - ect ect..
Timo,

I do not really understand the rest of your mail, so i will just try to
answer this last question. Yes, we have objects that output a list and
the user can click a button to add another line. So far it seems what
you are looking for.

But our lines represent objects retrieved from the database. SO if the
user clicks 'Add', he gets a different form that represents the new
object. He fills out the form, then clicks the 'Create new' button and
the object is created, validated and stored in the datbase. If he then
clicks the 'Context' button he gets back into the list, which has a new
line that shows the object's "label". If he clicks on that line he gets
back to the object form that now has a 'Update' button so that he can
modify the object. It seems to me that this is much more then what you
are trying to do.

Assuming you just want an object with text lines, i would do the

following: - create an empty object and let it produce the form. It should put 'Add
line' submit button in the form.
- If the user clicks the 'Add line' button, the form is submitted. The
script then recreates the empty object from the form.
- The object checks the $_RREQUEST and finds out that the 'Add line'
button has been pressed and adds an empty line to itself.
- The objects outputs its form as usual. As there is an empty line in
the object the empty line will also be in the form.
- The user fills out the line. Whatever button (except for a cancel
button) he presses the new line goes into the object and may be saved
into the database or so.

Is this what you wanted to do?
Well more or less..

Just to claryfy what i specifik is trying to do :

Create a object - wich create a form with the following blank inputfields
( Title, tekst, a link, a picture ) - The user haves two choices

1 ) fill out the form and submit it - wich results in a new page with the
info, nicely set up - with a button for saving the article, and a button
wich adds a new textblock of diffferent type containing ( subtitle , text ,
picture ) - if he adds a new textblock the object shows any previous objects
and creates a form with the info for the new text block and so on...

2) Add textblocks - the user selects additional textblocks or deletes
textblocks until he thinks the layout is nice and then fill out the createt
form containing all textblock mondules...

My idea is to create a object and create an array to store the objects
before being processed - eg. uploading the files/pictures - generating a new
filenames, wich all are compressed to one HTML file and stored on the disk
or in a MysqlDB - and in this way creating a way for easy creating
artickles, storyes with or withou pictures for my website about diving.

I have the following problems :

Creating the object wich can do the above.
Uploading a picture - resampling it to a specifik size, storing it under a
new name ( lastfile number++).
File manipulation - some examples.. my book isent very good on that point..

Well thats about it.... Im a little stressed this month during my exams, and
not getting done anything on my website is realy anoying, so just to get a
little help to do create something or something to work with - to feel that
im doing something on the website is a true blessing.

Thanks !

Timo.
BTW, for the user it might be nice to have a javascript add the line to
the form without needing the server, but that has little to do with OOP.


Will it be a better way useing javascript ? Im not the champ on that
either..
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
15
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
6
by: Jim H | last post by:
I have a class object that creates and uses a System.Threading.Timer. In the destructor for my class I cancel the timer using timer.Change(infinite, infinite) then I call timer.Dispose() to clean...
4
by: Larry Tate | last post by:
I am wanting to get those cool html error pages that ms produces when I hit an error in asp.net. For instance, when I get a compilation error I get an html error page that shows me the ...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
0
by: cnys | last post by:
We have an ASP.NET 2.0 (C#) app and we're trying to add tracing into it. The tracing functionality within .NET is great, but when we output this to a file, it's kind of sparse. So, we're looking...
0
by: Steve | last post by:
Hi All, I have a Python script that uses SOAPpy and I'm outputting all of the methods and info about the parameters... I'm having trouble getting information out of the __init__ parameter. ...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
0
by: rehanmomin | last post by:
Just to start off, I am writing a web application using C#. I have a Menu which is binded to an XML datasource. There are three menu items each with submenus and a textbox where I want to display...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.