CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Form mode - submit/add

Print topic Send  topic

Author Message
TonyReid


Posts: 159
Posted: 02/09/2006, 6:46 AM

Hi,

I have a form that has a listbox and thats great.

The issue is that when the form is being used to update a record - It shows the list box and ideally I would like to replace the listbox with a label showing the value.

How can I use codecharge to programatically work out whether the form is in submit or append mode? I'm guesing this will need to be done in the before show event - but not sure how to tackle it.

Any ideas appreciated :)

Tony

_________________
-----------
PHP/indy Game Developer - http://www.AbsoluteBreeze.co.uk
View profile  Send private message
Walter Kempees
Posted: 02/09/2006, 8:18 AM

Tony,

Somehow I remember answering this yesterday, can't find the post though.
What to do is to read up on Panels, very powerfull stuff.

Then in your form put the listbox on (or should I say in) a Panel.
Add another Panel just to the right of your listbox panel and in that panel
put your Label {Label1}.
Now to build and debug at the same time:
Leave Both panels Visible: Yes
In the Before Show of the Form, you can check if it is in Edit or
InsertMode.
How? well if in editmode the record_id is on the URL otherwise it's not.
So in BeforeShow
  
if (CCGetfromGet("record_id","")=="") {       // insert  
   $Container->ListboxPanel->Visible=Yes;  
   $Container->LabelPanel->Visible=No;  
}else{  
    $Container->Label1->GetValue($Container->TheFieldContaingTheValueEntererByTheListbox);   
// put the data in the Label  
   $Container->ListboxPanel->Visible=No;  
   $Container->LabelPanel->Visible=Yes;  
}  
  
If you do it right (look for   you donot need), The one will fall   
exactly in place of the other.  
  
Success  
  
  

"TonyReid" <TonyReid@forum.codecharge> schreef in bericht
news:543eb55d0b048e@news.codecharge.com...
> Hi,
>
> I have a form that has a listbox and thats great.
>
> The issue is that when the form is being used to update a record - It
> shows the
> list box and ideally I would like to replace the listbox with a label
> showing
> the value.
>
> How can I use codecharge to programatically work out whether the form is
> in
> submit or append mode? I'm guesing this will need to be done in the before
> show
> event - but not sure how to tackle it.
>
> Any ideas appreciated :)
>
> Tony
>
> _________________
> Using: CodeCharge Studio 3.0 - IIS, PHP and MSSQL
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

TonyReid


Posts: 159
Posted: 02/09/2006, 9:37 AM

Thanks Walter :)

That helps a lot.

I'm looking forward to playing with Panels - just havent had the time... but now I have the excuse ;)

Thanks again,
Tony

_________________
-----------
PHP/indy Game Developer - http://www.AbsoluteBreeze.co.uk
View profile  Send private message
Walter Kempees
Posted: 02/09/2006, 10:02 AM

Tony,

If you like to see Panels in operation:
www.dubbellul.nl/calendar
log in using the demo displayed.
When in MyObjects, notice it display Account and Objects, now press
"details" for one of the objects and see the form appear and dissapear.
It's almost like Ajax but not. ;-)
The best one is when you click Reservations for one of the objects, next
page shows MyBookings for say Bungalow 1
You will see account info, Reservation Grid and calendar for this object,
now click details for a reservation, FAST !!
I LOVE PANELS!!!

Walter


"TonyReid" <TonyReid@forum.codecharge> schreef in bericht
news:543eb7dd4e11c6@news.codecharge.com...
> Thanks Walter :)
>
> That helps a lot.
>
> I'm looking forward to playing with Panels - just havent had the time...
> but
> now I have the excuse ;)
>
> Thanks again,
> Tony
>
> _________________
> Using: CodeCharge Studio 3.0 - IIS, PHP and MSSQL
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

TonyReid


Posts: 159
Posted: 02/09/2006, 2:04 PM

Hey thats pretty cool :)

I can see panels being used a lot in the future!

Thanks for letting me take a look.

Tony

_________________
-----------
PHP/indy Game Developer - http://www.AbsoluteBreeze.co.uk
View profile  Send private message
Walter Kempees
Posted: 02/09/2006, 2:17 PM

Welcome, hey a proud father always likes to show off offspring!


"TonyReid" <TonyReid@forum.codecharge> schreef in bericht
news:543ebbc5f6e5d1@news.codecharge.com...
> Hey thats pretty cool :)
>
> I can see panels being used a lot in the future!
>
> Thanks for letting me take a look.
>
> Tony
>
> _________________
> Using: CodeCharge Studio 3.0 - IIS, PHP and MSSQL
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.