Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Kekekela
Oct 28, 2004

Lumpy posted:

It's no VIM, but it's not bad for a non-VIM thing. :v:

I have to google an escape route every time some git command unexpectedly traps me in that thing. :smith:

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Kekekela posted:

I have to google an escape route every time some git command unexpectedly traps me in that thing. :smith:

Just write "In Case Of Emergency: ESC : ! q " on your monitor.

lunar detritus
May 6, 2009


VSCode is great, I have no idea how they managed to take Electron and actually make it feel responsive and good. It even boots up faster than Atom.

porksmash
Sep 30, 2008

Kekekela posted:

I have to google an escape route every time some git command unexpectedly traps me in that thing. :smith:

git config --global core.editor <your editor> is your friend

Kekekela
Oct 28, 2004

Lumpy posted:

Just write "In Case Of Emergency: ESC : ! q " on your monitor.
Haha perfect!

porksmash posted:

git config --global core.editor <your editor> is your friend
Oh wow...

The Fool
Oct 16, 2003


I'm using atom with the git-plus plugin, and couldn't be happier.

Ctrl-Shift-H $gitCommand

luchadornado
Oct 7, 2004

A boombox is not a toy!

Plavski posted:

There's a minor war going on in my department. The cool, smart and driven JavaScript developer - me - is trying to instruct the old, C# wielding dinosaurs that Visual Studio isn't the panacea they think it is. Writing TypeScript in VS is pretty grim when you try and do anything out of the ordinary. VSCode just eats that stuff up. The team actively tries to build their code around the limitations rather than embrace the new. Oh for a job where I was swimming with the current instead of against it!

VS is really good though. But if you're just doing JS development, there's no sense in using VS over VS Code. Most full stack developers that I know use both.

Honest Thief
Jan 11, 2009
Maybe this isn't the right thread, but what's the job market like in Amsterdam these days? I'm having this urge to skip on work here in Lisbon, at the cost of losing out on a possible incoming tech bubble, for some different city, just because.

Plavski
Feb 1, 2006

I could be a revolutionary

Helicity posted:

VS is really good though. But if you're just doing JS development, there's no sense in using VS over VS Code. Most full stack developers that I know use both.

For sure, it just can't keep up with modern JavaScript. My development team would rather ignore advanced language functionality for the sake of staying with Visual Studio as we mix both C# and TS in our application. Our tech lead hates change - not a particularly awful thing for an architect - but he'd rather not use useful functionality of TypeScript 2+ (we're still on 1.8, and even that came after a massive drive by me to go up from 1.4) and VSCode for the sake of the simple life on Visual Studio. It kinda limits what we can do and we end up having to build around the functionality instead of using it.

As an example, because Visual Studio doesn't have decent native support for NPM, we can't use it; it's NuGet or nuthing. All our TypeScript config is handled at the .csproj level and not in a tsconfig, which means you're arbitrarily limited to what you can do with TS - if it's not in the interface, VS won't accept it. Our TypeScript is also being left in static files with no decent loader and nothing but the barest of import/export usage. Cross file dependency is non-existent in our codebase because VS isn't robust enough to handle it, at least not 2013. I'd feel better if we at least pushed up to 2015, but I've used 2015 extensively in a parallel project and it still isn't as tight or as useful as VSCode for TypeScript work.

There's a "if it ain't broke, don't fix it" approach in our team that works for C#, but with an evolving language like TypeScript/ES6+, you end up constrained by a monolithic tool like Visual Studio. You can adapt and advance easier and better with VSCode.

Thems my thoughts from working with this for a couple years anyway.

Kekekela
Oct 28, 2004

Helicity posted:

Most full stack developers that I know use both.
That's my situation. WebAPI project in C# using VS, then the javascript client using Sublime/Powershell (soon-to-be VSCode).


VVV

quote:

https://conemu.github.io/
Oh nice, will definitely check this out.

Kekekela fucked around with this message at 20:07 on Jan 13, 2017

Honest Thief
Jan 11, 2009

Kekekela posted:

That's my situation. WebAPI project in C# using VS, then the javascript client using Sublime/Powershell (soon-to-be VSCode).

On windows I always use https://conemu.github.io/ instead of powershell, which you can also configure in on conEmu but whateves

Honest Thief fucked around with this message at 15:29 on Jan 13, 2017

Le0
Mar 18, 2009

Rotten investigator!
I don't know if this is the correct place or if I need to be in the other web dev thread but anyways here goes.
So I'm a super beginner at modern web application (last time I coded for web I did HTML in a notepad with a tiny bit of javascript), I have a class on java and our teacher tasked us with developing a simple modern web app.
For this he said we can basically use anything we want but he provided a very simple basis for using Java with Spring MVC, Maven and Bootstrap.

As I said I don't know most of this stuff, I mainly do embedded computing with C/C++ and I'm not used being so high level with thousands of frameworks in every direction I look.
Anyway, he provided a simple hello web app which basically prints whatever you put in the URI, so it's very simple.
He asked us to make a simple todo list web application, where you can create up to 4 todo list, then add/remove tasks from them.

Now I've been reading a lot of stuff on internet and I've been wrestling with making the interaction between the controller and the view working.
I started simple by just having a form with a single text area and submit button, in my controller I implemented the methods to handle post and get requests. The get seem to work (i.e. my form display and I can enter stuff however when I click submit I get an error saying the client answer was not properly formatted or something.)

Now I don't really want you guys to hold my hand through this but what would be a good source of documentation to understand this? Because honestly there is such an astonishing amount of crap on the web that I spent several hours trying to rummage through blog posts.

Also something I'm not sure I understand is how to structure my stuff, like can I use a single mapping to do this? Could the GET allow me to display the form to add a new list and modify the already existing ones while also displaying the created list with their content.

I'm sorry if this is a lot of words to basically say I suck at this but maybe someone could point me in the correct direction?
Thanks guys.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

WebStorm is pretty great too. It's got its pluses and minuses vs VS Code, but check it out if you're looking around for a new IDE.

Anyway, what I really came in here to post was this thing that I can't decide if it's great or horrible. I want to say great, if only because I couldn't tell if it was a joke for a little while, but maybe it's horrible?

https://github.com/sylvainpolletvillard/postcss-grid-kiss

quote:

This is a PostCSS plugin aiming to replace the 24 new properties brought by CSS Grids with a single one that you immediately understand when you see it.

This is how you design a grid with it:

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Thermopyle posted:

Anyway, what I really came in here to post was this thing that I can't decide if it's great or horrible. I want to say great, if only because I couldn't tell if it was a joke for a little while, but maybe it's horrible?

https://github.com/sylvainpolletvillard/postcss-grid-kiss


This is how you design a grid with it:



I'm going with horrible. :cry:

Forgall
Oct 16, 2012

by Azathoth

Thermopyle posted:

WebStorm is pretty great too. It's got its pluses and minuses vs VS Code, but check it out if you're looking around for a new IDE.

Anyway, what I really came in here to post was this thing that I can't decide if it's great or horrible. I want to say great, if only because I couldn't tell if it was a joke for a little while, but maybe it's horrible?

https://github.com/sylvainpolletvillard/postcss-grid-kiss


This is how you design a grid with it:


That's not Guy Fieri.

ModeSix
Mar 14, 2009

Thermopyle posted:

WebStorm is pretty great too. It's got its pluses and minuses vs VS Code, but check it out if you're looking around for a new IDE.

Anyway, what I really came in here to post was this thing that I can't decide if it's great or horrible. I want to say great, if only because I couldn't tell if it was a joke for a little while, but maybe it's horrible?

https://github.com/sylvainpolletvillard/postcss-grid-kiss


This is how you design a grid with it:



I looked over it and that's actually pretty interesting. I wonder how functional it actually is in practice, I mean drawing little ascii boxes is strange, but it could work.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Le0 posted:

<snip>

Ideally you'd follow the recommendations here with regard to which verbs you use for which operations, so you'd have a controller method mapped to each of them. I've never used Spring before but this looks pretty straightforward and a lot like other MVC-ish web frameworks (I've never actually used Spring itself).

To use a different verb from a simple web form, you just set the method attribute on the form element like <form id="just" method="POST"> and the framework will route that form data to the appropriate handler on the controller. You can do this with plain HTML if you just have a whole bunch of purpose-built forms that just do one thing like adding an item to the list or deleting a line: you can have as many as you want on a page and that's just fine!

HTML code:
<form method="POST" class="add-line">
  <input type="text" name="todoText" placeholder="JUST POST">
  <input type="submit" value="+">
</form>

<div class="todo-item">
  $ITEM_TEXT_HERE
  <form method="DELETE" class="delete-button">
    <!-- HTML has burdened the input element with a lot of complexity -->
    <input type="hidden" name="itemId" value="$ITEM_ID_HERE">
    <input type="submit" value="X">
  </form>
</div>
More about input elements at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input

Munkeymon fucked around with this message at 17:26 on Jan 13, 2017

Odette
Mar 19, 2011

ModeSix posted:

I looked over it and that's actually pretty interesting. I wonder how functional it actually is in practice, I mean drawing little ascii boxes is strange, but it could work.

I'd rather draw ascii dicks. Whoever thought of that was probably looking at old BBSes from the 80s.

Kekekela
Oct 28, 2004
Had my first "node on windows" issue in quite a while today. Trying to set NODE_ENV in an npm script but webpack wasn't picking it up. Found a bunch of different suggestions but nothing was working. Finally this little package saved the day: cross-env

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I read this post about React "Aha!" moments this morning and I thought I'd share it since I remember when I figured these things out it really helped me understand how to write React.

The moments he highlights (see the post for explanations):

  • fn(d) = V. Your UI is a function of your state and props are to components what arguments are to functions.
  • In React, your entire application’s UI is built using function composition and JSX is an abstraction over those functions.
  • Components don’t necessary have to correspond to DOM nodes.
  • When two components need to share state, I need to lift that state up instead of trying to keep their states in sync.
  • Inheritance is unnecessary in React, and both containment and specialization can be achieved with composition.
  • The separation of container and presentational components.
  • If you try to keep most of your component pure, stateless things become a lot simpler to maintain.

9-Volt Assault
Jan 27, 2007

Beter twee tetten in de hand dan tien op de vlucht.

Honest Thief posted:

Maybe this isn't the right thread, but what's the job market like in Amsterdam these days? I'm having this urge to skip on work here in Lisbon, at the cost of losing out on a possible incoming tech bubble, for some different city, just because.

Plenty of jobs, but the housing market is completely hosed up, and most jobs don't pay enough to afford the rent of a house. Expect salaries after tax somewhere between 2000 and 3500 euros (and at the top end you are pretty much a senior software architect or managing a department or so), and rent easily being €1200 a month for a small apartment of say 40m2 if you want to live anywhere near the center. Also, you are expected to earn 3-5 times the rent before taxes, so expect to need a salary of at least €4000 before taxes, which is possible but not easy, depending on your experience level. Roommates to split rent with won't help because most corporations that rent places expect each person to be able to afford the rent on their own unless you are married or so.

But you should probably expect to not be able to find a place in Amsterdam, but in one of the cities surrounding it. Housing prices in Amsterdam have gone up 20% last year and people are now buying houses without even seeing the place. It's that insane.

Honest Thief
Jan 11, 2009

9-Volt Assault posted:

Plenty of jobs, but the housing market is completely hosed up, and most jobs don't pay enough to afford the rent of a house. Expect salaries after tax somewhere between 2000 and 3500 euros (and at the top end you are pretty much a senior software architect or managing a department or so), and rent easily being €1200 a month for a small apartment of say 40m2 if you want to live anywhere near the center. Also, you are expected to earn 3-5 times the rent before taxes, so expect to need a salary of at least €4000 before taxes, which is possible but not easy, depending on your experience level. Roommates to split rent with won't help because most corporations that rent places expect each person to be able to afford the rent on their own unless you are married or so.

But you should probably expect to not be able to find a place in Amsterdam, but in one of the cities surrounding it. Housing prices in Amsterdam have gone up 20% last year and people are now buying houses without even seeing the place. It's that insane.
that's the same deal as Lisbon then, although at much lower salaries, bleeeh.

Pollyanna
Mar 5, 2005

Milk's on them.


What's the best way to handle date input? The designers don't like how HTML5 date elements look different across browsers/platforms, and React automatically updates when manually typing in a date such that trying to use minimum and maximum years causes the app to poo poo itself since typing in "1990" makes it think you're inputting year 1, then 9, then 9, then 0, which is frustrating as poo poo.

We're of half a mind to tell design to go gently caress itself and favor native datepickers, but I'm still running into the weird React min/max problem.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Pollyanna posted:

What's the best way to handle date input? The designers don't like how HTML5 date elements look different across browsers/platforms, and React automatically updates when manually typing in a date such that trying to use minimum and maximum years causes the app to poo poo itself since typing in "1990" makes it think you're inputting year 1, then 9, then 9, then 0, which is frustrating as poo poo.

We're of half a mind to tell design to go gently caress itself and favor native datepickers, but I'm still running into the weird React min/max problem.

Surely, React has some way to debounce your input such that you aren't evaluating on every keypress.

Pollyanna
Mar 5, 2005

Milk's on them.


Skandranon posted:

Surely, React has some way to debounce your input such that you aren't evaluating on every keypress.

Yeah, I think I had just hosed up something somewhere - it works fine now. Design's still gonna complain about it, though. :gonk:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Pollyanna posted:

What's the best way to handle date input? The designers don't like how HTML5 date elements look different across browsers/platforms, and React automatically updates when manually typing in a date such that trying to use minimum and maximum years causes the app to poo poo itself since typing in "1990" makes it think you're inputting year 1, then 9, then 9, then 0, which is frustrating as poo poo.

We're of half a mind to tell design to go gently caress itself and favor native datepickers, but I'm still running into the weird React min/max problem.

React only "automatically updates" on input if the input element is a controlled component. If you want to do stuff with the input you have to inject your stuff somewhere in the component lifecycle.

Kekekela
Oct 28, 2004

Skandranon posted:

Surely, React has some way to debounce your input such that you aren't evaluating on every keypress.

React doesn't really address it. I use this guy: component/debounce

Pollyanna
Mar 5, 2005

Milk's on them.


Yeah, I'm definitely wrong on how React works in this case. I think I was barking up the wrong tree for that.

I've still got a problem, though. We want to support users on older browsers like IE and Edge and Firefox (we do retirement and life insurance stuff) which means we can't really rely on the date HTML element. However, design wants to implement a natural-language form that depends on the user typing in their information, as you can see here. So, I'm thinking that if we want to implement this, we can't rely on the datepicker element in Chrome/HTML5 and would have to implement something custom ourselves, thereby basically copying what they have. I'm wondering if it's worth pushing back on this, or if I should ditch the HTML5 approach and just go with their preference. Obviously, I can't decide this on my own, so I'll be floating this by the rest of the team, but I wanted to get some opinions on how something like this is best implemented.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



The laziest way I can think of is making the month, day and year individual inputs and style them so they look like one with built-in slashes.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
Anyone know why my SASS colors are compiling to different values now?
It usued to be what shows on http://www.sassmeister.com/ but now colors using mix() are slightly different.
I notice the website shows 3.4.21, the most recent version is 3.4.22 but somehow I have 3.4.23??

Ochowie
Nov 9, 2007

Couldn't you validate the date after the control loses focus using the onBlur event?

M31
Jun 12, 2012

Pollyanna posted:

Yeah, I'm definitely wrong on how React works in this case. I think I was barking up the wrong tree for that.

I've still got a problem, though. We want to support users on older browsers like IE and Edge and Firefox (we do retirement and life insurance stuff) which means we can't really rely on the date HTML element. However, design wants to implement a natural-language form that depends on the user typing in their information, as you can see here. So, I'm thinking that if we want to implement this, we can't rely on the datepicker element in Chrome/HTML5 and would have to implement something custom ourselves, thereby basically copying what they have. I'm wondering if it's worth pushing back on this, or if I should ditch the HTML5 approach and just go with their preference. Obviously, I can't decide this on my own, so I'll be floating this by the rest of the team, but I wanted to get some opinions on how something like this is best implemented.

Use one of the many available date picker components? https://react.rocks/tag/DatePicker
Or a masked input component? https://github.com/insin/react-maskedinput https://github.com/sanniassin/react-input-mask

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I'm using the Angular smart-table module right now to display tabular data. It's good for getting started, but I was hoping to have something that will let me mess with the columns. I'm only showing a subset of my columns, and I'd like to give the user local capability to mess with them. Specifically:

1. Add a new columns from prescribed types associated with my model.
2. Remove existing columns.
3. Drag around to rearrange columns.

On top of that, I was hoping to retain the global search that the smart-table module already has. I'm assuming I will have to just implement this myself some day--perhaps based on some snippets online, but still by myself. I'm not in any hurry to do that.

Is there an alternate Angular table implementation I should consider to get all this in one go by default? I saw a few with various degrees of column manipulation, but then the search was a text box per column.

I guess in the long term I also have to deal with pagination. It looks like smart-table has me covered there, and anything I use instead would have to support that as well.

Chenghiz
Feb 14, 2007

WHITE WHALE
HOLY GRAIL

Kekekela posted:

Had my first "node on windows" issue in quite a while today. Trying to set NODE_ENV in an npm script but webpack wasn't picking it up. Found a bunch of different suggestions but nothing was working. Finally this little package saved the day: cross-env

cross-env is great, and goes well with https://www.npmjs.com/package/npm-run-all if you have scripts that need to do things in parallel across OSes.

Le0
Mar 18, 2009

Rotten investigator!
So I managed to advance my list and make it work, thanks!
However I have a weird problem I'd like to ask you about.

I have a TodoList class which extends the arraylist like so:
code:
public class TodoList extends ArrayList<TodoItem> {
    private String listName;

    public String getListName() {
        return listName;
    }

    public void setListName(String listName) {
        this.listName = listName;
    }

    public TodoList(String listName) {
        this.listName = listName;
    }

    public void newTask(String name) {
        TodoItem newItem = new TodoItem();
        newItem.setTaskName(name);
        this.add(newItem);
    }
}
My controller has all the instances of the todolist in an ArrayList<TodoList>. I mapped the Get method to add this list to the model and then using two c:forEach I display the content of all the lists.
This works properly. Now I also added that listName attribute and I'd like to simple display this name before the tasks.

To do this, I simply modified my jsp code to print the list.listName attribute before all the asks like so:

code:
            <c:forEach items="${todolists}" var="list" varStatus="i">
                <div class="col-md-6">
                <table class="table">
                    ${list}
                    <p>${list.listName}</p>
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>Task Name</th>
                        <th>State</th>
                        <th>Operation</th>
                    </tr>
                    </thead>
                <c:forEach items="${list}" var="item">
                    <tr>
                        ${item}
                        <th></th>
                        <th>${item.taskName}</th>
                        <th></th>
                        <th></th>
                    </tr>
                </c:forEach>
                </table>
                    <p><div class="container">
                    <form:form method="post" modelAttribute="newtaskname">
                        <div class="form-group">
                            <form:hidden path="listIndex" value="${listcount}"></form:hidden>
                            <form:input path="taskName" placeholder="New Task Name" />
                            <form:button method="POST" type="submit" class="btn btn-primary">+</form:button>
                        </div>
                    </form:form>
                </div></p>
                </div>
                <c:set var="listcount" value="${listcount + 1}" scope="page"/>
            </c:forEach>
However I get an error on this code saying:
code:
java.lang.NumberFormatException: For input string: "listName"
	java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	java.lang.Integer.parseInt(Integer.java:580)
	java.lang.Integer.parseInt(Integer.java:615)
	javax.el.ListELResolver.coerce(ListELResolver.java:150)
	javax.el.ListELResolver.getValue(ListELResolver.java:67)
I don't understand why the hell it's trying to parse the listName as an int?? And also why my listName attribute seems to be missing. When I print ${list}
I get: [ch.heigvd.poo.todolist.TodoItem@1e39ce1d, ch.heigvd.poo.todolist.TodoItem@72e3b472, ch.heigvd.poo.todolist.TodoItem@45fa30f9]
Which looks like a TodoItem list but my listName attribute should be in there also?? I'm kinda lost here.

HaB
Jan 5, 2001

What are the odds?

Rocko Bonaparte posted:

I'm using the Angular smart-table module right now to display tabular data. It's good for getting started, but I was hoping to have something that will let me mess with the columns. I'm only showing a subset of my columns, and I'd like to give the user local capability to mess with them. Specifically:

1. Add a new columns from prescribed types associated with my model.
2. Remove existing columns.
3. Drag around to rearrange columns.

On top of that, I was hoping to retain the global search that the smart-table module already has. I'm assuming I will have to just implement this myself some day--perhaps based on some snippets online, but still by myself. I'm not in any hurry to do that.

Is there an alternate Angular table implementation I should consider to get all this in one go by default? I saw a few with various degrees of column manipulation, but then the search was a text box per column.

I guess in the long term I also have to deal with pagination. It looks like smart-table has me covered there, and anything I use instead would have to support that as well.

ui-grid will do all of that. It's nice and easy to implement, since I just did it.

http://ui-grid.info is the website. If you hit the tutorial section, I am pretty sure it will show you each of the behaviors you described. That being said - the rest of the docs aren't super great - so be prepared to do some digging.

Kekekela
Oct 28, 2004
Some pretty interesting "state of the javascript" survey results here: https://risingstars2016.js.org/

I'm surprised Vue is so popular. I've messed around with it a little a couple times over the past year just because of the hype, but I find I vastly prefer React's approach. Any of you goons using it?

Dogcow
Jun 21, 2005

Le0 posted:

I don't understand why the hell it's trying to parse the listName as an int?? And also why my listName attribute seems to be missing. When I print ${list}
I get: [ch.heigvd.poo.todolist.TodoItem@1e39ce1d, ch.heigvd.poo.todolist.TodoItem@72e3b472, ch.heigvd.poo.todolist.TodoItem@45fa30f9]
Which looks like a TodoItem list but my listName attribute should be in there also?? I'm kinda lost here.

Can you post the .jsp with the form that has the listName input? The listName is likely not making it into the DB and Java is trying to coerce null/undefined into a number for some reason.

Plavski
Feb 1, 2006

I could be a revolutionary

Kekekela posted:

Some pretty interesting "state of the javascript" survey results here: https://risingstars2016.js.org/

I'm surprised Vue is so popular. I've messed around with it a little a couple times over the past year just because of the hype, but I find I vastly prefer React's approach. Any of you goons using it?

I'm always sceptical of those surveys. Here's one from late last year where Vue barely registers at all: http://stateofjs.com/2016/frontend/

Adbot
ADBOT LOVES YOU

Le0
Mar 18, 2009

Rotten investigator!

Dogcow posted:

Can you post the .jsp with the form that has the listName input? The listName is likely not making it into the DB and Java is trying to coerce null/undefined into a number for some reason.

Of course, thanks for taking a look at it. I managed to make it work in the ugliest way possible, making another array list with just the names of the lists, hopefully you can help me find the proper way to do this.
In the first div is the form, then the second div is the display of all the lists and tasks.

code:
<div class="container">
    <c:url var="createNewList" value="/todo/createnewlist"/>
    <form:form method="post" modelAttribute="newlistname" action="${createNewList}">
        <div class="form-group">
            <form:input path="newlistName" placeholder="New Todo List Name" />
            <form:button method="POST" type="submit" class="btn btn-primary">+</form:button>
        </div>
    </form:form>
</div>
<div class="container">
    <c:set var="listcount" value="0" scope="page" />
    <c:if test="${not empty todolists}">
        <div class="row">
            <c:forEach items="${todolists}" var="list" varStatus="i">
                <div class="col-md-6">
                <table class="table">
                    <p><h3>${todolistnames[listcount]}</h3></p>
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>Task Name</th>
                        <th>Operation</th>
                    </tr>
                    </thead>
                        <c:set var="taskcount" value="0" scope="page" />
                <c:forEach items="${list}" var="item">
                    <tr>
                        <th>${taskcount}</th>
                        <th>${item.taskName}</th>
                        <th>
                            <c:url var="createNewList" value="/todo/deletetask"/>
                            <form:form method="post" modelAttribute="deltaskinfo" action="${createNewList}">
                                <div class="form-group">
                                    <form:hidden path="listIndex" value="${listcount}"></form:hidden>
                                    <form:hidden path="taskIndex" value="${taskcount}"></form:hidden>
                                    <form:button method="POST" type="submit" class="btn-xs btn-danger">-</form:button>
                                </div>
                            </form:form>
                        </th>
                    </tr>
                    <c:set var="taskcount" value="${taskcount + 1}" scope="page"/>
                </c:forEach>
                </table>
                    <p><div class="container">
                    <form:form method="post" modelAttribute="newtaskname">
                        <div class="form-group">
                            <form:hidden path="listIndex" value="${listcount}"></form:hidden>
                            <form:input path="taskName" placeholder="New Task Name" />
                            <form:button method="POST" type="submit" class="btn btn-primary">+</form:button>
                        </div>
                    </form:form>
                </div></p>
                </div>
                <c:set var="listcount" value="${listcount + 1}" scope="page"/>
            </c:forEach>
        </div>

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply