• tfoil
  • NEWBIE
  • 35 Points
  • Member since 2012


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hello, 
I have a apex:form with some "apex:inputField" inside it.
I want to click a button that fills some values in those inputFields (using jscript).
Than the user can use another buttom to Save (using apex) those values.
I already made everything. But when i click de jscript buttom, the page blinks the values, than after some secs it disapears.
If I put the jscript button outside the apex:form tag. It works. But i do need it inside, near the inputFields.

Can someone give any help?
 
  • October 05, 2015
  • Like
  • 0

Hello all,

 

 

I've been trying to sort a list of strings like a summary but I have no idea about what to try now.

 

There is my problem:

 

I have string that represents positions in a summary, example: "1", '1.1", "1.1.1", "1.1.2", etc.

 

And I want to sort those in order like a structured things in the Microsoft project.

 

But for strings, "4" is not greater than "1.1". So things won't be in correctly order.

 

Searching in Google and here I tried to make a Wrapper. That looks like this:

 

global class PacoteWrapper implements Comparable {

public Pacote__c pac;

public PacoteWrapper(Pacote__c pc) {
pac = pc;
}

global Integer compareTo(Object compareTo) {

PacoteWrapper compareToPac = (PacoteWrapper)compareTo;

Integer returnValue = 0;

Double posDouble = Double.valueOf(pac.Posicao_EDT__c);
Double posCompareDoulb = Double.valueOf(compareToPac.pac.Posicao_EDT__c);

if (posDouble > posCompareDoulb) {
returnValue = 1;
} else if (posDouble < posCompareDoulb) {
returnValue = -1;
}

return returnValue;
}

 

 

And i use pacWrapperList.sort() to make things works.

 

But it will only works if my string is not greater than 2 dots. 

 

That means, it works great for strings like "1", "1.2", "2.3", etc.

 

It will fail for strings using 2 dots, of course. There is no double number with 2 dots, hahaha.

 

So, if anyone has a tip or a piece of code that can help me, i will be very glad.

 

Thank you all for attention. Best regards!

  • July 20, 2012
  • Like
  • 0
Hello, 
I have a apex:form with some "apex:inputField" inside it.
I want to click a button that fills some values in those inputFields (using jscript).
Than the user can use another buttom to Save (using apex) those values.
I already made everything. But when i click de jscript buttom, the page blinks the values, than after some secs it disapears.
If I put the jscript button outside the apex:form tag. It works. But i do need it inside, near the inputFields.

Can someone give any help?
 
  • October 05, 2015
  • Like
  • 0

Hello all,

 

 

I've been trying to sort a list of strings like a summary but I have no idea about what to try now.

 

There is my problem:

 

I have string that represents positions in a summary, example: "1", '1.1", "1.1.1", "1.1.2", etc.

 

And I want to sort those in order like a structured things in the Microsoft project.

 

But for strings, "4" is not greater than "1.1". So things won't be in correctly order.

 

Searching in Google and here I tried to make a Wrapper. That looks like this:

 

global class PacoteWrapper implements Comparable {

public Pacote__c pac;

public PacoteWrapper(Pacote__c pc) {
pac = pc;
}

global Integer compareTo(Object compareTo) {

PacoteWrapper compareToPac = (PacoteWrapper)compareTo;

Integer returnValue = 0;

Double posDouble = Double.valueOf(pac.Posicao_EDT__c);
Double posCompareDoulb = Double.valueOf(compareToPac.pac.Posicao_EDT__c);

if (posDouble > posCompareDoulb) {
returnValue = 1;
} else if (posDouble < posCompareDoulb) {
returnValue = -1;
}

return returnValue;
}

 

 

And i use pacWrapperList.sort() to make things works.

 

But it will only works if my string is not greater than 2 dots. 

 

That means, it works great for strings like "1", "1.2", "2.3", etc.

 

It will fail for strings using 2 dots, of course. There is no double number with 2 dots, hahaha.

 

So, if anyone has a tip or a piece of code that can help me, i will be very glad.

 

Thank you all for attention. Best regards!

  • July 20, 2012
  • Like
  • 0