function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Scott.MScott.M 

Query Parameter Arrays

I know I've seen posts about this before but the search is failing me. This seems like a really basic question - but is there an array syntax in visualforce for input fields similar to php?

 

For example if i create a series of input fields with name equal to "myInput[]" can I then retrieve the array on the server side in an action with System.getCurrentPageReference().getParameters().get('myInput'); ? 

mtbclimbermtbclimber

No, get('paramname') returns a single string.

 

What is your use case? Specifically, why does the standard data binding mechanism not support your needs?

 

Thanks,

Scott.MScott.M

The use case is for dynamic list generation. For these types of interfaces there is no way of knowing how many items will be added to the list.

 

We have built dynamic list solutions using the standard components with standard data binding but we're moving away from them because we're looking to build a more responsive interface. We'd like to keep the number of http requests to minimum, so in the case of dynamically creating a list there's no need to make a call to the server until the user is finished building the list. So instead of having functions that create objects on the server side every time the user adds a new item we'd like to make one http request on save. We have some other use cases where this kind of functionality would come in handy as well.

 

Worse case scenario we'll write a serialization function on the client side. 

 

 

Paulo CastroPaulo Castro

Did you find the solution? Or you had to write some JS code on client side?

 

Andrew, VF don't have a solution for it?

 

Best regards 

 

PH

 

mtbclimbermtbclimber
No, there has been no change to the getParameters() map.