|
1 | 1 | package com.genexus.webpanels.gridstate ; |
2 | 2 | import com.genexus.*; |
3 | | -import com.genexus.internet.*; |
4 | 3 | import com.genexus.diagnostics.core.ILogger; |
5 | 4 | import com.genexus.diagnostics.core.LogManager; |
6 | 5 | import com.genexus.webpanels.GXWebObjectBase; |
7 | | -import com.genexus.webpanels.WebSession; |
| 6 | +import com.genexus.xml.GXXMLSerializable; |
8 | 7 |
|
9 | 8 | public final class GXGridStateHandler { |
10 | | - public static final ILogger logger = LogManager.getLogger(SdtGridState.class); |
| 9 | + public static final ILogger logger = LogManager.getLogger(GXGridStateHandler.class); |
11 | 10 | private String gridName; |
12 | 11 | private Runnable varsFromState; |
13 | 12 | private Runnable varsToState; |
14 | 13 | private String varsFromStateMethod; |
15 | 14 | private String varsToStateMethod; |
16 | 15 | private Object parent; |
17 | 16 | private ModelContext context; |
18 | | - private SdtGridState state; |
| 17 | + private GXXMLSerializable state; |
19 | 18 |
|
20 | 19 | private GXGridStateHandler(ModelContext context, String gridName, String programName) { |
21 | 20 | this.context = context; |
22 | 21 | this.gridName = programName + "_" + gridName + "_GridState"; |
23 | | - state = new SdtGridState(context); |
24 | 22 | } |
25 | 23 |
|
26 | 24 | public GXGridStateHandler(ModelContext context, String gridName, String programName, Runnable varsFromState, Runnable varsToState) { |
@@ -62,54 +60,39 @@ private void runVarsFromState() { |
62 | 60 | } |
63 | 61 |
|
64 | 62 | public String filterValues(int idx) { |
65 | | - return state.getgxTv_SdtGridState_Inputvalues().elementAt(idx - 1).getgxTv_SdtGridState_InputValuesItem_Value(); |
| 63 | + return ""; |
66 | 64 | } |
67 | 65 |
|
68 | 66 | public void clearFilterValues() { |
69 | | - state.getgxTv_SdtGridState_Inputvalues().clear(); |
| 67 | + |
70 | 68 | } |
71 | 69 |
|
72 | 70 | public void addFilterValue(String name, String value) { |
73 | | - SdtGridState_InputValuesItem GridStateFilterValue = new SdtGridState_InputValuesItem(context); |
74 | | - GridStateFilterValue.setgxTv_SdtGridState_InputValuesItem_Name(name); |
75 | | - GridStateFilterValue.setgxTv_SdtGridState_InputValuesItem_Value(value); |
76 | | - state.getgxTv_SdtGridState_Inputvalues().add(GridStateFilterValue, 0); |
77 | 71 | } |
78 | 72 |
|
79 | 73 | public void saveGridState() { |
80 | | - WebSession session = ((HttpContext) context.getHttpContext()).getWebSession(); |
81 | | - state.fromJSonString(session.getValue(gridName)); |
82 | | - runVarsToState(); |
83 | | - session.setValue(gridName, state.toJSonString()); |
84 | 74 | } |
85 | 75 |
|
86 | 76 | public void loadGridState() { |
87 | | - HttpContext httpContext = (HttpContext) context.getHttpContext(); |
88 | | - HttpRequest httpRequest = httpContext.getHttpRequest(); |
89 | | - WebSession session = httpContext.getWebSession(); |
90 | | - if (GXutil.strcmp(httpRequest.getMethod(), "GET") == 0) { |
91 | | - state.fromJSonString(session.getValue(gridName)); |
92 | | - runVarsFromState(); |
93 | | - } |
94 | 77 | } |
95 | 78 |
|
96 | 79 | public int getFiltercount() { |
97 | | - return state.getgxTv_SdtGridState_Inputvalues().size(); |
| 80 | + return 0; |
98 | 81 | } |
99 | 82 |
|
100 | 83 | public int getCurrentpage() { |
101 | | - return state.getgxTv_SdtGridState_Currentpage(); |
| 84 | + return 0; |
102 | 85 | } |
103 | 86 |
|
104 | 87 | public void setCurrentpage(int value) { |
105 | | - state.setgxTv_SdtGridState_Currentpage(value); |
| 88 | + |
106 | 89 | } |
107 | 90 |
|
108 | | - public SdtGridState getState() { |
| 91 | + public GXXMLSerializable getState() { |
109 | 92 | return this.state; |
110 | 93 | } |
111 | 94 |
|
112 | | - public void setState(SdtGridState state) { |
| 95 | + public void setState(GXXMLSerializable state) { |
113 | 96 | this.state = state; |
114 | 97 | } |
115 | 98 | } |
|
0 commit comments