You need to sign in to do that
Don't have an account?
siddarth raj
How to pass parameter on button click to the controller on a repeat block
Following is the page
apex:repeat value="{!wrapper.consignments}" var="consignment" id="delivConsignmentList">
<apex:pageBlockSection title="Consignment {!consignment.Position__c}" id="delivConsignment">
<apex:outputField value="{!consignment.Due__c}" id="delivDue" styleClass="due"/>
and so on
<apex:commandButton value=" DIR " action="{!newdirForConsignment}" id="btnRaiseDIR" />
</apex:repeat>
This comman button will not an Ajax call it will not rerender rather on button click it just open a new window with reference to the particular consignment.
As it is repeated button for each consignment how would i identify this button being clicked from particular consignment , mean want id of the consignment on which the button is been clikced to the controller. Any ideas please
Thanks in advance to all
apex:repeat value="{!wrapper.consignments}" var="consignment" id="delivConsignmentList">
<apex:pageBlockSection title="Consignment {!consignment.Position__c}" id="delivConsignment">
<apex:outputField value="{!consignment.Due__c}" id="delivDue" styleClass="due"/>
and so on
<apex:commandButton value=" DIR " action="{!newdirForConsignment}" id="btnRaiseDIR" />
</apex:repeat>
This comman button will not an Ajax call it will not rerender rather on button click it just open a new window with reference to the particular consignment.
As it is repeated button for each consignment how would i identify this button being clicked from particular consignment , mean want id of the consignment on which the button is been clikced to the controller. Any ideas please
Thanks in advance to all
Try passing parameter using <apex:param>.Below is the sample code:
Thanks for the reply
This approach only working on rerender
But in my scenario I have to open a new window with the reference to the consignment no rerender of same page.
You will probably be better off using the onClick attribute of a html button, and then calling a Visualforce remoting function with a parameter. See the "sayHello" example here: https://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm
Hi james
Thanks for the Suggestion.
Seems Remote function is something like ajax like which we could achieve throught he rerender.
Where my scenario I wnated to open a new page not to have changes on same page.
If it is just one object on the page it would have qute easy to pass or obtain id of the object in controller..but here it is
A page called delivery which would have multiple consignments (repeat block) We will have a button called DIR for each consignment on this deliverypage...
In the controller call i should able to get the id of the consignment from which this is being triggered.(clicked)
This is what our scenario... Appreciate if you have any suggestions.