Hello,
Is it possible to set initialPreferredViewPortSize for any component using component’s property?
For e.g i have my spec as below
"foundset": { "type": "foundset", "pushToServer": "allow","dynamicDataproviders":true,"provideColumnFormats":true, "sendSelectionViewportInitially": true,"initialPreferredViewPortSize":5000}
So is possbile that I can create a property for the same componet and then user can directly choose what initialViewPortSize he/she wants,something similar to this
"viewPortSize":{"type":"int",default:5000}
"foundset": { "type": "foundset", "pushToServer": "allow","dynamicDataproviders":true,"provideColumnFormats":true, "sendSelectionViewportInitially": true,"initialPreferredViewPortSize":"viewPortSize"}
“viewPortSize”:{“type”:“int”,default:5000} so that they can just input value from the component’s property.
I want users to choose size whichever they feel better.
Currently you can’t do it in the .spec file like that.
What you could do right now is still have that “viewPortSize” defined in the spec. Maybe call it “initialViewPortSize” or “preferredInitialViewPortSize”
cause it doesn’t force the real viewportSize to be always the same.
Then you can use that to call - from the browser - myFoundsetBrowserValue.setPreferredViewportSize(…).
Another option is setting a complete foundset value into the element’s property from server-side scripting (but I suspect you don’t want that)
elements.myFoundsetBasedBean.myFoundset = {
foundset: myNewFoundset,
dataproviders: {
dp1 : "customerName",
dp2 : "city"
},
sendSelectionViewportInitially: false,
initialPreferredViewPortSize: 15
};
If you really want it in the .spec like you mentioned, support for that could be added I guess. You can create a feature req. for that. The thing is - I am not sure how useful this really is. The component itself could detect how much space it has and adjust that dynamically without the need for a separate “initialViewPortSize” property. So I guess it is useful only for the very first show - before the component really knows how much space it has to work with and that can be useful in case the developer only targets known display sizes with that form/component.