PDA

View Full Version : Section .save() message



HankFay
2018-01-15, 00:51
I am doing a manual save in a web app, canvas section:


Lianja.get("mypage.mysection").save();

On success, it flashes a message that the record was successfully saved.

Two questions:

1) can that message be turned off?

2) should the save return a value? Using


var lu = Lianja.get(.....).save();

lu is undefined, per:


Lianja.showMessage(typeof(lu));


thanks,

Hank

barrymavin
2018-01-15, 01:21
Hi Hank,

No the message cannot currently be turned off.

No save() does not return a result. Any failure is reported as an error notification message and the changed data is not committed.

barrymavin
2018-01-15, 22:37
Hi Hank,

See my post regarding "Text translator".

You can translate the messages and the titles to display what you want now.

With respect to save() this can be overridden with your own custom save action.

HankFay
2018-01-15, 23:01
Hi Barry,

the translator is great!

When you say "overridden" -- I can see creating my own "Save" using .getCursor(). But I don't think that's what you meant. How would one go about overriding the Save method: attach a function (without the parens) to the section .save? If that works, I'm home free, come to think of it. :)

thanks,

Hank

barrymavin
2018-01-15, 23:27
Hi Barry,

the translator is great!

When you say "overridden" -- I can see creating my own "Save" using .getCursor(). But I don't think that's what you meant. How would one go about overriding the Save method: attach a function (without the parens) to the section .save? If that works, I'm home free, come to think of it. :)

thanks,

Hank

Custom actions. Everything can be overridden.

HankFay
2018-01-15, 23:53
I see custom actions on the Page, but not the section.

I've searched for documentation on custom actions, but haven't found it. This is a great feature (especially if it were made available in Sections, but I can live with Page, assuming it's possible to simply pass through to the default action, and if the section triggering the save is able to be discerned).

thanks,

Hank

barrymavin
2018-01-16, 00:06
Custom actions are described here.
https://www.lianja.com/doc/index.php/Custom_Delegates

And here.
https://www.lianja.com/doc/index.php/Page_Attributes

If the action returns false the standard action is executed.

barrymavin
2018-01-16, 00:08
Thatís because custom actions correspond with the navigation bar actions.

Section actions are handled by these.