I have a form with a Save Form button. There are times I display the form with everything PROTECTED (like, after an order has shipped), so everything is read only. There is no problem protecting all of the fields, but the button is still visible and the user can click it. How can I make this button go away?
Thanks
Bruce
Hide Save Form Button
Re: Hide Save Form Button
In your form operation section, you have two buttons by default (Save and close). You can remove the save button.BLOMASKY wrote:I have a form with a Save Form button. There are times I display the form with everything PROTECTED (like, after an order has shipped), so everything is read only. There is no problem protecting all of the fields, but the button is still visible and the user can click it. How can I make this button go away?
Thanks
Bruce
Re: Hide Save Form Button
I don't want to remove the button, (cause, many times the user CAN and WILL edit the data, but after the order has shipped, I don't want that button (and really don't want to duplicate the form, having 2, one for editing and one for viewing.
-
- Posts: 619
- Joined: Wed Jun 17, 2015 11:16 pm
- Location: Omaha, Nebraska
- Contact:
Re: Hide Save Form Button
Pretty much any of this kind of stuff can be done with a script.
VocalDay Solutions - Agility - Predictability - Quality
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Hide Save Form Button
John is right - a script would easily remove any buttons in any forms or queries.
In this particular case you can also protect the entire object, not individual fields - if the entire object is protected the Save button should be removed.
And I think the VIEW operation, rather than Edit to bring up the form will have the same effect (not too sure about this one)
In this particular case you can also protect the entire object, not individual fields - if the entire object is protected the Save button should be removed.
And I think the VIEW operation, rather than Edit to bring up the form will have the same effect (not too sure about this one)
Aware IM Support Team
Re: Hide Save Form Button
and, perhaps, you can share the script that would remove a button? pretty please???
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Hide Save Form Button
This "render" script should do it:
$("#" + parser.m_widgetInfo.wrapperId).find (".aw-form-buttons .k-primary.k-button").css ("display", "none");
$("#" + parser.m_widgetInfo.wrapperId).find (".aw-form-buttons .k-primary.k-button").css ("display", "none");
Aware IM Support Team
Re: Hide Save Form Button
Thanks for the reply, but its getting a tad off topic. I only want to "Conditionally" hide the save button. So can that be done in the advanced script section of the form?
Thanks
Bruce
Thanks
Bruce
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Hide Save Form Button
What I don't know is how to access an attribute in the BO in scope. (in this case, I have an attribute called "status" and it's not displayed on the form, but if status = 'Complete' then I want to remove the button. Is there a tutorial (or some help somewhere) on how to access BO.attributes in the advanced script section. (I assume its not <<BO.attrName>> like we do everywhere else!)
Bruce
Bruce
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Hide Save Form Button
First of all you MUST add this attribute to the form (doesn't matter where), but it should be hidden. To hide an attribute add the following to the script of the attribute:
markup.css ("display", "none");
Then to access it use this in the render script of the form:
var field = parser.getField ("AttributeName");
To get the current value:
var value = field.getValue ();
I think all of this is documented in the Programmers Reference Guide, but I cannot be sure.
So:
if (parser.getField ("status").getValue () == "Complete")
$("#" + parser.m_widgetInfo.wrapperId).find (".aw-form-buttons .k-primary.k-button").css ("display", "none");
markup.css ("display", "none");
Then to access it use this in the render script of the form:
var field = parser.getField ("AttributeName");
To get the current value:
var value = field.getValue ();
I think all of this is documented in the Programmers Reference Guide, but I cannot be sure.
So:
if (parser.getField ("status").getValue () == "Complete")
$("#" + parser.m_widgetInfo.wrapperId).find (".aw-form-buttons .k-primary.k-button").css ("display", "none");
Aware IM Support Team
-
- Posts: 619
- Joined: Wed Jun 17, 2015 11:16 pm
- Location: Omaha, Nebraska
- Contact:
Re: Hide Save Form Button
I haven't tried this, but something along these lines should work ...
The Form parser has getField function that takes the AttributeName and FormSectionName as parameters and returns a field object. Then you can field value for your condition check.
1. Include the "status" field on the form. Hide it if you don't want it to be displayed.
2. Get the "status" field from the parser
3. Get the value of the "status" field
4. If the "status" field = "Complete", hide the Save button
***Render Script***
var field = parser.getField (“status”, “Main”);
var value = field.getValue ();
If (value == "Complete") {
$("#" + parser.m_widgetInfo.wrapperId).find (".aw-form-buttons .k-primary.k-button").css ("display", "none");
}
The Form parser has getField function that takes the AttributeName and FormSectionName as parameters and returns a field object. Then you can field value for your condition check.
1. Include the "status" field on the form. Hide it if you don't want it to be displayed.
2. Get the "status" field from the parser
3. Get the value of the "status" field
4. If the "status" field = "Complete", hide the Save button
***Render Script***
var field = parser.getField (“status”, “Main”);
var value = field.getValue ();
If (value == "Complete") {
$("#" + parser.m_widgetInfo.wrapperId).find (".aw-form-buttons .k-primary.k-button").css ("display", "none");
}
VocalDay Solutions - Agility - Predictability - Quality
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
-
- Posts: 619
- Joined: Wed Jun 17, 2015 11:16 pm
- Location: Omaha, Nebraska
- Contact:
Re: Hide Save Form Button
Yeah ... what he said.
VocalDay Solutions - Agility - Predictability - Quality
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
Re: Hide Save Form Button
Thanks John!
Thanks AwareSupport!
I guess I have to re-read the programmers reference again. I hate asking questions that are answered in the documentation.
Back to reading....
Bruce
Thanks AwareSupport!
I guess I have to re-read the programmers reference again. I hate asking questions that are answered in the documentation.
Back to reading....
Bruce