Updating embedded components at sea, without updating the entire page

I have a component (ItemTree) that has 3 built-in components. The first (ItemTreeList) is a list of items to select from. The second (ItemGIDE) shows the properties for the item you selected.

How to tell ItemGIDE to update when creating a new item in ItemTreeList?

Firstly, it is more difficult than I do it. ItemTreeList has hirarchy with node and node types. It has collapsible divs and when you click on a top-level hirarchy element or the instance below sets various variables for other objects. Thus, everything happens with one click. I have an ItemTreeList to refresh myself without refreshing the entire page. You just need to “Declare” another component (ItemGIDE), which it must update (again without refreshing the entire page).

  • I have jQuery and Ajax.
  • I am using Visualage Smalltalk 8.5.0 with Seaside 3.0. -I was thinking of calling ItemTree to tell its auxiliary components for updating?
  • I was thinking about using “announce” to “announce” other components for the update?
  • Have I been doing actual programming for less than 6 months?
+4
source share
1 answer

The book , Dynamic Web Development with Seaside, contains a draft chapter on jQuery. There you will find the Replace Component section with an example of what you are asking:

OuterComponent>>renderContentOn: html html div id: (id := html nextId); with: child. html anchor onClick: ((html jQuery id: id) load html: [ :r | child := OtherComponent new; r render: child ]); with: 'Change Component' 

The code shows a method for visualizing an external component. It assumes that the component has a variable called child , which is initialized by the component shown in the original render. In addition, it assumes that the component has a variable called id that is set during rendering to remember the target DOM node where the child component is running. In the AJAX anchor callback, you replace the OtherComponent new child component and OtherComponent new contents of the node target.

+3
source

Source: https://habr.com/ru/post/1433735/


All Articles