Karol Litwinczuk

Greenhorn
+ Follow
since Jun 11, 2010
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 Karol Litwinczuk

Got some good sources on Groovy's metaprogramming?
12 years ago
Yes, that's me, one more time today. My app need to make the PDFs from datbase data it's collect, so I started to look for PDF rendering plugin and easily come to this one. Problem is that in now version it's SNAPSHOT of 0.5, with no plugins files unpacking in project directory. Tried to make some GSP's to render documnet, but nothing works ( obviosuly, as plugin isn't really installed ). So I gone to look for alternative solutions and come to plugins that rendes XML and GSPs - problem is that I need highly complex PDF files mangment, like special fonts, spaces between the fields etc. And those other plugins don't have this kind of useablity. There is always the iText library, but as the first plugin is nice and easy implementation for Grails of it, I would rather go with that.

I tried to get the version 0.4.5 but it's also don't want to intall with mine Grails 1.3.3 application. Any ideas what to do?

Here is error massage from version 0.4.5 instaltion:

12 years ago
I now it's total newbie question but cant't find answer on quick search in documnataion or in Google - where should I put mine own, general functions that i reuse in app? I write special a function to change empty strings in to strings of '-' and want to use them many, many, MANY times in app, so the "copy-paste" method for each Controller is illogical. Should all functions goes to Scripts catalog or in to other place?
12 years ago
Detailed description of problem
what you did - Code is in post before
what you expected to happen - Trying to make the DropDown list for Powiats only limited to those in belonging to chosen Wojewodztwo
why you expected it to happen - It's plain and simple offical tutorial and should work as such.
why you need it to happen - To make app easier to use and nicer looking and "slick" in use.
what actually happened instead and why what happened is a problem to you:
The one picture is more worth than 1000 words..

Before:
http://img153.imageshack.us/img153/628/screenshot027c.jpg
http://img15.imageshack.us/img15/217/screenshot028d.jpg
http://img291.imageshack.us/img291/2067/screenshot029jm.jpg
http://img833.imageshack.us/img833/9201/screenshot030.jpg
http://img833.imageshack.us/img833/1273/screenshot031w.jpg

After:
http://img199.imageshack.us/img199/299/screenshot032py.jpg

Error message - Non, just not working.
Version numbers of relevant libraries, JDK, tools, operating system etc. - JDK - 1.6.0._17 , Netbeans 6.9, Windows 7 64-bit, Browser = Google Chrome
Code snippets - upper and below
Stack trace - don't know who to show on Netbeans
What else you tried/what worked/what didn't work - other tutorial and didn't work.
12 years ago

Gregg Bolinger wrote:We can't help you if you don't show us what you have done. Where is your non-scaffolding code you've written to handle the selection change events and send the ajax request and process the response?



They were made all on the examples, only changing the names for my app. But here is how I remade them:

Grails main tutorial:



Of course, it doesn't work. Now even list of all Powiats don't show...

I must also add that I updated to latest, Grails 1.3.3 version. Maybe there is some bug with AJAX on it?

I go to remake the others examples.


12 years ago
I work on application in witch extensivly use State ( "Województwo" , Domain class is Wojewodztwo ), County ("Powiat", Domain class of the same name ) and Gmina ( whitch is the representation of city or village, Domain class is Gmina ) objects. The relationship diagram is like this:

Wojewodztwo -> Powiat -> Gmina

All the relationships are "hasMany" and "belongsTo", respectivly, so Wojewodztwo hasMany "Powiats" and "Gminas" ( Powiatów i Gmin ), Powiat belongsTo Wojewodztwo and hasMany Gminas and Gmina belongsTo one Wojewodztwo and one Powiat. What I have problem with is working chain selction on creating new Gmina, so when I choose Wojewodztwo selection list of Powiats to whitch the Gmina should be, would be shorted only to the Powiats of this Wojewodztwo, not all of them from database. I tired about two ways of doing that - this and this, will be testing this one - and none is working for me. Could someone help me? Spend half a day on something that should be rather tirval is very demotivating...

Started with this scaffolded selction fields



Second, smaller question - I thinking about using UI plugin and don't know what to choose - GrailsUI, RichUI or maybe Dojo one? Was thinking about using even GWT, but for now, need only some little components like Date Picker in form of calendar etc. Likes the design of components of GrailsUI or Dojo one, but list of elements of RichUI is also tempting.
12 years ago
Unfortunetly, this doesn't work. Any other ideas? Th a main porblme is that Revies controller can't find the Perrsons obcjet, even where Persons Class are in the same packages.
12 years ago

Kuba Zygmunt wrote:Hi

if you use grails version 1.3.1 or newer then your domain classes will be in package named by your application. It is always better to use packages



I use the packages. The problem is that I don't kno how to import class of Person that is otuside of app package into Review that is inside the package.
12 years ago

Kuba Zygmunt wrote:check packages and if controller and domain class are in different packages use import.



The tree is like this:

/main-app-folder/...
/gameaddic/ Reviews
Person
...


That means that Controller of Review IS in package ( gameaddict ), but Person is in main folder of app ( in this case, in Controllers ) - how to make import to controller in package from main folders of app. Shouldn't they be ready to use in whole app, as they are in main controllers?
12 years ago
I got idea just to remade Save function in Review ( Recenzja in polish ), but it doesn't work. Here is my code:


And here is error:

Error 500: Executing action [save] of controller [gameaddict.RecenzjaController] caused exception: No such property: Person for class: gameaddict.RecenzjaController Possible solutions: session
Servlet: grails
URI: /GameAddict/grails/recenzja/save.dispatch
Exception Message: No such property: Person for class: gameaddict.RecenzjaController Possible solutions: session
Caused by: No such property: Person for class: gameaddict.RecenzjaController Possible solutions: session
Class: RecenzjaController
At Line: [24]


Any ideas on that?
12 years ago

Kuba Zygmunt wrote:


How could this be? WIth usage of loggedInUserInfo(field:'username')? Or maybe some SQL query? I never get taking session params...
12 years ago

Kuba Zygmunt wrote:
What about using hidden field for person id and then in submit action load the proper user object which you can use later in your review.



I never mixed something like that in Grails - could you propose how this code should look like or at least give some function names to read more in manual?

Kuba Zygmunt wrote:
If you want to send the object through the form you will have to serialize and deserialize after.However this approach is not so secure, because user can modify the object before submission.



Well, it's only the learning app, so can be much more easier but can't you serialize data and then secure them by, I don't know, md5 for example?
12 years ago
Hello!

I wirte my first, simple app emulating the gaming review portal. What I have problem with is that I have Reviews domain class that belongs to Person class ( as author of review ) genrated from Acegi Plugin ( both clases listed below ). When I want to create new Review, the app says many things, bnut mainly this error massage:


I want the app to take and use Acegi loggedInUserInfo(field:'username') variable, to give reviews proper author users, of course, as hiddenField. Could someone help me?



And here is the part of Review/Create view tha is resposible for taking the Author but is not working:

12 years ago