Показать сообщение отдельно
Старый 28.10.2006, 16:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Solutions Monkey: EP Samples from TechReady3
Источник: http://blogs.msdn.com/solutions/arch...25/678097.aspx
==============
Yesterday (07/24/2006) I presented at TechReady3 (Microsoft‘s Internal Technical Readiness Event) on the EP Session. I demoed creating a web page to display vendor list with “zero code”. And then I demoed how you could do the same thing completely through coding to control the layout and format. Then I demoed the WebPart Connection and how you can control what is being displayed on the left menu based on some business logic and here is the code sample that I used.
Here is the sample code of the weblet that I created in this demo
public class TechReadyWebLet extends WebLet
{
boolean _even;
}

public void run(Args args)
{
str ret;
VendTable vt;
ret = "Top 10 Vendors

";
ret += "";

_even=1;
while select vt
where vt.AccountNum < '3010'
{
if ( _even ==1)
ret += "";
ret += "";
if ( vt.VendGroup == '10')
ret += " ";

if ( vt.VendGroup == '50')
ret += " ";

ret+= vt.name + "
";
ret += vt.address + "
" + vt.state +" " + vt.zipcode + "
" + vt.countryregionid + "";

if ( _even ==0)
ret += "";

_even = _even ? 0 : 1;
}

ret += "";
webSession().writeTxt(ret);

}
Here is the sample code that I used in EPVendTableInfo Web form to demo the Web Part connection

public boolean showMenuFunction(WebMenuFunction _menuFunction)
{
boolean ret;
ret = super(_menuFunction);
if (_menuFunction.name() == weburlitemstr(EPDocuList) && vendTable.VendGroup == '50')
ret = false;

return ret;
}

public Common setMenuFunctionRecord(WebMenuFunction _menuFunction, Common _cursor)
{

Common ret;
if (_menuFunction.name() == weburlitemstr(EPDocuList))
ret = null;
else
ret = super(_menuFunction, _cursor);
return ret;
}


==============
Источник: http://blogs.msdn.com/solutions/arch...25/678097.aspx