- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2015 04:12 AM
Hello Gurus,
I`ve created custom macros, which I want to initiate/call from within other macros or UI pages. However, one thing I am not sure about is "the phase" in which a nested macro should be initiated.. Should i be using <g or <g2 instead ? What is the best/recommended practice on this ?
thanks a lot for your help
Cheers
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2015 12:14 AM
Here goes the examples that probes the statement on the prior post:
Given a simple macro like the following:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var='jvar_now'>
gs.nowNoTZ();
</g:evaluate>
This macro current Date is: <input id="id_test" value='${jvar_now}' />
</j:jelly>
1 - In a form: The results are cached when used from a form. I reloaded the below form multiple times and the time displayed never changed.
2- In a UI Page: The results are NOT cached when used in a UI page. The time will change every time i reloaded a UI page from which I'm invoking the macro:
3- In a MOBILE view: The results are NOT cached. The time will change every time I reloaded the macro using the view path for mobile
So, having reviewed our examples, you should only use g1 when your results can be cached and been aware that these would not be cached if used from a UI Page or from a Mobile View.
I really hope this was helpful. I enjoyed building the example on the various views... so thanks for asking the follow up question!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2015 11:04 AM
Did you manage to call custom UI macro from g tag?
I am struggling to do this.
I also request community members also to help on this if anyone knows how to call custom UI macro in UI page using g tag.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 08:18 PM
Here is an example of how I've done it (i.e. calling a UI Macro from within a UI Page or from within another UI Macro):
<g:call function="my_ui_macro" my_parm_one='parm1 value' my_parm_two='parm2 value' />
Ty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2015 11:28 AM
Hi Maros,
There is a really good blog by SlightlyLoony out on the community about this, maybe that will help you to get an answer.
Jelly: A Tale of Two Phases...
Jelly: The Second Phase of Madness...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2015 02:47 AM
I believe I`ve read these articles. Most of it is very obvious. However if you look at SNOW jelly code, you`ll find some confusing parts. Running phase 2 snippets to determine whether or not to execute phase 1 code.. which is a bit weird as you would expect that to run first...