You need to sign in to do that
Don't have an account?

assing apex variable by visualforce tag
hi,
i am using
<apex:repeat value="{!item_Details}" var="item">
<apex:outputPanel styleClass="op_Item_Details" >
<apex:outputField value="{!item.Image__c}"/>
<apex:outputLabel value="{!item.Product_Name__c}"/>
<apex:outputLabel value="{!item.Price__c}" id="me"/> /-
<apex:commandButton value="Item Details" action="{!show_Item_Description}" rerender="item_Popup" style="width:100px;"/>
</apex:outputPanel>
</apex:repeat>
and i want to assing apex variable to above current product item.
i have used actionfunction for onclick event on commandbutton but it's not working.
i am using
<apex:repeat value="{!item_Details}" var="item">
<apex:outputPanel styleClass="op_Item_Details" >
<apex:outputField value="{!item.Image__c}"/>
<apex:outputLabel value="{!item.Product_Name__c}"/>
<apex:outputLabel value="{!item.Price__c}" id="me"/> /-
<apex:commandButton value="Item Details" action="{!show_Item_Description}" rerender="item_Popup" style="width:100px;"/>
</apex:outputPanel>
</apex:repeat>
and i want to assing apex variable to above current product item.
i have used actionfunction for onclick event on commandbutton but it's not working.
Can you provide the actionfunction code that you tried, so that I can understand better what you are trying to achieve exactly? Also, please help me understand your requirement better by providing more details.
Thanks,
Shashank
<apex:outputPanel styleClass="op_Item_ContainerInner">
<apex:repeat value="{!item_Details}" var="item">
<apex:outputPanel styleClass="op_Item_Details" >
<apex:outputField value="{!item.Image__c}" id="iImage"/>
<apex:outputLabel value="{!item.Product_Name__c}" id="iName"/>
<apex:outputLabel value="{!item.Price__c}" id="iPrice"/> /-
<apex:commandButton value="Item Details" action="{!show_Item_Description}" rerender="item_Popup" style="width:100px;" onclick="callActionMethod()" />
</apex:outputPanel>
</apex:repeat>
<apex:actionFunction name="popupSetValue" action="{!popup_Details}" reRender="popup_Result">
<apex:param name="image_Param" assignTo="{!product_iImage}" value="" />
<apex:param name="name_Param" assignTo="{!product_iName}" value="" />
<apex:param name="price_Param" assignTo="{!product_iPrice}" value="" />
</apex:actionFunction>
</apex:outputPanel>
--------------------------------------
<script type="text/javascript">
function callActionMethod()
{
var txtImage= document.getElementById("{!$Component.frm.iImage}").value;
var txtName= document.getElementById("{!$Component.frm.iName}").value;
var txtPrice= document.getElementById("{!$Component.frm.iPrice}").value;
popupSetValue(txtImage,txtName,txtPrice);
}
</script>
-------------------------------