• Fan Yang
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 15
    Replies

Hi,

 

I just want to focus on a inputtextbox than the first, when a page is opened. But it doesn't work.

 

 

<apex:page controller="focus">
	<apex:form id="f1">
	<apex:inputtext id="field1" />
	<apex:inputtext id="field2" />
	</apex:form>		
	<script>
		function focu(){
			document.getElementById('{!$Component.f1.field2}').focus();
		}
		
		focu();
	</script>
</apex:page>

 

 

Curiously, using a command button focus is correctly moved to 2nd inputtext box.

 

 

<apex:page controller="focus">
	<apex:form id="f1">
	<apex:inputtext id="field1" />
	<apex:inputtext id="field2" />
	<apex:commandbutton value="f2" onclick="focu();" rerender="nothing"/>
	</apex:form>		
	<script>
		function focu(){
			document.getElementById('{!$Component.f1.field2}').focus();
		}
	</script>
</apex:page>

 

 

Someone please help me.

 

Thanks in advance

I can do:

 

<apex:repeat value="{!myListData}" var="p">

  {!p.Name} = {!p.Value}

</apex:repeat>

 

 

however the following failed:

 

<apex:repeat value="{!myListData}" var="p">

  <c:MyComponent v1="{!p.Name}" v2="{!p.Value}" />

</apex:repeat>

 

What did I miss?

 

 

 

When using repeat in my visulaforce page as follows, I'm having "Authorization Required" error:

<apex:repeat value="{!MyListData}" var="l">

 <c:MyCustomComponent ... />

</apex:repeat>

if I hard code <c:MyCustomComponent ../>, which works fine. What's wrong? can anybody help? TVM.

 

 

Is it possible not to render apex:component in SPAN,  just let it rendered whatever I've coded

Hi,

 

I just want to focus on a inputtextbox than the first, when a page is opened. But it doesn't work.

 

 

<apex:page controller="focus">
	<apex:form id="f1">
	<apex:inputtext id="field1" />
	<apex:inputtext id="field2" />
	</apex:form>		
	<script>
		function focu(){
			document.getElementById('{!$Component.f1.field2}').focus();
		}
		
		focu();
	</script>
</apex:page>

 

 

Curiously, using a command button focus is correctly moved to 2nd inputtext box.

 

 

<apex:page controller="focus">
	<apex:form id="f1">
	<apex:inputtext id="field1" />
	<apex:inputtext id="field2" />
	<apex:commandbutton value="f2" onclick="focu();" rerender="nothing"/>
	</apex:form>		
	<script>
		function focu(){
			document.getElementById('{!$Component.f1.field2}').focus();
		}
	</script>
</apex:page>

 

 

Someone please help me.

 

Thanks in advance

Hi, I've been following developer forum for quite some time. The posts are have been very useful for me. 

 

I have been developing a visualforce page, replacing "new" opportunity button with a custome visualforce page. 

The issue we have encountered here is, other profile user are not able to access to the new visualforce page for opportunity. 

When the users click on the "new" button, the message is saying that the users are having insufficient priviledge to access to create a new opportunity. 

 

 

Blow is my code, which replaces the "new" button on opportunity.

------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

<apex:page standardController="Opportunity" sidebar="true" extensions="OppDefaultFieldVal"  >
    <apex:sectionHeader title="Edit Opportunity" subtitle="{!opportunity.name}"/>
    <apex:form >
          <apex:pageBlock title="Edit Opportunity" id="thePageBlock" mode="edit">
             <apex:pageMessages />
            <apex:pageBlockButtons >
                 <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}" rendered="true"/>               
               </apex:pageBlockButtons>
            <apex:actionRegion >
                <apex:pageBlockSection title="Basic Information" columns="1">
                    <apex:outputField value="{!opportunity.recordtypeid}"/>
                    <apex:inputField value="{!opportunity.Salesperson__c}"/>
                    <apex:inputField value="{!opportunity.name}" />
                    <apex:inputField value="{!opportunity.closedate}"/>
                    <apex:inputField value="{!opportunity.StageName}"/>
                    <apex:inputField value="{!opportunity.accountid}"/>
                    <apex:inputField value="{!opportunity.Credit_Terms__c}" />
                    <apex:inputField value="{!opportunity.Description}"/>
                </apex:pageBlockSection>
            </apex:actionRegion>
          </apex:pageBlock>
    </apex:form>
</apex:page>
______________________________________________________________________________________________
I hope anyone could help me to solve this issue.
Thank You.

I can do:

 

<apex:repeat value="{!myListData}" var="p">

  {!p.Name} = {!p.Value}

</apex:repeat>

 

 

however the following failed:

 

<apex:repeat value="{!myListData}" var="p">

  <c:MyComponent v1="{!p.Name}" v2="{!p.Value}" />

</apex:repeat>

 

What did I miss?

 

 

 

When using repeat in my visulaforce page as follows, I'm having "Authorization Required" error:

<apex:repeat value="{!MyListData}" var="l">

 <c:MyCustomComponent ... />

</apex:repeat>

if I hard code <c:MyCustomComponent ../>, which works fine. What's wrong? can anybody help? TVM.

 

 

Is it possible not to render apex:component in SPAN,  just let it rendered whatever I've coded

I have a user who just installed the Office Connector from inside SF (in the Desktop Integration section of Personal Setup), and it appears to have installed a version 4.0 of the toolkit.

 

He's getting the "Can't find project or library" error that others have reported getting as a result of a mismatch between Version 2.0 of the toolkit and Version 6.16 of the Excel Connector.

 

Has there been an updated version of the Excel Connector that will work with Version 4.0 of the toolkit? If not, how do I downgrade him back to Version 3.0, since the only version that will download from SF setup is version 4.0?  

 

This is not the most technical of users, and I'm supporting him from 200 miles away, so I can't just go to his computer and do it for him. So asking him to go to the Developer Toolkit type sites and figure out what to do is asking for disaster. Please help!

Hi,

 

 I'm triying to insert a new Lead and throw me this error message:

 

System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, invalid parameter value

 

 I have a commandButton that call the method like this:

 

 

<apex:commandButton value="ADD TO LEADS" action="{!addLead}" />

 

And the method:

 

 

 

public PageReference addLead () {

Lead newLead = new Lead(Email='foo@foo.com', FirstName='Foo Name', Company='Foo Company', LastName='Foo Last Name');
insert newLead;

PageReference pageRef = new PageReference('/'+ Lead.sObjectType.getDescribe().getKeyPrefix());
pageRef.setRedirect(true);
return pageRef;
}

 

 

 

 

 

Any idea??

 

Thanks

J.