DISPLAYTOR Using Decorator

xiaoxiao2021-03-06  40

There are two kinds of Decorator, one is in DisplayTag: Table, one is used in DisplayTag: Column, the former is valid for the respective attributes in the entire table, and the latter is valid for a single column. So, in the former, you must write the GET method in the Decorator class that the response, named Get BeanProperty (bean property), the former needs to inherit the TableDecorator class, the latter only need to implement the DecoRate method of the ColumnDecorator class ( Return a string). With regard to the principle of Decorator, this is the use of Decorator properties, the data is taken out from the bean, and then pass it into Decorator, the former is called the getCurrentrowobject method in the Decorator class to get the current bean, then call the bean GET method Public string getdate () {return this.dateformat.format ((ListObject) this.getcurrentrowobject ()). GetDate ());}), the latter is data directly to its Decorate method.

When the data is complete, then return to the page display, so the Decorator class is actually packaged after packaging the original attribute, which means paint, which means that this is also one. Basic design mode, but if you want to output a Checkbox or Radio, you can overwrite the previous input, directly output what you want, like this: return "; then you will cover the data into the package into Checkbox output.

转载请注明原文地址:https://www.9cbs.com/read-77592.html

New Post(0)