SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
1. Customized errors for empty fields (Like "Please select atleast one state" or "Please enter the name"). It always throws "Validation Error: Value is required". Yes, you can change the message by specifying a message bundle, but the same message will appear for checkboxes, radios and text fields etc. Have fun trying to come up with a inert message for all :-)
2. JSF components invoke the getter methods more than once and if the order in which your database returns a list changes, well buddy.. u're screwed (because it does not match rows by key, but assumes you return the same list every time it calls the getter)
3. Most solutions to the problem you are facing would be to make the bean a "session" scope. Thats just plain dumb as you're dead if you have more than browser window trying to manipulate state.
5. How do you have line breaks for your check box component descriptions?? - h:selectManyCheckbox ? You can't. Yes.. you cant unless you put it inside a datatable. Now, the validations are screwed as it will invoke the validator many times.
6. Its very confusing for the users as every page submits to itself (heard its this way in .NET also). Example: You will see URLs in the browser like DeleteMail.jsp that lists all the mail ;-)
7. All of your beans have to have application level unique names, as there is no way to divide your application into sub-modules like struts.
9. Using JSTL in JSF produces un-specified results. It works sometimes and does not work others. Try it out if you want.
10. And, WSAD generates IBM specific code if you try to use it's drag and drop JSF build features.
Now that list is just from the top of my head. JSF has the capacity to be a cool framework (Say in JSF 3.0 or something),
- Varun
SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
You can play around, without loads of code. Use component's "id" property to fetch label if you want. Now your messages will contain field's name OR if you want conponent specific different message, pick the message from properties file mapped with formName:ComponentId combination. That wont be a "loads of code".
Can you explain ? Which key you talking about ? (Regarding getters methods...)
Customization in rendered doesnt worked? ... wont be loads of code probably. You might need to play with few TDs & TRs.
Why you want to give two beans a same name?
Don't use properitery components, if possible. Also get rid of that "generateCode" tag at the top of each page. That will make your life simpler and wont create hx: tag un-necessarily. But don't blame JSF for this. It's WSAD's fault
SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
Originally posted by Dushy Inguva:
Abioye,
It sounds and looks like a really productive framework. But, thinking in a long term, I do not know if there will be as many Tapestry aware developers (say 2-3 years from now... if we need to add some functionality to an existing product of ours). I might be wrong though!!! So, convincing my company might be a big challenge :roll:
quote:
--------------------------------------------------------------------------------
You can play around, without loads of code. Use component's "id" property to fetch label if you want. Now your messages will contain field's name OR if you want conponent specific different message, pick the message from properties file mapped with formName:ComponentId combination. That wont be a "loads of code".
--------------------------------------------------------------------------------
I am not sure how you can achieve the following with a required="true" attribute (I am not talking about validator="" because, a validator is NOT invoked if the component is empty)
1. UserName text field: Please enter your user name
2. Password confirmation text field: Password has to be entered twice.
quote:
--------------------------------------------------------------------------------
Can you explain ? Which key you talking about ? (Regarding getters methods...)
--------------------------------------------------------------------------------
Well, this is a LONG story. The JSF spec does not specify how many times the components on the screen can call getter methods on the beans. (ill be surprised if i read this part of the spec wrong).
Suppose you have a <h ataTable value="#{myBean.someList}" ... >
Now, assume your database list keeps changing (contents might be added or deleted to the list but the individual items themselves remain the same.. and assume the list you get from the database does not follow any order. The only thing you have to associate is a unique key)
1. Browser requests for the page.
2. our getSomeList() method is invoked.
3. JSF displays the page (we're all happy and greatful )
4. assume our row contents are editable. (User changes the content of the 5th row.. lets call this row Bob)
5. User presses Submit.
6. JSF invokes getSomeList() (in the second phase)
7. We query database. Bob is present. But he is not the 5th row anymore. He is the 6th row)
8. JSF invokes the setter on the 5th row, which is NOT Bob
9. were screwed
The components in JSF do not have a link to the model. And, unlike in Swing (which i Love) there is no comprehensive model lifecycle management (I am referring to all those cute rowsAdded() rowsRemoved() events in Swing - i am not comparing JSF to swing!!!)
And, it is unfortunate that the default JSF components choose to associate the model items with index and NOT with a primary key (EJB does not work this way.. there is a primary key in Entity Beans - anyway, entity beans are outside the scope of this topic)
Ok long story short.. this is the reason why My Faces has components which remember the model and do not invoke the getters atleast in the second phase of the lifecycle.
quote:
--------------------------------------------------------------------------------
Customization in rendered doesnt worked? ... wont be loads of code probably. You might need to play with few TDs & TRs.
--------------------------------------------------------------------------------
Thats what I am saying. For something as simple as i was referring to, I have to write a custom component.
Anyways, I was also trying to point out the lack of sub-modules like in Struts.
quote:
--------------------------------------------------------------------------------
Don't use properitery components, if possible. Also get rid of that "generateCode" tag at the top of each page. That will make your life simpler and wont create hx: tag un-necessarily. But don't blame JSF for this. It's WSAD's fault
--------------------------------------------------------------------------------
Totally right. But, JSF was supposed to be tooled. And, all these tool vendors try to tie you down. Its unfortunate.
- Varun
SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
Originally posted by Dushy Inguva:
Varun,
My point was really not to ask for solutions ...
- Varun
And this you are telling me now after I've done so much of typing and messed my head around formatting the replies
SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
Originally posted by Dushy Inguva:
Like say, no decent integration with tiles (or any other tiling framework support) etc !!!
why should Sun have to create a technology that integrates well with some other open source technoclogy?
No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Originally posted by William Duncan:
Too true, they shouldn't. I think that the point should be focused on integrating tiles like functionality into JSF though. When making a comparison, the lack of customizable templetes via mappings is a shortcoming of JSF. JSF needs to give developers the ability to focus on the content of the page. Writing the look and feel of the application should only need to be done once. This means less JSP/html code to write and also makes pages/applications easier to maintain.
Don't give me yet another XML file to maintain.
No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Originally posted by K Varun:
Lets hope it will go better only.![]()
Originally posted by Rigel Kentaurus:
Could you elaborate in how to do the customized error messages for fields. Right now I am using a <h:message for="componentId" /> for printing the error message, but I can't find some way to print a non-default jfc message for each textfield
- Varun
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!