Thursday, 22 September 2016

Using "tactic_load" and "tactic_popup" to dynamically load widgets

The TACTIC Custom Layout Editor is a key tool for building enterprise applications in TACTIC.  When building dynamic enterprise applications, dynamically loaded view or a custom widget make for a much better end user experience.  



Dynamic loading can be done with the javascript api function:


spt.panel.load(element, class_name, kwargs);


However, this function requires writing a full behavior with custom javascript code.  Using Javascript is necessary if some logic is required to determine what to load, but often one just needs to load a know widget with known keyword arguments.  This can be very easily achieved using custom html classes.  For example, to a load a view “customers.list”, one could just use the “tactic_load” class:


<div>
<input type=”button tactic_load” view=”customers.list” target=”content” value=”View Customers” />
<div class=”content”/>
</div>


This will create a button with the label “View Customers”.  When clicking, it will dynamically load the view “customers.list” into the “content” element.  This is a very simple way to create a dynamically loaded applications.  It is very useful for creating sidebars or menu items.


Sometimes arguments need to passed to this new view.  This is easily done by adding extra attributes to the html element


<input type=”button tactic_load” view=”customers.list” target=”content” search_type=”workflow/asset” value=”View Customers” />


This will add the “search_type” key with the value “workflow/asset” into the kwargs of the view “customer.list”.  This is very useful for configuring the usage of a widget that is to be loaded.  Even more powerful would be to make the value a variable that is determined in Python.
Similarly, the “tactic_popup” class will open up a popup with the corresponding widget.  This is often used to open up edit or insert widgets or to display some additional information.  

The use of these built-in classes make for a very powerful application building tool.   For a concrete example, this is how the TACTIC Portal loads most of its content.  Since these classes can open up any widget in TACTIC,  one can create complex dynamic applications very quickly.

6 comments:

  1. It's a nice article, Which you have shared here about tactic. Your article is very interesting and I really liked the way you expressed your views in this post. Thank you. oracle fusion scm online training

    ReplyDelete
  2. Excellent article. I was interested in reading this. By the way, I was also interested in reading an article about 3 point essay https://wr1ter.com/3-point-thesis. Thanks to this information, I realized that there are certain requirements on how to write abstracts for an article, for a conference, for defending a dissertation, but, in principle, the essence of such an essay is the same: to make it clear to the reader what the work is about, what its novelty and uniqueness are, what postulates you defend and what is your evidence base.

    ReplyDelete
  3. Thanks for creating such a topic! If you are searching for someone to help with writing manga script format papers then I am the one who can provide the best tips. I would be very glad to help you anyway.

    ReplyDelete
  4. I have no idea at all how others do, but I rarely managed to write an essay, but when I entered the university, this site https://essaysrescue.com/slader-review/ was recommended to me, since any written work will be written on it, it is very easy and simple

    ReplyDelete
  5. Software testing will help launch your career as an IT professional if you are just starting out.


    Software testing has recently improved significantly in terms of professional development, educational opportunities, and earning potential.



    You can pursue becoming a Developer if you desire to advance in this industry.

    Software Testing Course In Pune

    ReplyDelete