• Felipe Oliveira
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi,

I'm having a problem using the actionFunction

My page have a buttom [Add New Car] that creates a empty Custom Object and show a form to allow the user to define the object properties

 

PAGE

<apex:form >
  <apex:actionFunction name="Add_Car" action="{!showAdd_Car}" rerender="Container_Car" status="myStatus" />

  <apex:actionFunction name="CancelAction" action="{!cancelActionr}" rerender="Container_Car" status="myStatus" />

.....

<a class="btn" onclick="Add_Car();" href="#">Add a new Car</a>

......

<apex:outputPanel id="Container_Car" rendered="{!IF(showForm=='showAdd_Car', 'true', 'false')}">
   <h3>New Car</h3>

   <apex:inputField value="{!currentCar.Name}" />

......

<a class="btn" href="#" onclick="SaveObject();">Save Changes</a>
<a class="btn" href="#" onclick="CancelAction();">Cancel</a>


</apex:outputPanel>

 

</apex:form>

 

CONTROLLER

 

public PageReference showAdd_ShipToAddress() {
  currentCar = new Car__c(); 
  showForm = 'showAdd_Car';
  return null;
}

 

public PageReference cancelAction () {
    currentCar = new Car__c();
   return null;
}

 

______________________________________________________________________


The first part, show the form, works great. 

My problem is the cancel action.

When I click on the cancel button, the server side is called, but before my action cancelAction be called, the currentCar object is validated and return some message errors because the inputFields for the validade properties are empty.

 

Is it possible to disable the object validation before I submit? 

Or how do I intercept the call before the object is validade in the controller?

 

thanks a lot

 

 

 

 

Hi,

 

I could not found a way to remove the <span> wrapper that is added to the VF Components.

This span tag is breaking the page layout.

 

I tried to use the solution in this page

http://boards.developerforce.com/t5/Force-com-Sites/Remove-span-tag-from-Sites-component/td-p/146175

 

But for some reason I cant save the dirty page on the server.

 

Any kind of help would be appreciated.

 

 

hi

 

Im new to APEX and VF.

 

I'm trying to create a bread crumbs system for my pages. The idea is to add pages to map and than loop through the map and build the bread crumbs.

 

The problem Im facing is the order of the items interated over the loop is not the same of items added in the map.

 

Do you guys know how to loop and maintain the original item order?

 

this is my code

 

 breadCrumbs = new Map<String,String>{'Home'=>'/apex/Home','Build Car'=>'/apex/Build_car'};

 for (String fieldName : breadCrumbs.keySet()){
     sBreadCrumbs = sBreadCrumbs + '<a href="' + breadCrumbs.get(fieldName) + '">' + fieldName + '</a>'; 
 }

 

Any ideas how to maintain the order in the loop?

 

 

 

 

Hi,

I'm having a problem using the actionFunction

My page have a buttom [Add New Car] that creates a empty Custom Object and show a form to allow the user to define the object properties

 

PAGE

<apex:form >
  <apex:actionFunction name="Add_Car" action="{!showAdd_Car}" rerender="Container_Car" status="myStatus" />

  <apex:actionFunction name="CancelAction" action="{!cancelActionr}" rerender="Container_Car" status="myStatus" />

.....

<a class="btn" onclick="Add_Car();" href="#">Add a new Car</a>

......

<apex:outputPanel id="Container_Car" rendered="{!IF(showForm=='showAdd_Car', 'true', 'false')}">
   <h3>New Car</h3>

   <apex:inputField value="{!currentCar.Name}" />

......

<a class="btn" href="#" onclick="SaveObject();">Save Changes</a>
<a class="btn" href="#" onclick="CancelAction();">Cancel</a>


</apex:outputPanel>

 

</apex:form>

 

CONTROLLER

 

public PageReference showAdd_ShipToAddress() {
  currentCar = new Car__c(); 
  showForm = 'showAdd_Car';
  return null;
}

 

public PageReference cancelAction () {
    currentCar = new Car__c();
   return null;
}

 

______________________________________________________________________


The first part, show the form, works great. 

My problem is the cancel action.

When I click on the cancel button, the server side is called, but before my action cancelAction be called, the currentCar object is validated and return some message errors because the inputFields for the validade properties are empty.

 

Is it possible to disable the object validation before I submit? 

Or how do I intercept the call before the object is validade in the controller?

 

thanks a lot

 

 

 

 

hi

 

Im new to APEX and VF.

 

I'm trying to create a bread crumbs system for my pages. The idea is to add pages to map and than loop through the map and build the bread crumbs.

 

The problem Im facing is the order of the items interated over the loop is not the same of items added in the map.

 

Do you guys know how to loop and maintain the original item order?

 

this is my code

 

 breadCrumbs = new Map<String,String>{'Home'=>'/apex/Home','Build Car'=>'/apex/Build_car'};

 for (String fieldName : breadCrumbs.keySet()){
     sBreadCrumbs = sBreadCrumbs + '<a href="' + breadCrumbs.get(fieldName) + '">' + fieldName + '</a>'; 
 }

 

Any ideas how to maintain the order in the loop?