Web Application Opener - WebSnap!
Chapter 6, Practice: Tadapterdispatcher and Adaptection
6-1 Action's Original
In Modules in Chapter Chapter, we discussed the Dispatcher to play in the entire WebSnap. In addition to pagedispatcher, there is another important Dispatcher component in WebSNAP: Tadapterdispatcher, I still remember us. Do you have to set her actionname characteristic value before using ActionButton? This is the information used by TadapterDispatcher. You should see the Script program similar to the following Script:
>
The string in OnClick will be sent to TadapterDispatcher, and she solves an Action information by a part of the blue word. __SP represents the name of the action after the action is successful, __fp is the name of the network page that is lost after the failure, and there is no existing __cp in this here. Grid.adapter1.Query is the name of Action and the Module and Adapter, and TADAPTERDISPATCH will search for the correct Module and build her. Seeing this, you should have a little over, and after building Module is getting adapter and executes Query this action. Then why do you have to save the success with the failed web page to this string? This brings out another side of the action. In terms of technical, you may change these two characteristics in the action of the adaptation. Value, but this may cause some problems. For example, when performing this action, there is no password code code, then the two characteristic values become preset, and after execution, it is of course an error to break, so Action provides both eventparam and onexecute, when Action Before being displayed, the ONGETPARAM event is triggered before the output is the above string, and you can add the parameters you want to keep, when this action is executed, these parameters will be sent to the onexecute event, please Look at the picture below: (Figure: 7)
We can take the parameters and make the correct back-action. After these concepts, we can explain the symbol of this code:
>
The above code comes from our Grid Page. In addition to the parameters we talked before, you can also see the _l this value, this is a key value, used to move the DataSet record when executed. A pen, when Editrow Action is directed to Edit PageModule, you can display the correct record, let's take a look at the value of Edit's Apply Action:
You should be able to explain this Action, but only this action is unable to explain the entire Apply action, and those who are familiar with the web design know that when we are handling the webpage of the database, we will store the original value of the record in the Hidden Field state in the web page. When the user apply, we compare the original value with the new value in the control, and then use these original values to achieve the correct record and store. To solve the entire movement of WebSnap to process this process, we must start from this Script program from the Edit network page:
... ... ... ..
Let me see the __am this line, this line is the AdapterMode setting in the fieldGroup, and WebSnap uses this line to determine the Action time when Adaptermode is in that kind. The following __ov is the original value of CustNo, then __key this line you should know what is the purpose, but you may be confused, why there are two values of the same use exist? Action does not already have this value Do you still remember that the MasterDetailedIT web page we allow users to be renovated in more than one detail? You can try to change a record after the record, you will find all the renovation Accented, if only the key value in an action is not enough? This is the meaning of this value. If you observe the action and hiddenfields in MasterDetailedit, HiddenRecordfields, you will find information on the action and __key value, you should understand how Action moves, and Why do you design it like this, you can also write your own Action to simplify your job, which is left in detail in the inside websnap. 6-2 Temperations Action: DefaultAction
When you use the setting action PageName to turn to a certain page module, if you set the defaultaction in this page module, you can use the RedirectOptios feature value in the action to determine whether it is DEFAULTACTION:
When you set an Action's RedirectOptios for Roredirect HttpPost, you will touch the defaultaction event in the page module when you perform an action, but you must be careful. When the action in the defaultaction is also set to RoredirectHttpPost, you will enter infinite back. Circle, this technology can be used to direct her to this web page after the user performs Action, performs some initialization actions in front of the destination web page, unlike OnBeforedSpatchPage, she is only started when the action or call RedirectTopage orientation, OnBeforeDispatchPage It is started before the web output, uses the defaultaction or OnBeForedISPATCHPAGE, if you initialize the action, you should initialize the web output, then you should write on the onbeforeDispatcher, if you need to guide or understand the call RedirectTopage Turned to some initialization action, using defaultAction will be better selection, of course! The two may be used in practice, then be careful, the two may be triggered, the defaultAction's Onexecute is the first The triggered action is then the OnBeforeDispatchPage. This chapter
This chapter I discussed with you the definition and transportation process in WebSNAP, and WEBSNAP is interacting with Hidden Field, which is very useful for you to explore an action or write an action component.