Wysmedia.com

Icon

~ We make IT easy for you ~

which one you prefer ?

I just having thought of current JavaFx that using syntax that looks like Groovy DSL. I think it is fun to have a syntax like that, instead of using XML. I hate XML you know ….

Which one you like ?

<html>
    <body>
        <table>
            <tr>
                <td> something here </td>
                <td> something here too </td>
                <td> something here as well</td>
            </tr>
             <tr>
                <td> another line here </td>
                <td> another line here too </td>
                <td> another line here as well</td>
            </tr>
        </table>
        <a href="http://wysmedia.comyr.com"> wysmedia</a>
    </body>
</html>

or

html{
    body{
        table{
            tr{
                td{"something here"}
                td{"something here too"}
                td{"something here as well"}
            }
            tr{
                td{"another line "}
                td{"another line too"}
                td{"another line as well"}
            }
        }
        p{
            h2{"a paragraph"}
            a{
                href:"http://wysmedia.comyr.com"
                title:"link to wysmedia"
                "wysmedia.com"
            }
        }
    }
}

which one you like the most ?

Checkbox of chaos

Yesterday I got a headache problem with a checkbox. I wrote like this on GSP

1
2
3
4
5
6
<g:form action="save">
... table ... 
<g:checkBox name="myCheckbox" value="" />
... other element ... 
<input type='submit' value='Save'/>
</g:form>

did you know what the happened ? myCheckbox always returned empty or null value everytime I saved the form. I thought Grails has bug at first, I did check and create a checkbox using scaffold and I found that value=”" makes the null value everytime I saved the form
The solution was simple enough:

1
2
3
4
5
6
<g:form action="save">
... table ... 
<g:checkBox name="myCheckbox"/>
... other element ... 
<input type='submit' value='Save'/>
</g:form>

Just eliminate value=”" and it all solved. I learned that using value=”somethingHere” can be useful if we want to save a value into our database. I hope my tricks can save you from headache. Be aware of checkbox .. hahaha…