I am trying to develop an ssp page that will pass a parameter to a method using tag library, then get the result of that message and display it in the ssp page. I tried using the setPropertyTag class but somehow the page was not able to read it. Can someone help me how to use this class? Is there another way to handle such case?
Here is an excerpt of my .tld file: <tag> <name>set</name> <tagclass>VisualWave.SetPropertyTag</tagclass> <info>Allows you to set attributes of an object which has been declared with a usebean tag. </info> <bodycontent>empty</bodycontent> <attribute> <name>name</name> <required>true</required> </attribute> <attribute> <name>property</name> <required>true</required> </attribute> </attribute> <attribute> <name>methodName</name> <required>true</required> </attribute> </attribute> <attribute> <name>param</name> <required>true</required> </attribute> </attribute> <attribute> <name>value</name> <required>true</required> </attribute> </tag> This is how I call the tag from the ssp file: <cincom:set name="model" property="HotTapEDIDiagnosticToolForWeb" methodName="retrieveBatchesFor:" param="aDunsNumber" value="248799413"> |
Hi,
Just checking, but do you have the following directive earlier in the .ssp file? <%@ taglib uri="file:myTags.tld" prefix="cincom" %> Next, I'm a bit unclear on what you're trying to do here: <cincom:set name="model" property="HotTapEDIDiagnosticToolForWeb" methodName="retrieveBatchesFor:" param="aDunsNumber" value="248799413"> The value of property looks like a class name, but the TagHandler class is going to expect the name of an instance variable. By convention, instance variables begin with a lower case character. The value of param is expected to be the name of an <input> element in a <form> that is being passed via the HTTP request object. This is an optional property. If you include it, it means you want to get a value from an HTML <form> directly into a "bean" (i.e., an instance of a class, created by useBean. So, either you would use param or else value, but I assume not both. (Also, I assume your ssp includes the closing tag </cincom:set>, or there's a typo in your message and the "/" is missing from the end of <cincom:set ... />.) If this doesn't help to clear up the problem, what do you mean "somehow the page was not able to read it"? What happens, exactly? To answer your last question, yes, you could also do everything with straight Smalltalk script and page (or session) variables, e.g. ASP-style: <% model := (HotTapEDIDiagnosticToolForWeb new) retrieveBatchesFor: 248799413; yourself. %> Tag libraries (what you are doing now) are a JSP-style approach, and there are various trade-offs between ASP and JSP style. Personally, I find the Smalltalk script approach to be easier. You don't have to mess with the tld file and create handler classes for each bit of functionality. OTOH, if your app needs to read in a whole bunch of form elements or if you want to write loops to generate lists of search results, tag libraries can help to create more compact and readable pages. They also help to organize your application and avoid messy code such as "response write: '<b>' , foo printString , </b>". HTH, M. Roberts Cincom Systems, Inc. On 6/21/2012 2:48 AM, jhoconer wrote: I am trying to develop an ssp page that will pass a parameter to a method using tag library, then get the result of that message and display it in the ssp page. I tried using the setPropertyTag class but somehow the page was not able to read it. Can someone help me how to use this class? Is there another way to handle such case? Here is an excerpt of my .tld file: <tag> <name>set</name> <tagclass>VisualWave.SetPropertyTag</tagclass> <info>Allows you to set attributes of an object which has been declared with a usebean tag. </info> <bodycontent>empty</bodycontent> <attribute> <name>name</name> <required>true</required> </attribute> <attribute> <name>property</name> <required>true</required> </attribute> </attribute> <attribute> <name>methodName</name> <required>true</required> </attribute> </attribute> <attribute> <name>param</name> <required>true</required> </attribute> </attribute> <attribute> <name>value</name> <required>true</required> </attribute> </tag> This is how I call the tag from the ssp file: <cincom:set name="model" property="HotTapEDIDiagnosticToolForWeb" methodName="retrieveBatchesFor:" param="aDunsNumber" value="248799413"> -- View this message in context: http://forum.world.st/VisualWave-SetPropertyTag-question-tp4635741.html Sent from the VisualWorks mailing list archive at Nabble.com. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |