Jump to content

Mixaalser684

Members
  • Posts

    51
  • Joined

  • Last visited

Posts posted by Mixaalser684

  1. "Refreshing" an element would mean getting the new markup for it from the server via ajax, and either removing the element from the DOM and adding the new one (or, more specifically, inserting the new one before or after the old one, then removing the old one), or using innerHTML to replace the content if you're only returning the content and not the entire element. It would be faster to use innerHTML to just replace the content of the element. I don't see a problem with using the custom tags in JSP though, if you send a request to JSP then it should return valid HTML, it shouldn't return the actual JSP code. That's assuming that the request goes through the normal pipeline to convert the JSP tags to valid HTML that the browser will understand. The browser doesn't use or understand your custom tags, those are only used by JSP. Telling the browser to use a custom tag wouldn't have any effect, I'm not sure what you're trying to achieve that you thought that would solve the problem.
    I understand perfectly what You are saying here, and that would be one approach, but You missinterpret what I meant when I said "refresshing an element".Let me expalin a little bit more.If I choose to leave the custom tags on the page, I tought, instead of returning an HTML and updating the element,I could manipulate the custom tag attribute object, which is responsible for filling the custom tag with results (an array list like object), and that change would be propagated in already rendered HTML element.The only problem I ran on here is after I manipulate the object I need to refresh the page in order to se the changesin the rendered HTML tag.Watch the video carefully and You'll see exactly what I mean.
    So this would be the second approach and my question is, is there a way to see these changes without manuallyrefreshing the page (if reloaded automatically with location.reload but it's not an elegant solution).The best solution would be if there was some function to reload rendered HTML element only and not the entire page?Is there such a thing in JavaScript or jQuery?Thank You.
  2. The original custom tag gets rendered by JSP as a select element. You're trying to use Javascript to attach the custom tag to the page, but the browser doesn't know what that tag is. You need to have the server return the rendered select element HTML code, not the JSP code. The browser doesn't understand JSP, that runs on the server.
    So the custom tags are off then.If the only way is to return the rendered HTML elements (and not custom tags) then I don't need them at all (in their current form).There was one more mechanism, I thought of, that could involve using the custom tags, but in order to use it successfully I need to figure out how to refresh HTML elements without re-submitting the page.Can someone please write a JavaScript code example?I've tried some searching online but no luck.Thank You.
  3. Do you have a code example to illustrate the problem?
    Of course, here is the video clip.

    Also, I have tried to create this element in Javascript callback function, but I'm getting DOM error no. 5.I know how to solve my problem (create a function that will hard code HTML elements as string) but I was wondering can this be solved via custom tags (if not then there is no need to use them, and they are really neat if you want to avoid code duplication).If You need some more information I'm at your disposal. Thank You.
  4. I have the need to have custom JSP tags in my web application.My custom tag works well when I run the application.Since I use Ajax (Javascript + Servlet + JSON) i tried to create my custom tag as a DIV element child in my Ajax Callback function.I tried using innetHTML method and createElement methods, and none of them works.So, I was wondering is this possible to do (or not) and how if it is?Thank You.

  5. Currently I'm learning Ajax with Java.The innerHTML method works when I'm retrieving simple string data from the servlet, and when I need to update only one HTML element.Since I have the need to update more HTML elements it occurred to me that I can use JSON object with several properties (HTML tag data for each element needed updating).After trying that I've noticed that innerHTML method doesn't work, when I try to process the retrieved data in the Callback function.My question is, why is this happening?Did someone had a similar problem when using JSON with Javascript.Just for the record, when I use innerText method I successfully update the HTML elements with JSON properties data, only they update as text and that's what I don't need. (See the video)

    Thank You.
×
×
  • Create New...