RSS

A Message Board, Guestbook, or Poll hosted for your website.
Iron Speed Technical Forums

Register Login New Posts Chat
 
Iron Speed > Forums > Code Repository V5.X > Hide Navigation Controls on Quick Add
 
Username:  
Password:  
 
   
 


Thread Tools Search This Thread 
Reply
 
Author Comment
 
porphi
Registered: 09/07/05
Posts: 1,136

    12/29/08 at 08:33 AMReply with quote#1

Hello All,

 

            I like the quick add links that Iron Speed generates so that supporting data elements can be setup on the fly.  I do not like the additional navigation options presented to the user when the add record panel is all that’s needed.  To hide these additional controls I added the following code to the menu panels LoadData event so the control is hidden.  If you have a cleaner way please share it.

 

Phil

Code:
 
public void LoadData()
{
// LoadData reads database data and assigns it to UI controls.
// Customize by adding code before or after the call to LoadData_Base()
// or replace the call to LoadData_Base().
LoadData_Base();
// hide menu if its being called by a popup add
if (!this.IsPostBack)
{
if (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) != null && BaseClasses.Utils.NetUtils.GetUrlParam(this, "DFKA", false) != null)
{
this.Visible = false;
}
}
}


__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
dingjing
Avatar / Picture

MVP Developer
Registered: 02/28/06
Posts: 1,464

    12/29/08 at 08:46 AMReply with quote#2

Nice tip!
porphi
Registered: 09/07/05
Posts: 1,136

    12/30/08 at 07:04 AMReply with quote#3

Jing,

      Thank you very much, have a safe and happy new year.

Phil

__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
JimiJ
Avatar / Picture

MVP Developer
Registered: 03/31/05
Posts: 4,028

    12/30/08 at 07:41 PMReply with quote#4

Phil,

I'm trying to implement your tip but I can't seem to figure out what's missing.

Thanks,

__________________
Jaime Jegonia
JimiTron Software
JimiTron.Net | JimiTron.Com
porphi
Registered: 09/07/05
Posts: 1,136

    01/01/09 at 12:01 PMReply with quote#5

Jimi,

 

      I can guess that it's not hiding the menu control?  If it’s doing something different let me know.  Where are you placing the code and if you would show us the code.

 

       One other note I’m using ISD 5.2.1 for this and have not tried it in any other version.  As you can see its fairly straight forward, query the parameters and check for Target and DFKA.  I also believe that it’s case sensitive.

 

 
Phil

__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
JimiJ
Avatar / Picture

MVP Developer
Registered: 03/31/05
Posts: 4,028

    01/01/09 at 06:46 PMReply with quote#6

Phil,

I was lazy to just copy and paste your code and I realized that "&&" breaks your code.

I noticed also that we can even remove the "if (!this.IsPostBack)" tag 
since LoadData() is not called during postbacks as follows:

public void LoadData()
    {
       LoadData_Base();
         if (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) != null &&  

         BaseClasses.Utils.NetUtils.GetUrlParam (this, "DFKA", false) != null)
           {
              this.Visible = false;
           }
    }


Thank you for the impressive tip! 



__________________
Jaime Jegonia
JimiTron Software
JimiTron.Net | JimiTron.Com
JimiJ
Avatar / Picture

MVP Developer
Registered: 03/31/05
Posts: 4,028

    01/12/09 at 04:03 AMReply with quote#7

Following Phil's trick, you may want to hide also the SaveAndNEwButton during quick Add as follows: 
public void LoadData()
{
LoadData_Base();
if (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) != null && BaseClasses.Utils.NetUtils.GetUrlParam (this, "DFKA", false) != null)
   {
   this.SaveAndNewButton.Visible = false;
   }
}

Cheers,

__________________
Jaime Jegonia
JimiTron Software
JimiTron.Net | JimiTron.Com
porphi
Registered: 09/07/05
Posts: 1,136

    01/12/09 at 06:39 AMReply with quote#8

Jimi,

 

            If granular control is needed then at the page level seems like a good place for the code however for application wide implementation add the following code to the LoadData event in \Shared\ThemeButton.ascx.cs.

 

      if (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) != null && BaseClasses.Utils.NetUtils.GetUrlParam(this, "DFKA", false) != null)

      {

        if(this._Button.ClientID.ToUpper() == "SAVEANDNEWBUTTON__BUTTON")

          this.Visible = false;

      }         

 

Phil



__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
JohnHadj
Registered: 09/13/05
Posts: 878

    03/07/09 at 11:01 AMReply with quote#9

A great, simple tip.  Thanks guys.

It's perhaps something that should be "built in" to IS

John

echo4sos
Avatar / Picture

MVP Developer
Registered: 01/20/06
Posts: 304

    03/18/09 at 02:19 PMReply with quote#10

Quick question: If we implement Phil's suggestion to add code to the LoadData_Base event in \Shared\ThemeButton.ascx.cs, won't this be overwritten upon every build?
 
TIA

__________________
-Bill
porphi
Registered: 09/07/05
Posts: 1,136

    03/18/09 at 02:49 PMReply with quote#11

echo4sos,

 

            Good catch, you are right I meant to say LoadData event in the custom section.  Thank you for pointing that out.  I’ll correct the original post also.

 

      public void LoadData()

      {

      // LoadData reads database data and assigns it to UI controls.

      // Customize by adding code before or after the call to LoadData_Base()

      // or replace the call to LoadData_Base().

      LoadData_Base();

      if (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) != null && BaseClasses.Utils.NetUtils.GetUrlParam(this, "DFKA", false) != null)

      {

        if (this._Button.ClientID.ToUpper() == "SAVEANDNEWBUTTON__BUTTON")

          this.Visible = false;

        if (this._Button.ClientID.ToUpper() == "SAVEBUTTON__BUTTON")

           this._Button.Text = "Save and Return";

      }

      }

 

Phil


__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
echo4sos
Avatar / Picture

MVP Developer
Registered: 01/20/06
Posts: 304

    03/18/09 at 04:21 PMReply with quote#12

Thanks Phil. You are one of the many great contributors to the forums. Keep up the great posts!



-Bill

__________________
-Bill
porphi
Registered: 09/07/05
Posts: 1,136

    03/22/09 at 12:18 PMReply with quote#13

Bill,

 

            Thank you for the kind words.  I know that you are also someone that is really good about responding to post with really useful information.

 

Phil


__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
gelder
Registered: 04/19/06
Posts: 32

    12/13/09 at 12:45 PMReply with quote#14

Phil,

you can also comment out in HTML ".  It will hide until you change something on the page.  ISD will rewrite.  If you are finish with changes the QuickButtons will stay hidden.  Just a real simple way of doing the hide.

I hope this helps a little.

gelder

__________________
gelder
porphi
Registered: 09/07/05
Posts: 1,136

    12/14/09 at 08:23 AMReply with quote#15

* Updated to include visibility of the header

 

            I like the quick add links that Iron Speed generates so that supporting data elements can be setup on the fly.  I do not like the additional page header and navigation options presented to the user when the add record panel is all that is needed.  To hide these additional controls I added the following code to the header and menu panels LoadData event so the control is hidden.

 

In the Header and Footer directory find the code behind file Header.ascx.(cs/vb) and place the following code in the LoadData event;

 

C# Code

this.Visible = (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) == null && BaseClasses.Utils.NetUtils.GetUrlParam(this, "DFKA", false) == null);

 

VB Code:

Me.Visible = (BaseClasses.Utils.NetUtils.GetUrlParam(Me, "Target", False) = Nothing AndAlso BaseClasses.Utils.NetUtils.GetUrlParam(Me, "DFKA", False) = Nothing)

 

In the Menu Panels directory locate the code behind file Menu.ascx.(cs/vb) and place the following code in the LoadData event;

 

C# Code

this.Visible = (BaseClasses.Utils.NetUtils.GetUrlParam(this, "Target", false) == null && BaseClasses.Utils.NetUtils.GetUrlParam(this, "DFKA", false) == null);

 

VB Code:

Me.Visible = (BaseClasses.Utils.NetUtils.GetUrlParam(Me, "Target", False) = Nothing AndAlso BaseClasses.Utils.NetUtils.GetUrlParam(Me, "DFKA", False) = Nothing)

 

 

Phil


__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
Atlanta: 678-362-2035
Chicago: 708-497-3039
http://www.ppgainc.com
http://www.visualfreightbroker.com
http://www.efreightclaim.com
Previous Thread | Next Thread
Page 1 of 2   1  |  2 > 
Reply

  Bookmarks  
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google

Download Iron Speed Designer

Privacy Statement