Rafael Andrade

Greenhorn
+ Follow
since Aug 04, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rafael Andrade

Hi man!
Thanks for the reply. That's exactly what I was looking for.
So, the solution is something like this:

<%= check_box_tag "category[#{category.name}]", category.id, category.active %>

We have to pass an array in the first parameter.

Thanks alot.
13 years ago
Hello guys.
I have a page with some checkboxes, and the ones that are checked are coming in the parameters list, with the name & ID. I wanted to receive the data in an Array inside params Hashmap, so I can iterate not having to worry about the other parameters, like action, method, etc.
I'm creating the checkboxes this way:
<%= check_box_tag "#{category.name}", category.id, category.active %>

Anyone know the trick?
Thanks alot.
BTW, was very happy to find out that javaranch has a RoR section!
13 years ago
Hi there. I was used to make reports with iReport, and I did it well. Now I have to use BIRT and thought I would like it, but now I see I don�t. I gotta problem grouping results. It like this: I have a datasource with a select that returns 4 lines. One column, let�s call it Status, can be Y or N. I have 3 Y and one N. I want a report with one line with the number 3 in the column Y and the number 1 in the column N. It was easy o do with iReport, I made a variable, and increaded it, but now I can�t do it on Birt. What should I do?

thanks!
Hi there. I'm having an annoying problem. I got a mapped property on my "boleto" class, and it's working well while saving the object in the db:

@ManyToOne (targetEntity = Pessoa.class, fetch = FetchType.LAZY)
@JoinColumn (name = "ID_PESSOA_SACADO", nullable=false)
private Pessoa sacado; ... getters and setters...

when I get the object from the db, it comes without the "sacado", of course, because it's lazy. When I try to load it in the DAO like this:

boleto = (BoletoVO) sess.merge(boleto);
Hibernate.initialize(boleto.getSacado());

it doesn't bring the object "sacado", and when I click on it on the Debug mode, it gives me:

org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed

the id of the "sacado" property is allright in the db.

when I run this HQL:
select bol.sacado from BoletoVO bol join bol.taxa join bol.sacado where...
it returns the right object. What is happening? thanks!
Nice, thanks, guys!
From now on, I�ll only iterate inside a for loop.

Cya.
16 years ago
Hello. My question is:
is there any problem in reusing the iterator reference?
like this:

Iterator it = list1.iterator();
while (it.hasNext()){ .......}

it = list2.iterator();
while (it.hasnext()){ .......}

or is it better to do this way, declaring another variable?

Iterator it = list1.iterator();
while (it.hasNext()){ .......}

Iterator it2 = list2.iterator();
while (it2.hasnext()){ .......}

thanks!!!
16 years ago
Hello!
I�m uploading a file to the database, and it works ok. I click on it, select the file, and the path is on the text area. But when I get the record, the text area is blank. How can I put the name of the file there?

in the jsp:
<html:file property="${nameForm.map.name}[${lineNumber-1}].formFile" styleClass="text" size="35"/>

thanks!
17 years ago
Hello.
I�m using a CSS style (line1) in a radio button, to add borders to the line. But when I click on it, it looses it�s CSS, and becomes a normal radio button, without any CSS, centered left, and without center align. Anybody had this problem? The code of the JSP is as follows:

<td class="line1">
<html:radio property="idCity" value="${item.id}"/>
</td>

here is the CSS:
td.line1{
text-align: center;
border-top: 1px solid;
border-right: 1px solid;
border-color: #B0B0B0;
}

thanks!
You�re right. I�ll read the article.
Thanks alot for the answer!
And congratulations for the site, it�s the best one by far!
Hi there. I have an Attribute in the request, wich was set in may action like this:
request.setAttribute("imovelDefinido", "N");

Now I want to change it in my JSP when I click on a radio button, wich means the onclick event. I think the best (or the only) way is using javascript. How can I do it?

Thanks!
Rafael
Henry,
sorry about that, I knew that you had a policy,but I changed the name and didn�t remember that. I will change right away.

Owen,
thanks for the link. I don�t remember reading about this on the SCJP book,
but I think it must be there somewhere.

cya!
Hello there. I was looking around this site, and saw the following code from a previous thread:

class A{
static{
int x = 5;
}
static int x,y;
public static void main(String args){
doStuff();
System.out.println(y++ + x + ++x);
}
static void doStuff(){
x++;
++y;
}
}

But I didn�t understand this part:

static{
int x = 5;
}

what�s that? It isn�t a constructor, and not a method, and no inner class. So what can it be?

Thanks.
Hello,
I�m having a problem makin an HQL. I need to instantiate a Value Object getting the value from another. I have VO1 and VO2. VO1 has a var Long VO2, wich is its Id. So I make a constructor on VO1:
public VO1(Long id, String vo2Name){
setId(id);
setVo2Name(vo2Name);
}
I want to get the name from VO2 and Id from VO1. So I tried:
select new VO1(v1.id,v2.name) from VO1 as v1, VO2 as v2

but it didn�t work. How can I make it?

thanks!
You�re right, Marc, I didn�t see that!
Thanks for the quick answer.
17 years ago
Hello.
I got a simple question, that I thought would work, but it didn�t. I have 3 classes. Let�s say A, B and C. On class A I got the main. C extends B. I got a method on class B that I want to access in the main method at class A. Let�s see the example:

public class A {
public static void main(String[] args) {
B instance = new C();
// or C instance = new C();
instance.hello();
}
}

public class B {
String hello(){
return ("hello");
}
}

public class C extends B {}

I was really sure this would work, but didn�t. Since C extends B, once instantiated, it shoud access it�s methods, because it�s not private. But the code above gives no compilation error, neither shows any output. What�s wrong?

Thanks.
17 years ago