PHOTOS: Alaska Crushes Ginebra

Alaska survived a late-game rally by Ginebra to win 104-90, leading the series at 2-0 and now one win away from the title.

read more

Top Celebrity Loveteams!

Check out which loveteams dropped and which ones came out on top this week!

read more

PHOTOS: ADMU Ousts UST

The ADMU Lady Eagles overpowered UST in 4 sets, ousting the Golden Tigresses and advancing to the V-League finals

read more

The Flick List (Themed)

Guess the theme! Have you seen Twilight, Sister Act and these other movies? Share your thoughts and reviews in here!

read more

REVIEW: Star Trek

Visually breath-taking and action-packed, Star Trek: Into Darkness will please casual and hardcore fans alike.

read more

PROMO: Epic

Join now and get a chance to win advanced screening tickets to Epic!

read more

Page 122 of 131 FirstFirst ... 22 72 112 121 122 123 ... LastLast
Results 2,421 to 2,440 of 2618
  1. #2421
    Question lang sa mga experienced java devs, I'm currently working for a consulting company. 2 years na exp ko with Struts, Spring, Hibernate and I've also used iBatis in one of my projects before. I also know RIA javascript architectures - Flex, ExtJS and Dojo.

    Ano na ba market value ng skillset na to ngayon? Please pm kung bawal ipost. Thanks!

  2. #2422
    Quote Originally Posted by boonhero View Post
    @sorhan777 - try SVI or wideout.
    May website ba sila or email na pwede i submit yung mga CV namin..

  3. #2423

    SPRING - mutliple submit buttons

    hello java peeps, I'm searching on how to implement multiple submit buttons. Currently I'm doing it using a javascript function, and set a request parameter. And on my controller I just compare the parameters and call a specific function.

    Here's my code for javascript

    Code:
    function submitform(){
    document.forms[myform].action  = "save.jsp?param=save";
    document.forms[myform].submit();
    }
    here's my controller
    Code:
    @RequestMapping(value="save" , method = RequestMethod.POST)
    public ModelAndView saveForm(HttpRequest request){
    
    if (request.getAttribute("param").equals("save")){
     // call save function
    save();
    
    }
    if (request.getAttribute("param").equals("delete")){
     // call delete function
    delete();
    }
    
    return new ModelAndView();
    }
    So far, I am able to do what I want with that approach.
    So my question is , is this a good way of implementing multiple submit buttons? if not , what better suggestion can you advice?

    Thanks in advance!

  4. #2424
    Quote Originally Posted by redcode7000 View Post
    hello java peeps, I'm searching on how to implement multiple submit buttons. Currently I'm doing it using a javascript function, and set a request parameter. And on my controller I just compare the parameters and call a specific function.

    Here's my code for javascript

    Code:
    function submitform(){
    document.forms[myform].action  = "save.jsp?param=save";
    document.forms[myform].submit();
    }
    here's my controller
    Code:
    @RequestMapping(value="save" , method = RequestMethod.POST)
    public ModelAndView saveForm(HttpRequest request){
    
    if (request.getAttribute("param").equals("save")){
     // call save function
    save();
    
    }
    if (request.getAttribute("param").equals("delete")){
     // call delete function
    delete();
    }
    
    return new ModelAndView();
    }
    So far, I am able to do what I want with that approach.
    So my question is , is this a good way of implementing multiple submit buttons? if not , what better suggestion can you advice?

    Thanks in advance!
    http://static.springsource.org/sprin...rence/mvc.html

    Search or Goto:
    13.11.3. Mapping requests with @RequestMapping

    Note: for every action has corresponding 1 method for example you have a form that has save, update, delete you must create each a method then annotate them with correct RequestMapping.

    BTW ModelAndView is oldschool. Base on generate of SpringRoo and Latest sample of Spring MVC they don't use now a ModelAndView.

    Hope this will help you.

    Happy coding.

  5. #2425
    Thanks for the reply

    Ok, I can see that I need the use of multiactioncontroller to implement multiple submit buttons, however, I cant seem to understand some points of it.

    I am using annotation based controller, so lets say i have add, delete , and update buttons in one form, each are submit buttzons.

    So I would do this :

    Code:
    @RequestMapping("/customer/add.htm")
    	public ModelAndView add(HttpServletRequest request,
    		HttpServletResponse response) throws Exception {
     
    		return new ModelAndView("CustomerAddView");
     
    	}
     
    	@RequestMapping("/customer/delete.htm")
    	public ModelAndView delete(HttpServletRequest request,
    		HttpServletResponse response) throws Exception {
     
    		return new ModelAndView("CustomerDeleteView");
     
    	}
     
    	@RequestMapping("/customer/update.htm")
    	public ModelAndView update(HttpServletRequest request,
    		HttpServletResponse response) throws Exception {
     
    		return new ModelAndView("CustomerUpdateView");
     
    	}

    So, what I don't get here is each method has a request mapping of different htmls. But on my case, all those buttons are included in only one form in one html ofcourse.

    Where am I going wrong here?

    Thank you in Advance!

  6. #2426
    why not create an id? for each type of action. like id=1 is add... etc.

  7. #2427
    @redcode7000

    Ok naman yung unang solution mo, ano ba yung problema sa ganyan? Parang sa struts lang hehe. Or if ayaw mo ng param sa url, pwede mong lagyan ng value yung hidden input box via javascript tapos getAttribute mo nalang.

  8. #2428
    Quote Originally Posted by freekill View Post
    Question lang sa mga experienced java devs, I'm currently working for a consulting company. 2 years na exp ko with Struts, Spring, Hibernate and I've also used iBatis in one of my projects before. I also know RIA javascript architectures - Flex, ExtJS and Dojo.

    Ano na ba market value ng skillset na to ngayon? Please pm kung bawal ipost. Thanks!
    Kung programmer position ka pa din sa current work mo parang more or less 40-50k yata yan. Basta sa mga Foreign company ha lalo na UK, US, Australian, Canadian companies.

  9. #2429
    Quote Originally Posted by tripkoyan View Post
    @redcode7000

    Ok naman yung unang solution mo, ano ba yung problema sa ganyan? Parang sa struts lang hehe. Or if ayaw mo ng param sa url, pwede mong lagyan ng value yung hidden input box via javascript tapos getAttribute mo nalang.
    Ganun ba? as I said, nagagawa ko naman yung gusto ko with that kind of approach, kaya lang, I'm thinking of proper or right way of implementing multiple submit buttons in spring.

  10. #2430
    Ewan ko kung tama to, pero pwede mo rin gawing "get" yung retrieval and "post" yung update and deletions mo.

  11. #2431
    Quote Originally Posted by tripkoyan View Post
    Ewan ko kung tama to, pero pwede mo rin gawing "get" yung retrieval and "post" yung update and deletions mo.
    Actually, lahat ng submit buttons ko ay naka post method, even yung retrieval. I wonder pano ko po gagamitin yung get method in retrieval? kasi normally yung get method is used when the page load diba?

  12. #2432
    Quote Originally Posted by tripkoyan View Post
    Kung programmer position ka pa din sa current work mo parang more or less 40-50k yata yan. Basta sa mga Foreign company ha lalo na UK, US, Australian, Canadian companies.
    Thanks!

  13. #2433
    I wonder pano ko po gagamitin yung get method in retrieval?
    Yung GET method is usually used for, well, GETting resources. Almost same lang sya sa POST in that sense pero if the transaction is "idempotent", then GET is the way to go. Use POST in sending requests to POST data (e.g. logins, submitting filled out forms and the likes). There are also differences in the amount of data you can send between GET and POST.

    Also,

    document.forms[myform].action = "save.jsp?param=save";
    doesn't look that sexy. See if you can use hidden form element or create one on the fly as alternatives for sending the value of "param" parameter.

  14. #2434
    Actually, lahat ng submit buttons ko ay naka post method, even yung retrieval. I wonder pano ko po gagamitin yung get method in retrieval? kasi normally yung get method is used when the page load diba?
    For retrieval, recommended na GET yung gamit mo. Kasi standard yun sa RESTful design. Hehe. Yung parameters din pag nag GET method ka nakalagay sa URL. Parang site1?username=test tapos sa POST naman nakalagay sa request body.

  15. #2435
    Thanks po sa mga reply nyo. :-)

    how about po pala using ajax for retrieval? mas efficient ba yun? I've no experience using ajax eh. Parang nabasa ko lang na it can connect to server without reloading the page so pwede sya sa retrieval operations.

    Any Idea? Thanks!

  16. #2436
    Kung iba iba yung niloload mo sa page, mas OK nga ajax. (example if using tabs) Pero kung one page lang yan, wag ka na mag ajax. Saka try to use javascript libraries kasi usually, tested na yun cross browser and additional skills din yun.

    Tama din si lhorenz, gawin mo nalang hidden yung parameter na "param" or create a hidden text box on the fly before submit.

  17. #2437
    how about po pala using ajax for retrieval? mas efficient ba yun? I've no experience using ajax eh. Parang nabasa ko lang na it can connect to server without reloading the page so pwede sya sa retrieval operations.
    Use Ajax if requirement na dapat highly interactive yung site. Parang facebook lang. Tuwing may nag post, nagpapakita sa feed mo kahit hindi na i-reload yung page.

    Actually, misnomer yung Ajax eh. Yung madalas na payload kasi na ginagamit ay JSON hindi XML. Dapat asynchronous javascript and json or AJAJ. Haha

  18. #2438
    I see, Thanks po.

    So far, hindi naman highly interactive yung ginagawa ko eh. More on parang data transaction lang. Hehe...

    Thanks for being helpful guys!

  19. #2439

    Ajax Request - Call different method on SPRING CONTROLLER

    hi java peeps,

    I've been having a problem regarding, I have a form which has a lot of fields , and each fields retrieves a data depending on the associated button that was clicked.

    So, each my button, needs to call an ajax request, then the response will be displayed on the associated field.

    I wonder if it is possible to call different method in my spring controller once i clicked on different button?

    In other words, I want to make a multiple ajax request, and each request will call different method.

    for example this code :
    Code:
    // when get account detail is clicked it will call this method
    @RequestMapping(method=RequestMethod.POST)
        public @ResponseBody String getAccountDetails(@RequestParam(value="accountid") String accountid){
        	
         return somefunct.getAccountDetails(accountid);
    
        }
    
    
    
    // when get account summary is clicked it will call this method
    @RequestMapping(method=RequestMethod.POST)
        public @ResponseBody String getAccountSummary(@RequestParam(value="accountid") String accountid){
        	
          return somefunct.getAccountSummary(accountid);
    
        }
    
    
    
    /* when submit button is clicked... Form is submitted for saving*/
    @RequestMapping(method=RequestMethod.POST)
        public String submitForm(){
        	// save here
        	return "myform";
        };*/

    Currently what I can do, is to have one ajax request only.


    Please , if anyone could help me on this.I really need this functionality and would greatly appreciate your feedback.



    Thanks In Advance!!!

  20. #2440

    SOLVED (Ajax Request - Call different method on SPRING CONTROLLER)

    ok guys, I was able to solve it now!..

    I just need to provide a value in my request mapping

    Code:
    // when get account detail is clicked it will call this method
    @RequestMapping(value  = "/detail",method=RequestMethod.POST)
        public @ResponseBody String getAccountDetails(@RequestParam(value="accountid") String accountid){
        	
         return somefunct.getAccountDetails(accountid);
    
        }
    
    
    // when get account summary is clicked it will call this method
    @RequestMapping(value  = "/summary", method=RequestMethod.POST)
        public @ResponseBody String getAccountSummary(@RequestParam(value="accountid") String accountid){
        	
          return somefunct.getAccountSummary(accountid);
    
        }
    
    
    /* when submit button is clicked... Form is submitted for saving*/
    @RequestMapping(method=RequestMethod.POST)
        public String submitForm(){
        	// save here
        	return "myform";
        };
    then, the ajax code for each button is

    Code:
    // button detail is clicked
    
    $("#btndetail").click(function() {
    										var accountid= $("#accountid").val();
    										$.ajax({
    type : "POST",
    url : "/mypage/detail",
    data : "accountid=" + accountid,
    success : function(response) {// we have the response
    alert(response);	},
    error : function(e) {
    alert('Error: ' + e);
    }
    });
    
    										});
    
    
    
    // button summary is clicked
    
    $("#btnsummary").click(function() {
    										var accountid= $("#accountid").val();
    										$.ajax({
    type : "POST",
    url : "/mypage/summary",
    data : "accountid=" + accountid,
    success : function(response) {// we have the response
    alert(response);	},
    error : function(e) {
    alert('Error: ' + e);
    }
    });
    
    										});

Page 122 of 131 FirstFirst ... 22 72 112 121 122 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Whats Happening

Sub title

The Flick List (Themed)
Guess the theme! Have you seen Twilight, Sister Act and these other movies? Share your thoughts and reviews in here! view more


PROMO: Epic
Join now and get a chance to win advanced screening tickets to Epic! view more


The Wander List
Have you smashed plates in Tarlac been to the beaches of Bali? Tick your travel exploits off in our Wander List! view more


Caught Up Default

Sub title

Trailer: The Great Gatsby
Baz Luhrmann directs an ambitious, visually stunning tale of love, dreams, and tragedy in The Great Gatsby. view more


Review: Star Trek
Visually breath-taking and action-packed, Star Trek: Into Darkness will please casual and hardcore fans alike. view more


Review: Evil Dead
With an absurd amount of violence mixed with tons of terror and scares, Evil Dead is a must-see for horror movie fans. view more


Review: One Piece
Is One Piece Film Z an epic nautical adventure worth experiencing? Find out in this review! view more


Review: Trance
Director Danny Boyle delivers tons of twists and turns in this well-written mind-bending action thriller view more




Forums Directory