You need to sign in to do that
Don't have an account?
balu palavalasa
error in line 0
hi all,
I have witten a vf code in which it shows "Error in ine 0 " i could not understand whats the error is. Please halp me in sorting out the issue.
Below is my code:
------------------------
<apex:page standardController="Account" recordSetVar="accs">
<style>
.activetab {background-color : #9ACD32 ; color:white;}
.inactivetab {backgound-color : #DCDCDC ; color:white;}
</style>
<apex:tabpanel switchtype="Client" selectedtab="Accounts" id="tabpanel1"
tabclass="activetab" inactivetabclass="inactivetab">
<apex:tab label="Account Details" name="Accounts" id="1">
<apex:pageblock title="All Accounts">
<apex:pageblocktable value="{!accs}" var="a">
<apex:column title="Action" >
<apex:outputLink value="{!URLFOR($Action.Account.Edit,a.id)}">Edit
</apex:outputLink> |
<apex:outputlink value="{!URLFOR($Action.Account.Delete,a.id)}">Del</apex:outputlink>
</apex:column>
<apex:column value="{!a.Name}"/>
<apex:column value="{!a.Phone}"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:tab>
</apex:tabpanel>
</apex:page>
Error is :
Error in line 0
I have witten a vf code in which it shows "Error in ine 0 " i could not understand whats the error is. Please halp me in sorting out the issue.
Below is my code:
------------------------
<apex:page standardController="Account" recordSetVar="accs">
<style>
.activetab {background-color : #9ACD32 ; color:white;}
.inactivetab {backgound-color : #DCDCDC ; color:white;}
</style>
<apex:tabpanel switchtype="Client" selectedtab="Accounts" id="tabpanel1"
tabclass="activetab" inactivetabclass="inactivetab">
<apex:tab label="Account Details" name="Accounts" id="1">
<apex:pageblock title="All Accounts">
<apex:pageblocktable value="{!accs}" var="a">
<apex:column title="Action" >
<apex:outputLink value="{!URLFOR($Action.Account.Edit,a.id)}">Edit
</apex:outputLink> |
<apex:outputlink value="{!URLFOR($Action.Account.Delete,a.id)}">Del</apex:outputlink>
</apex:column>
<apex:column value="{!a.Name}"/>
<apex:column value="{!a.Phone}"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:tab>
</apex:tabpanel>
</apex:page>
Error is :
Error in line 0
You were using str for both the selected one and the inputtext.
All Answers
Please let me know if you still face any issue.
If this solves the issue,please mark it as best answer.
thank you for your eply.It is working now.
i have another doubt. I've witten a code which has to take input from an input box and add the input to select options until submit button is pressed.
that is as long as i give input and click on add button it should keep on adding the given input texts to select option list. and if i click on submit button it should display the selectoptions list.
vf code :
<apex:page Controller="selectlistoption">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:outputlabel value="Enter Country"/>
<apex:inputText value="{!str}"/>
<apex:commandButton value="Add" action="{!setCountry}"/>
<apex:commandButton value="submit" rerender="showdetails"/>
</apex:pageBlockSection>
<apex:pageBlockSection id="showdetails">
<apex:selectlist size="1" value="{!str}">
<apex:selectoptions value="{!country}"/>
</apex:selectlist>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller :
public class selectlistoption {
public string str{get;set;}
public list<selectoption> country{get;set;}
public pagereference setCountry()
{
country.add(new selectoption(str,str));
return null;
}
}
Error :
System.NullPointerException: Argument 1 cannot be null
Error is in expression '{!setCountry}' in component <apex:commandButton> in page selectlist: Class.selectlistoption.setCountry: line 11, column 1
Class.selectlistoption.setCountry: line 11, column 1
You were using str for both the selected one and the inputtext.